What should I do with a badly fragmented disk? Defrag or copy to another drive?

3

I've inherited a machine with a large, badly fragmented disk drive containing lots of files.

Defragging is very slow, and makes the drive seek a zillion times (you'd think enough to cause a meltdown).

Would it be faster (and less wear and tear) to

  • pop in another physical volume,
  • move as much as possible to that scratch volume,
  • defrag the now-nearly-empty original volume,
  • then move everything back?

If so, is there some rule of thumb by which to predict when it's faster to recopy instead of defragging?

Witness Protection ID 44583292

Posted 2011-09-09T15:10:06.890

Reputation: 339

1What filesystem is in play? What sort of drive? Having two independent spindles seems to always be faster than having one drive read and write to itself while the OS is running. If you have a spare drive (internal or external) it seems like folly to not just move the majority of the files off the fragged drive and wait for / create a maintenance window to copy them back. – bmike – 2011-09-09T15:33:19.693

Answers

2

I dont know the answer, but I would guess it would take approximately the same amount of time. You would be performing the same amount of seeking, reading, and writing. Its just the writing would be to a different disk on the first pass. The only thing I would think that might be an improvement is that is that if the original disk has almost no space left, a defrag wouldnt have the optimal space to run.

Keltari

Posted 2011-09-09T15:10:06.890

Reputation: 57 019

I'd guess it might be a little quicker since it would have enough space to write the files contiguously to the empty disk but I'm not sure it's worth the hassle. Would something like clonezilla restore the files in a fragmented state or is it aware enough of the filesystem to defragment as it copies? – Col – 2011-09-09T15:20:48.623

Thats an interesting question, which I dont know the answer to. My gut geeling is that it would keep the fragmentation. Clonezilla is able to clone a disk, regardless of whether it is capable of reading the filesystem or not. If it cant read the filesystem, it cant defragment it. However, I just dont know. – Keltari – 2011-09-09T15:40:20.820

I just wondered since it knows enough not to clone the empty space it isn't completely stupid, it doesn't work like dd which does a bitwise copy so maybe it would work. – Col – 2011-09-09T17:56:28.900