Defragmenting

So why was I feeling inspired to even write about defrag?

My linux virtual machine (VM) at work has been getting really slow lately. Noticeably really slow. So it occurred to Mike yesterday that one reason it might be slow is the fake partition files are “variable” size, that the VM doesn’t allocate the full 40 gigs of the partition size unless it actually needs all 40 gigs…this is obviously a lot more efficient use of hard disk space than allocating a bunch of empty space to Linux it doesn’t need…but the result is…the VM partition file(s) get fragmented and split all over the hard disk and it just churns and churns without using a lot of CPU. So I’ve been trying to run defrag today (well, I tried to run it overnight but when I came in in the morning the computer had gone into powersave/hibernate and it’d only defragged like 3% of the hard disk. Real helpful…

So I’ve been running it in the background while I work when I’m not doing hard disk intensive parts (like while I’m trying to figure out code rather than build). Which means I’ve been having to deal with windows defragmenter.

Whatever happened to the days when defrag used to ask you if you wanted to do a full defragment or just do a quicker consolidation of free space or only defragementing files without consolidating the free space? And really since the whole point of defragging was to get all the VM files together and with room to grow without interruption, I wish I could make defrag a little smarter and tell it the VM files are kind of like yo-yo dieters and need lots of extra space to grow and shrink at will…just consolidate all the other stuff. I suppose that would be the advantage of fixed partitions though rather than variable sized VM partitions…

And let me not get started about the changes in how the defrag displays the hard disk blocks in light of really big hard disks and displays “estimated use after defrag” as a title for “progress so far” as opposed to “estimation of what this will look like if you don’t interrupt it before its done”…it has some good sides, but you can’t understand what its doing under the hood nearly as clearly as the old dos defrag screens…and then there’s always the tradeoffs of doing defrag as a non-exclusive process so I can run it in the background while I work versus running it from a boot disk so that there aren’t any fragmented “non-movable files”