We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

How do I Defragment?

By R. Kayne
Updated: May 16, 2024

In the normal course of using a computer files and folders become fragmented on the hard drive(s). What this means is that files are not located intact in contiguous space but spread out in bits here and there. Retrieval and even saving files takes longer and in extreme cases can lead to errors. To improve performance, one should defragment drives as part of routine computer maintenance.

Software designed to defragment reads data and writes fragments to available space, recombining the fragments into complete files. Some types of defraggers will relocate program files together, and move data to the front of the drive, leaving all available space to occupy a single contiguous location behind stored data. Other programs do not condense available space, or in some cases it's an option that is user configurable.

Many factors play into how long it takes to defragment a drive. The design of the software itself can add to the time factor or speed along the process. A large drive with a lot of data will obviously take longer to defrag than a small drive with little data, and a drive that is nearly full, be it small or large, also adds to the time factor because there is so little available space to work within in the defragging process. Regardless, regular defragmenting cuts down on the time it takes to complete the job, and in the best case scenario it will only take a few minutes. If defragging has never been done on a large storage space, leaving the defragger to run overnight might be a good idea.

Most operating systems (OSs) such as Windows® include a built-in defragger. You can reach it through different paths, depending on the OS. In XP® try the Start button, Programs, Accessories, highlight System Tools, and look for Disk Defragmenter. If you can't find it, go to the system's main Help menu and search for "disk defragmentation."

Some people prefer using a third party program to defragment. One popular commercial program is Diskeeper®, which includes the ability to defragment at shutdown or startup. This allows the program to defrag the pagefile, which isn’t available when booted into Windows. You can also choose to have defragmentation running continuously in the background, preventing disks from becoming fragmented in the first place; though some believe this causes undo wear-and-tear on the drive. If you prefer lean software, an optional, free, open-source program is UltraDefrag©.

In addition to these two programs that bookend opposite ends of the spectrum, there are many proprietary shareware programs that fall between. Read reviews from reputable websites to get an idea of which program you might like.

While defragging should not cause problems, it’s always wise to backup the system before performing maintenance, then again when finished. Since the process can slow the system depending on the program used and other factors, it might be better to manually start the process when you won’t be working on the computer. Otherwise the scheduler should be set to defragment at least once monthly, and preferably every two weeks, or as needed.

EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
By anon70544 — On Mar 14, 2010

is it possible to Defragment through the C code, and how?

Share
https://www.easytechjunkie.com/how-do-i-defragment.htm
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.