Windows 7 stop windows from defragment of SSD

keland

Senior Member
Joined
Aug 1, 2012
I have read that one should not defragment a SSD Drive. If this is true then... My OS is windows 7 64bt. I am have 2 256GB SSDs running in raid 1 as my 'C' drive and 2-2TB hard drives are 'D' & 'E'.
My system tells me that windows is handling the defragmentation of my drives. What I would like to know is if there is a way to stop the system from defragmenting my SSD 'C' drives, but let the OS defragment my D and E hard drives. Also is there a way to control which drives the system is defragmenting? Thanks Ken
 
In the attachment, C: is my SSD. As it shows, defrag has never been run. Windows 7 is supposed to be SSD aware, so I would have to guess it does not allow the operation on the SSDs.
 

Attachments

  • Defrag.PNG
    Defrag.PNG
    48.1 KB · Views: 486
Windows 7 "pings" all drives in the very early stages of the Windows boot process to determine what kind of drive it is. If the response is SSD (a 0 or 1, I forget), then defragging is automatically disabled on that drive. The user does not have to do anything.

The potential problem I see here is you have two SSDs in a RAID array. The RAID controller then needs to ensure that information is being properly supplied to the OS. Using Saltgrass' attachment as a guide, yours also should (if all is good) also show defragging was not done.

Having said all that, I do NOT recommend any sort of automatic or scheduled defragging. Period. So I recommend everyone with Windows 7 disable scheduled defragging, and anyone using a 3rd party defragger to disable real-time and scheduled defragging there too.

Why? Two reasons.

  1. It is counterproductive to defrag a drive with potentially 1000s of tiny temporary files on the drive. These include cookies and temporary Internet files. Therefore, you should always run a disk cleanup program (Windows own Disk Cleanup is perfectly good) BEFORE defragging. Auto (real-time) and scheduled defraggers don't "clean out the clutter" before defragging.

  2. You should always defrag from Safe Mode to ensure the fewest number of unmovable files are opened. When defragging from within a running operating system, there will many, many opened, and unmovable files that will impact defragging efficiency.
Also is there a way to control which drives the system is defragmenting?
Absolutely! Do it manually.

The need for a good defragger was more important years ago when drives were small, slow, and had very small buffers, and RAM was more expensive thus the Page File had a greater role on performance.

Today's drives are smarter, HUGE, fast, have large buffers and PCs are coming with gobs of RAM. So defragging is not the problem it used to be. If you need regular defragging, then that means you do not have a big enough hard drive - one that has lots of free space for the OS and disk controller to minimize fragmentation in the first place. It does not matter that files are scattered all over the drive. What matters is the file segments are physically located close together.

Also, while there are many good 3rd defraggers, I don't feel they are necessary (especially if they cost money) and more importantly, the hype about which defragger is more efficient is really a moot point. So what if Defragger A is more efficient than Defragger B which is more efficient than Windows own native defragger? That advantage is lost, starting immediately, the first time the computer is used again as temp files start pouring in, OS and program files are updated, and user files are created, modified, and deleted.

I defrag maybe twice a year - and that is only because in my work, I am constantly trying out (installing and uninstalling) new applications that contain many files.
 
Manual defrag is quite a pain in the ***. Luckily there's a simpler solution that allows you to keep auto-defrag enabled, even if Windows for whatever reason doesn't detect your SSD(s).
Go to your configuration screen > system administration > task scheduler (run as admin). Look up the defrag task in the task library (under Microsoft > Windows). Once you selected the "Defrag" task, hit "Properties" on the right side of the screen. Change the action parameters from "-c" to "/e C:". This tells the defrag program to defrag everything except the drive letters following /e (my SSD is a single partition C:). For more defrag options, simply run the defrag command in a command prompt. Don't forget to enable the trigger for it to run automatically, in case you disabled auto-defrag earlier. I've added a screenshot, but be aware that my OS is in Dutch.

BOOM, done ;)defragsched.png
 
I am not sure what you are getting at. Note that defragging is automatically disabled on SSD drives by Windows 7. So the user need take no action there.

And again, it is counterproductive to defrag with potentially 1000s of temp files on the drive, which happens with real-time or scheduled defragging.
 
The original question was whether there is a way to control which disks or partitions are defragmented. My reply gives a way to control this without installing third party tools. Also, as you said yourself Digerati, Windows may not detect your ssd's if the raid controller doesn't properly forward this information to the OS. My reply also gives a way to tackle this situation, again without installing third party tools (which I'm personally loathe to do if it's not necessary). Whether or not it is desirable to defrag or not, or whether or not it is desirable to use another tool than the one provided by Windows itself are different questions, both of which I don't try to answer in my previous post.
 
Back
Top Bottom