Sunday, July 29, 2007

Lossless same-drive Mac HD Repartition, part 2

A while ago I explained how I did repartition my iMac hard drive. Then came WWDC, and with it I got the Leopard beta. Being in SF, without access to my iMac, I decided that I had to repartition my MacBook hard disk, so I could install Leopard and follow the sessions correctly.

Using my own post, I followed the different instructions. At repartition time, everytime I executed "diskutil resizeVolume ..." I got an error message about not having enough space. My MacBook's HD had been almost full, but I had freed 26Gb in order to make a new 20Gb partition. Clearly, it was not the disk space. It was also clear that my disk was probably highly fragmented and that diskutil was unable to allocate 20 contiguous gigabytes for my new partition.

I found an app called iDefrag. After some tests, I told it to defrag my drive with the default options. I took like 45 minutes to complete the whole process. I then retried the "diskutil resizeVolume ...". This time it worked perfectly.