Search This Blog

Thursday, April 21, 2011

Removing extra OS X partitions (and troubleshooting)

I recently ran into a problem regarding partitions on my MacBook Aluminum. Originally I dual-booted OS X and Linux (Ubuntu), which means that there were 4 partitions on the hard drive. I was using rEFIt as the initial boot manager, and then once the Linux option was selected, it would go into GRUB for me to select from the normal menu. I know what 2 of the partitions are (Linux filesystem and swap space), but I don't know what the 3rd partition is (FAT 511.7MB in size)... possibly a share that I set up between OS X and Ubuntu back in the day.

At any rate, I now have another laptop that I use solely for Linux, and then the Ubuntu media server... negating my need to dual boot the MacBook. Using the Disk Utility, I erased these 3 extra partitions successfully, but hit the problem while trying to remove them. Once I pressed the "-" to remove 1 partition (any of them), it would go into Verifying disk, get about 10% complete, hang for a while, then come back with the error "Could not modify partition map because filesystem verification failed". This seemed very cryptic, and provided no path forward, only "OK", and the partition remained. After a bit of Googling, I found an article regarding this exact issue that talked about booting from the OS X install DVD and run Disk Utility from there. Since I'm not working on my filesystem partition, but rather one that can be unmounted within OS X, I figured this wasn't required, but decided to give it a shot anyways.

After searching around for my DVD of Snow Leopard, I came up with nothing... probably lost in one of the moves since buying it 3 houses ago...

So I "obtained" a copy, only to find out that it's filesize was obviously for a dual-layer DVD, leading me down this path: tonymacx86 Blog: Fit Mac OS X Snow Leopard on a Single Layer DVD

Great tutorial, except I didn't want to download ShowAllFiles and run it because it is a binary program (ie I can't see the source code), so I don't know what it actually does to the computer other than just show hidden files. Therefore, in Step 2 .1-2, just do this:
1) Open Terminal
2) Type the following: defaults write AppleShowAllFiles TRUE
3) (enter)
4) And then: killall Finder
5) (enter)

This will show any file with a "." at the beginning of the name, which causes it to be hidden in OS X. At the end of deleting all the unnecessary files, simply repeat the above steps, changing TRUE to FALSE.


Back to the troubleshooting.

I have currently booted from the DVD and am in Disk Utility, only to find that the same problem arises. Except this time, it allows me to Repair the volume. Once the volume repaired successfully (with the only red errors showing on the OS X partition, it seems that I could move forward with removing the 3 extraneous partitions. I've attempted to remover "NO NAME" (the FAT partition), with the same error, "Could not modify partition map because filesystem verification failed". So I attempt to remove the aptly named after erasing "blank_01", again, with the same error message. On to "blank_02", same.

Now I go back and select my hard drive (top of the list), and Repair Disk again, with the following problems found and corrected:
Macintosh HD:
 Volume bitmap needs minor repair
 Volume header needs minor repair
 ...The volume Macintosh HD was repaired successfully (same thing I got the first time)

 Phase 1 - Preparing FAT
 Phase 2 - Checking Directories
 Phase 3 - Checking for Orphan Clusters
 57 files, ...
 Updating boot support partitions for the volume as required

 ...The volume blank_01 appears to be OK.

 ...The volume blank_02 appears to be OK.
 Volume repair complete.
 Updating boot support partitions for the volume as required.

Now, this seems odd, NO NAME produced no errors, but it still updated the boot support partitions. blank_01 didn't do anything, and blank_02 said it was OK, but then "Volume repair complete" and then updated the boot support partitions.  Not sure why this is.

I am back at the Partition tab, press the "-", it goes into Verifying disk, moves on to Shrinking disk, and then comes back with Partition failed with the error: The partition cannot be resized. Try reducing the amount of change in the size of the partition.

Now I am fed up with dealing with this.  Most Googling on this specific errors shows that the free space is probably fragmented, and requires the purchase of software to defrag it...  or you can just wipe the entire drive and restore from a backup.  I regularly make backups using SuperDuper, so it sounds like it's time to start erasing...