[Geeks are Sexy] technology news

Sunday, May 14, 2006

Automatically Optimize your Hard Drive Under Windows XP

Everyone knows that a hard drive in bad shape will really slow down your computer. Usually, to optimize the way it works, people will use a defragmentation utility, but unfortunately, this process can be long and tedious. What most of you guys don't know is that there is a way to do this when your xp box is idle. All you have to do is:

(Warning: Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft or I cannot guarantee that these problems can be solved. Modify the registry at your own risk.)

  • Go to Start->Run, type regedit and press OK.
  • Browse to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ OptimalLayout
  • Now, under the OptimalLayout key, you should find a DWORD string named EnableAutoLayout. (If it's not there, just create it, as seen in the picture below). Edit this DWORD value and change it to 1.
  • Exit the registry editor, reboot and voila! You're done!

Now, each time your computer will be idling, XP will start re-arranging files on your hard drive so that access-time to them will be minimal.


  • Before I go about editing my registry, I generally like to have some kind of picture of what those changes will do to my system. So what exactly does OptimalLayoutNow do to system operations in the background, and how would this possibly impact normal performance?

    By Blogger theMatt, at 12:17 PM  

  • What this usually means is: Much like Diskeeper, XP will try to arrange files during 'down time' or 'off hours' while the PC is on to make programs appear to start faster. The problem, as I see it, is that there is no real way for it to know what really is important to start fast. What this usually leads to is: More defragmentation than is prevented. Typically gamers - disable this 'feature' and stick to defraging the drive on a pre-determined regular basis. Defragmentation only is lengthy the first time it is done. When properly maintaining a harddrive - defragging isn't a lengthy process or a cumbersome one. While the author's intentions, as I am sure where pure, My honest opinion is - research the best case scenario (for your habits/usage of your pc) and go with that plan.

    By Anonymous Anonymous, at 1:32 PM  

  • I don't have much experience with XP; however, I do have extensive experience with earlier Windows versions - and I am intimately familiar with FAT hard disk file orientation.

    First point: files accessed most often should be at the beginning of the drive - with the Windows swapfile being right at the forefront - for fastest possible data transfer rate. The least-often accessed files should be stored at the end of the drive, where the data transfer rate is slowest. User files that are being worked on belong in the clear space, in the middle.

    Second point: never defrag a drive that has multimedia files on it - they get trashed. Many times I have observed .mp3 files being corrupted by a defrag - as a binary file comparison with their original (undamaged) archive copies on CDR discs clearly proves. Keep your multimedia files on a separate drive altogether, and never defrag it - they will remain intact that way.

    By Anonymous docatomic, at 2:17 PM  

  • docatomic's second point is total rubbish. Who the hell doesn't have mp3's/multimedia on their home pc? If your files are getting corrupted, it's pretty obvious you're a noob.

    I regularly use a program called O&O Defrag Professional and have never had a problem with corrupted files and I'm a hardcore pirate. My only advice is try to do all your defragging from the GUI, not from preboot conditions for safety.

    By Anonymous Anonymous, at 2:28 PM  

  • Perhaps I should have been more specific - I was referring to Windows 98SE (as well as 95b), running on a FAT32 partition; under that setup, right-clicking on a drive icon and choosing Properties~Tools~Defragment _will_ corrupt .mp3 files. They develop small 'ticks' and 'pops'; if continued over many defrags, eventually they can even refuse to play entirely. This has always been my experience, since the days of Windows 95, and throughout many installations of Windows 9x on many different machines. It is for this reason that I adopted the practice of _always_ either partitioning a drive into separate primary partitions (with Ranish), or else installing second or even third drives in the system... as in my current setup right now, which involves 98SE running on the C: partition, the swapfile on the D: partition (the first physical partition, on the boot drive), and 440 GB of additional partitions, on four SCSI drives in an external enclosure - which _never_ get defragmented, period. For me, this proves to be both reasonably safe, and satisfactory in performance.

    By Anonymous Anonymous, at 3:31 PM  

  • You might have had a bad IDE cable or poor IDE controller, or any other myriad of possibilities. Doing a defrag is an intensive process and particularly with multimedia files a large amount of data will be pushed around, hence stressing your system. If an md5sum for a file before a defrag fails to match up after it, that would most likely suggest a hardware issue. Best advice when it comes to defragmentation is to keep your heavily utilized drives at least 20% free and defrag as necessary. Here is the msdn page that mentions the background auto layout key:


    By Anonymous Anonymous, at 7:12 PM  

  • Defrags do not screw up multimedia files, on Win98 or otherwise. My experience tells me this.

    Furthermore, considering that defrag programs are don't know what they are defragging, if they cause data corruption in MP3 files, they will do so with other data files and executables as well. Meaning, after a defrag your OS probably will no longer be bootable.

    This obviously does not occur.

    What "anonymous" has experienced is almost certainly that his MP3s had ticks and pops to begin with due to poor ripping but he didn't notice them until after a defrag.

    Michael Tam
    vitualis' Medical Rants

    By Blogger Michael, at 7:13 PM  

  • If defrags "messed up .mp3s" they would mess up all binary data, such as games and anything in a zip file.

    By Blogger Dan Weber, at 9:57 PM  

  • "What "anonymous" has experienced is almost certainly that his MP3s had ticks and pops to begin with due to poor ripping but he didn't notice them until after a defrag."

    No, that is not the case at all. The original files, as archived on CDR discs, are clean. The files on an undefragged hard drive also remain clean. Running Windows 9x defrag on a FAT32 partition _does_ affect .mp3 files adversely - as I said earlier; a binary file comparison (using CloneMaster, or even fc /b on an individual basis) proves this - there are discrepancies between the archived files and the files on a defragged drive, and they do affect the sound quality. I learned this while working in the sound industry, during the days of Windows 95 - and after seeing many files getting damaged, I finally caught on to what was doing it. I don't know if this problem exists in an NTFS filesystem, with either 2K or XP - I haven't tried to find out if it does, with those.

    As for the person who was earlier suggesting bad cables - no; as I said, I've seen this on many different machines and installations now... and with both IDE and SCSI, so it's definitely not an interface problem; it's entirely due to Windows 9x defrag.

    And it's not only me - others had complained about this problem too, about a decade back... it's likely the issue has been long forgotten, now. There was, I seem to recall, some speculation at the time; that perhaps Microsoft had designed defrag that way on purpose - to trash the 'open' .mp2 and .mp3 formats, but allow their proprietary .wma files to come through clean.

    By Anonymous Anonymous, at 10:21 PM  

  • Okay - a quick Webcrawl reveals at least *one* other person who has encountered this problem:


    I still maintain, from my own years of experience, that it's the Windows defrag that's doing it - otherwise, why would my .mp3 files _always_ remain clean and uncorrupted, when they are on partitions that I do NOT defrag? (I do defrag the C: partition regularly; however, that's because there are no .mp3 files on it).

    By Anonymous Anonymous, at 10:38 PM  

  • So we care? I mean there are like 3 people still running 9x. So, if they would just realize that they are running an OS from the LAST CENTURY perhaps we could all sleep better.

    Tell ya what. Gimme your postal address, and I will send you a freaking linux CD.

    By Anonymous FredthePeguinKing, at 10:48 PM  

  • Sorry, Fred - I'm not trying to be a zealot about this; I'm merely relating my experiences, that's all. Really, it's more a curiosity thing - I mean, I have observed it, and found the cause; however, I've always wondered about the *why* of it. That's all...

    As for people running 9x; well - there's a lot more that are still running it than "3", believe me! Think; all those older Pentium and Celeron systems still around - the ones that you see being sold at swap meets, and pawnshops, for dirt cheap. Think; "third-world" countries - they exist too, after all. And so Windows 9x still very much lives.

    As for Linux, well - I'm playing with VectorLinux 5 on another machine right now, actually... ;-)

    By Anonymous Anonymous, at 11:35 PM  

  • I'm merely relating my experiences, that's all.

    Exactly. n=1 experience.

    However, the vast majority of the people who have used Win9x and defragged and used MP3s have not experienced this. Furthermore, it isn't even technically plausible why a defrag would specifically screw up MP3s but not other files.

    I still maintain, from my own years of experience, that it's the Windows defrag that's doing it - otherwise, why would my .mp3 files _always_ remain clean and uncorrupted, when they are on partitions that I do NOT defrag?

    Well, then you're on your own. The only way to "prove" this is an immediate pre and post defrag comparison of the files, something that you have not done.

    As before it isn't plausible why defrag would preferentially cause data corruption on MP3 files.

    Michael Tam
    vitualis' Medical Rants

    By Blogger Michael, at 1:18 AM  

  • "Well, then you're on your own. The only way to "prove" this is an immediate pre and post defrag comparison of the files, something that you have not done."

    ?? But I *have* done that - as I said; the .mp3 files on a Windows 9x defragged FAT32 drive do _not_ compare bit-for-bit with the archived originals, on CDR. And, as I also said, this is not a one-time experience; I have encountered it on a number of 9x boxes over the years... why? I don't know - all I know is that it does actually happen. Microsoft hard-coding something into 9x defrag for .mp* files? Some weird stealth virus that targets them? McAfee, Norton, and AVG have never revealed such, if it's actually there... so no; I really don't know what could be causing it.

    As for the effect being "imaginary", well... tell that to CoolEdit, then - you can _see_ the ticks and pops, in there. Maybe most people don't actually listen closely enough to hear them?

    At any rate - enough; all I really wanted to say was that a filesystem set to auto-defrag *does* sound like a really good idea - in fact, I've long felt that a proper hard drive I/O subsystem _should_ have that feature incorporated; it should be *completely* automatic, and totally transparent. But - just don't try it with Windows 9x, allright? I know that many of you feel that such an "obsolete" OS should have been put to death a long time ago, but the fact remains that in the real world, it *is* still used, and to a much larger extent than you may be willing to believe or accept. Nevertheless, it is... and lest some of those remaining 9x users get the wrong idea from reading this particular article, thinking that they could somehow adapt the principle of it or something, I just thought I'd put my experience with such here as a possible caution to them. Okay?

    I am _not_ "anti-progress"; I'm all for great and wonderful new things... indeed; I've got "progress" to thank immensely, for my never-ending supply of absolutely free computers - and my employment, in repairing same. Just don't forget though, that the rest of the world still far outnumbers you...

    Good night.

    By Anonymous Anonymous, at 2:31 AM  

  • docatomic is right about the Mp3's on defragging on older OS's,
    So not rubbish,
    Seen this a few Time's happen,
    The Mp3 file start's to skip and eventually will be really corrupted,
    So yes it does happen on older OS's, Argue all you like lol,
    It happen's,

    By Anonymous Anonymous, at 7:41 AM  

  • Okay, explain WHY it happens. And why defrag on old OS isn't relegated as extremely dangerous as it will cause data corruption.

    A defrag program is agnostic to the actual data or datatype. If it causes corruption of MP3s, then it will also cause corruption of other forms of data including executables. This is not known to occur.

    As for problems with MP3s on your HDD vs CD-R, the may indicate data integrity issues of your HDD. That in itself has nothing to do with a disk defrag. Perhaps a defrag simply unmasked unmarked bad sectors on your HDD, but you haven't even shown that either.

    The only association you have is that HDDs that you have defragged led to problematic MP3s vs. HDDs that you haven't defragged. That is not proof. It is barely even evidence.

    Michael Tam

    By Blogger Michael, at 9:53 AM  

  • I don't get it...

    A defrag software takes the scattered data all over the disk, and just stick all the pieces togeter, and it also adjust the FAT or MFT so that the pointer points at the correct locations. Why would a defrag ONLY do this to media files? a file is a file, video, audio, text, it's all the same "physically" talking on the disk.

    By Blogger Kiltak, at 11:00 AM  

  • Matt,

    Don't know if you got the post on this I sent yesterday, but I can
    testify that defraging media files can cause huge problems. It happened
    to me. At this point I'm not willing to risk that pain again and have
    gone to the copy to a clean disk method as described in earlier posts,
    safer and often quicker too.

    Mike Fleming
    Creative Director
    West Coast Video Productions
    (415) 731-2253

    By Anonymous Anonymous, at 9:41 AM  

  • http://home.ease.lsoft.com/scripts/wa.exe?A2=ind0408&L=vidpro&T=0&P=34157

    By Anonymous Anonymous, at 9:42 AM  

  • Docatomic is correct. Defragging has messed up my .mp3's in the past.

    n=lots of people now

    I find that changing the access rights on my mp3's to read-only prevents this future problem.

    By Anonymous Anonymous, at 8:45 AM  

  • I know this is an old post but I'd like to add my 2c. If you don't like messing with your registry you can also download tweakUI from the Microsoft power tools website. Under the "General" section of TweakUI, check "Optimize hard disks when idle"

    By Blogger Kyle, at 10:39 PM  

Post a Comment

Links to this post:

Create a Link

<< Home