Jump to content

Defragging an Intel Mac


5 posts in this topic

Recommended Posts

Last week I registered for and downloaded the M$ Vista, beta 2! In order to install it on my Macbook Pro, I needed at least an 11GB partition (Preferably about 15-16GB). Since I had XP installed on a 10GB partition, I used Boot Camp Assistant to remove the old partition and proceeded to try and create a new 16GB partition. No go… My drive was too fragmented to allow that size partition. As a mater of fact, when I tried any size, I was informed that certain files couldn't be moved. I was screwed unless I defragmented.

 

Defragging isn't a big deal on a Mac, normally. Just back up the drive to an image on an external drive and reformat and restore the image, without erasing, to copy the files across rather than block by block. This can all be done within Disk Utility after booting the install disk. I've done it many times on PPC Macs and never ran into a problem.

 

Unfortunately, a problem does exist with the Intel Mac Install CD! It appears there's a bug in Disk Utility or the OS on the Install DVD that prevents dragging the drive's name into the Destination field of the restore dialog! Since I'd already created the disk image, verified it and erased the original drive, I was screwed unless I could find a fix! A call to Apple's Tech Support proved useless. They passed it up to the more technically skilled support guys, who, in turn told me they would send the problem to Apple Engineering for a solution. They'd call me back as soon as they figured out a fix. In the meantime, I guess I was supposed to wait. That was Saturday. I haven't got a call back yet…

 

Well, obviously, I solved the problem since I'm posting this with my MacBook completely restored! I've even got Vista installed (although, it could never replace OS X!). I'm sure many of you know that Apple includes a command-line utility called ASR (Apple Software Restore) that's accessible through the Terminal program. It worked like a charm! The problem with it was that following Apple's recommended command to restore, restores it back to the fragmented state:

> asr -source <compressed image> -target <targetvol> -erase

 

The solution to defrag is to modify that line after erasing the drive and mounting the image (both with Disk Utility). In my case the drive's name is "Macintosh HD" and it's important that the drive be erased with the same name. Now, go to the terminal and use ASR in the following form:

> asr restore -source "/Volumes/Macintosh HD 1" -target "/Volumes/Macintosh HD"

 

Note the restore verb and lack to the -erase condition. The numeral 1 after the name of the source volume is because this was the second drive mounted with the same name. It's how the Mac knows the difference between drives of the same name. The above resulted in a file copy restore, effectively defragging the drive.

 

BTW: My headache has started to subside... :)

 

LasVegas

Link to comment
Share on other sites

Even so, in order to reduce the size of a partition which Boot Camp does, the partitions files have to be prior to the point that the partition is going to be reduced to. The only way to do that is defragging.

Link to comment
Share on other sites

 Share

×
×
  • Create New...