TechSpot

disk defragment query

By matav
Jul 28, 2007
  1. why does disk defragment need 15% to run effectively?
    and how will it affect if i run it with only 5% (or less) free space left?
     
  2. gbhall

    gbhall TechSpot Chancellor Posts: 2,361   +52

    During defragmentation simple(stupid) defragmenters copy a whole file at a time to a sufficiently large continuously empty portion of the disc, then delete the original file. Thus if by chance, a very large file occurred early in the defragmentation cycle, there might well not be enough continuous free space for it, and defragmentation will fail.

    Presumably the defragmenter you are using has a safety margin built-in, which assumes that at 15% free space there is little likelihood of this situation arising.

    In practice, at 5 % empty, the search for enough continous free space for every file to be moved takes a very long time, and indeed, simple defragmenters can end up in a deadly embrace, or apparently 'seize-up' at this level.

    To solve the problem, you could make back-ups of large files manually to some other media (make VERY sure the backup is safely readable and exact), then delete the larger files yourself. When below above the 15% free space limit, you can defragment much more quickly, and finally (if you must) copy the backed-up files back, where they will be automatically defragmented at the 'top' of you disc.

    None of the above applies to professionally-designed defragmenters, but then, who said MS has professional programmers? In reality the defragmenter shipped with Win XP for instance is a cut-down version of a commercial product.
     
  3. matav

    matav TS Enthusiast Topic Starter Posts: 174

    yeah... i knew that safety margin built-in part... but my exact prob is...
    i have a HD partition of 40Gb and 5% free space... i have only music on this with an average file size of 5mb.
    .
    so now i know theres a good safety margin
    .
    whereas on my other HD partition of 40Gb, i have softwares, some are maximum 1000mb and i have 5% space left here again.
    .
    5% of 40gb is approx. 2gb... so technically (taking the safety margin in consideration), both should get defraged without problem... unless multiple files are moved to the free space at one time.
    .
    so does defrag happen file by file or multiple files simultaneously?
    .
    besides this, where can i get a professional defraging software, i have one IOBitSmartDefrag but it doesnt seem to work as good as i thought it will.
     
  4. gbhall

    gbhall TechSpot Chancellor Posts: 2,361   +52

    Last time I looked, diskeeper has a 'lite' version which is free (just requires registration). It is fully professional, but is ALSO the basis of the defragmenter built into Windows XP (which you will be able to tell if you try it).

    There is no reason why you cannot install and run it, then de-install it again. You will find if you leave it there it will tend to pester you a little to buy the full version, that's all, but it does work fine.

    BTW although 5% free seems to give you 2Gb free, it is not the FREE portion that matters - it's the CONTINUOUS free bit that is crucial, and that could be well below what a simple defragger needs.....
     
  5. matav

    matav TS Enthusiast Topic Starter Posts: 174

    oh... so the free space itself may be fragmented...
    hmm... if i do backup, then defrag, then move files back, some files still remain fragmented. any way around this?
    .
    nywy do u kno how to manually prevent MFT fragmentation... this is done thru one of the updates in the automatic updates, but just out of curiousity, does anyone kno the manual procedure?
     
  6. gbhall

    gbhall TechSpot Chancellor Posts: 2,361   +52

    as far as I know, NTFS cannot be prevented from defragmenting. The built-in defrag (diskeeper lite) still LOOKS fragmented after working, but it isn't as a rule. For a defragmenter that actually closes up gaps in the file structure you need something a bit more advanced. Norton utilities 2003 does it for me, and doubtless other do too.
     
  7. ravisunny2

    ravisunny2 TS Ambassador Posts: 2,062   +8

    Can I assume that by 'simple(stupid) defragmenters ', you are refering to those provided by MS in their OS?

    Are defrag programs designed to keep the data in a consistent state, in the event of an unexpected power failure ? Is there roll back possible, or are we left with mashed potatoes.
     
  8. gbhall

    gbhall TechSpot Chancellor Posts: 2,361   +52

    First question, yes. In XP it is an even simpler implementation of Diskeeper lite (which you can download for free).

    Again yes, any defragmenter is designed to survive a write failure. This could be a simple bad spot on the disk as well as a power-out. As to roll-back, as I understand it NTFS has as part of it's design a journalling feature which is roughly the same thing. You do not need to worry about defragmenting leaving you in trouble, and although I HAVE heard of people having a lock-up after a defrag process I am unclear if this was the result of a defrag problem or something entirely unrelated. I would think the worst a power-out could do would be resolved by a simple chkdsk run.
     
  9. jobeard

    jobeard TS Ambassador Posts: 13,469   +327

    First, run Disk Cleanup, followed by CHKDSK /F to make sure you mung the hd.
    This will give you more freespace to help defrag.
     
  10. ravisunny2

    ravisunny2 TS Ambassador Posts: 2,062   +8

    Thanks gbhall & jobeard.

    In general the power situation in Calcutta is better than in most parts of India. But now and then we do have power cuts/failures.

    BTW, I have win 98SE. I hope the same is applicable in this case.
     
  11. gbhall

    gbhall TechSpot Chancellor Posts: 2,361   +52

    In the case of Win98 the file structure is less advanced than NTFS and the possibility of corrupted data during a defrag is a little higher. You can end up with cross-linked files, which is where two files actually share a link to the same disc location. Recovering these results in one of the two files being left 'dangling' without an end. The OS leaves these files available at the drive root, under the name FILE00001.chk etc, in case you can recover something important.

    The built-in defrag of Win98 is a very simple creature indeed, but amusing to watch at work. It moves down from the top of the disc, sending a fragmented file to the top of the disk and then moving unfragmented files down to fill the gap left behind.

    I would say on the whole in your situation, you might very occasionally meet with a disc problem, which I would expect to be almost certainly resolved with chkdsk /f as Jobeard says.

    Much depends on the importance/replaceability of the data on your drive.

    Your main approach must be a regular backup schedule, and for peace of mind, depending on the value of your data, you might consider investing in an Uninteruptible Power Supply (UPS). A 400wa model is adequate for most PC's, will last approximately 15-20 minutes after a power failure, and will last you for perhaps 5 years. The limited running time does mean you cannot just leave a job running for hours and go out - you have to be there to power down safely within the 15-20 minute interval. I know most UPS provide monitoring software which is supposed to close down gracefully by itself, but my experience is too much software just ignores such messages from the OS and carries on regardless.
     
     
  12. ravisunny2

    ravisunny2 TS Ambassador Posts: 2,062   +8

    Thanks, gbhall.

    Actually I have a decent UPS (APC) with 20 min b/b, and even an option for self shutdown.

    But I am unable to use the shut down feature because I have only 2 usb ports, one is for my adsl modem and the other is for my new printer.

    Tried to use a hub (unpowered), but my os failed to pick up the UPS.

    Also, I do my defrag in the night hours when I sleep.
     
  13. gbhall

    gbhall TechSpot Chancellor Posts: 2,361   +52

    True, Win98 is a bit weak at supporting USB ports. XP is much better. One possibility is to download and install the latest unofficial service pack 2.1a for Win98 http://www.softpedia.com/get/System/OS-Enhancements/Unofficial-Windows-SE-Service-Pack.shtml

    this contains USB enhancements that might help. It will certainly do no harm - I have used these SPs for years.

    By the way, doing an unattended procedure is what I was warning about ! Also my experience is you are not gaining anything by defragging more than once per month.
     
  14. ravisunny2

    ravisunny2 TS Ambassador Posts: 2,062   +8

    Thanks, ghball.

    I'll give it a shot.
     
  15. matav

    matav TS Enthusiast Topic Starter Posts: 174

    the "chkdsk /f" works only in win 2000 and above.
    for win98 u need to do a scandisk for similar advantage.
    .
    it's better to check the disk before a defrag.
    .
    besides win98 doesnt support NTFS (hd's are normally in FAT32)
    n i have noticed that defrag on NTFS is alot quicker than on FAT32
     
  16. matav

    matav TS Enthusiast Topic Starter Posts: 174

    nywy... is there a p/g that doesnt allow the file to get fragmented while it's being copied onto the hd?
    .
    this way i can pack up my hd without fragments... peace of mind for me then.;)
     
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.