Defrag your hard drive + Configure defragmentation schedule in Windows 7
You can have several types of hard drives in your computer: a mechanical hard drive spins to fetch your data as needed (thus the term "hard disk"). Another type of drive is "SSD", or solid state drive - it uses the same "Flash memory" technology found in portable USB "thumb" drives, that have no moving parts. Your PC can have a mix of mechanical and SSD drives.
As time passes, you end up having data scattered throughout the drive, with related files stored in different portions of the same disk, sometimes even pieces of the same large file stored in pieces, in multiple places: this happens because deleted files are not actually removed from the drive until Windows uses that "deleted file" space for new content - only "logical" references to deleted files are removed from the file system (why is why deleted files recovery programs can work!)
This also means that Windows 7 has to do more "work" to save and retrieve "fragmented" files - to overcome the problem, Microsoft has built into all versions of Windows, as far as we can remember, a "disk defragmenter" tool, designed since recent versions of Windows, to run automatically in the background; in other words, Windows 7 takes care of its own maintenance, with a caveat we'll cover in this tutorial. You'll also learn how to manually launch a defragmentation and re-schedule it.
- In this Windows 7 tutorial:
- Manually defrag your hard drive
- When should you defragment?
- (Re-)Schedule hard drive defragmentation
- Disable automatic defrag
Manually "defrag" your hard drive
By default, Windows 7 is configured to automatically defragment your hard drive on Wednesday at one o'clock in the morning (1am). This setup is ideal if your computer runs all the time, or at least remains "on" at that time; if your PC is turned off, however, or in hibernation, the defrag process will not be launched. If thing remain like this indefinitely, you end up with a never-defragmented hard drive! This is why Windows 7 allows you to manually defrag your drives.
- To launch the Defragmenter tool, click on the start menu, type "defrag" in the search field, and select "Disk Defragmenter" under Programs, as shown on the screenshot below:
- Once the tool launches, you will see a listing of all the "drives" currently visible to Windows 7: this includes regular hard drives (inside your PC or laptop, hidden from sight), as well as any external drives currently connected to your machine (and even weird drives you've never seen before, and can ignore, which are typically used for system recovery or operating system backup).
- And there are two buttons at the bottom of the window: "Analyze Disk" and "Defragment Disk". Start by selecting the drive in which you're interested. Then, click on the first button if you want to get an overview (analysis) of the shape in which the selected drive currently is.
- Caution: depending on the size and age of the drive, and your CPU (processor) speed, the Analyze Disk operation can take a very long time, since Windows has to go through every single file on that drive. You should ideally leave your PC alone during that time - during analysis, but especially during defragmentation itself.
- And click on "Defragment Disk" to start working on the selected drive. Notice that next to each drive's name / letter, Windows 7 will indicate when the last defragmentation occurred. In the case of the laptop, as shown on the screenshot below, you will often have to make a change in schedule, or defrag manually: this is because a laptop is typically either turned off (display down), or set to go to sleep after a very short period of inactivity. "Never run" means that the selected disk was never defragmented:
And this is how you manually defragment drives in Windows 7!
When should you defragment?
As mentioned earlier, much of the fragmentation process happens when (1) lots of files, or large files, are deleted from a hard drive, and (2) the problem is accentuated when you are running out of space: this limits where Windows 7 can save new files, since you may not have contiguous pieces of available disk space available: in those cases, a single large file may end up being stored in fragments, on multiple portions of your hard drive!
Bottom line: aside from regular, automated maintenance, the best time to defrag' your hard drive is after deleting many files. This will allow Windows to put related files "next to" one another; in the case of a mechanical hard drive, defragmentation will also bring back as many files as possible close to the center of the spinning disk, which makes for less rotation and scan-and-seek operations.
(Re-)Schedule hard drive defragmentation in Windows 7
Use the same "Disk Defragmenter" tool to change the defragmentation schedule:
- To pick another date and time, click on the "Configure schedule" button.
- The "Modify Schedule" dialog that opened is pretty intuitive:
- Under the Frequency dropdown menu, pick Daily, Weekly (default), or Monthly. Once a month will be enough for a PC or laptop you don't use most of the time, or computer on which you only "view" files, as opposed to creating and saving them. Once a day is probably overkill for everyone.
- If you chose Weekly or Monthly, pick either a day of the week or a 1-31 date.
- Finally, pick a time at which Windows 7 will automatically run the defrag task: for an always-on computer, choose a time at which you are not likely to be using your PC. For laptops, do the opposite, otherwise defrag will never run!
- To include or exclude specific drives, click on the "Select disks" button, and check or uncheck the hard drives, external drives, or partitions you want defragmented with that schedule - click "OK" to apply.
Prevent defragmentation from running automatically
Tip: to disable defrag altogether, simply uncheck the "Run on a schedule (recommended)" checkbox and click "OK". If you do opt for this option, make sure to run a manual defragmentation now and then, especially after deleting files or moving them to another location.