Ubuntu wrecked partition table. Help to fix?
(Macbook Pro 2013 15" Crystalwell 4 Core, 500GB SSD 16GB RAM)
I should have known that installing Ubuntu next to Bootcamp was a bad idea. 😐
So here's what's up... Before this whole debacle began I had two separate partitions on my SSD. The primary partition was for Mavericks with 300GB. The second partition was to a Bootcamped Windows 7 with 150 GB of space. I left 50GB free between the two, which still left me at
- disk0s1 for EFI, ~200 MB
- disk0s2 for Macintosh HD, 300 GB
- disk0s3 for Recovery HD 650 MB
- disk0s4 for Bootcamp 148 GB
Here's where my problem began. Genius me decided to attempt to install Ubuntu via live USB onto the 50GB space in between. I have reFIT installed so this wasn't a problem. After loading into Ubuntu and realizing that it wouldn't load into the 50GB space, I rebooted and installed alongside Windows (through the Ubuntu live usb) following the install GUI Prompt.
The installation failed after it got hung on a CRON command and drained the battery from my unplugged computer sitting next to me in my bed (I fell asleep waiting for it to finish, even though it was at 100% battery when it started the installation). When I woke up my computer was dead, so I plugged it in. I started reFIT and booted into Windows after seeing that Ubuntu wasn't there. I was given the "Choose OS" prompt from Windows and Ubuntu wouldn't load, so I said screw it and went back to Mavericks. When I opened my Disk utility partitions table to see where it might have gone wrong....
Great Odin's Raven.
I now had ext4 partitions sitting above my bootcamp partition and linux-swap partitions below it. Absolutely no free space. I switched back to Windows, avoiding the failed Ubuntu OS, and uninstalled wubi from Windows (the universal uninstall for ubuntu, I used the Windows "uninstall application" application from Control Center), hopefully deleting the mess it had made of my drive table.
It didn't.
Since I couldn't delete the partitions back to free space around my bootcamp volume using Disk utility (insufficient hfs+ permissions or something like that), I decided to take a more agressive option. I installed partedMagic onto a live USB and once again rebooted my computer into the live USB. I went in and using gParted removed the partitions in front of the bootcamp volume and behind it reducing them to empty space. Good! Hoping for the best I went back to reFIT and booted into Windows...
"No bootable device -- insert boot disk and press any key"
Well crap.
After some more research into why this wasn't working, I was sure that somehow my EFI wasn't loading the right area of my hard drive. Then I think I found out what happened. I ran diskutil list from terminal and saw this..
IceMan-HomeBase:~ Tim$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 300.2 GB disk0s2
3: Apple_HFS Recovery HD 650.0 MB disk0s3
4: Microsoft Basic Data BOOTCAMP 148.0 GB disk0s6
disk0s6. There's the problem. Mac doesn't like anything beyond disk0s4, which is where Bootcamp was originally and where it should be now, at disk0s4.
If it were merely an issue of copying the bootcamp volume and repartitioning the hard drive, that wouldn't be a problem, but even WinClone doesn't like this volume. When I tried to do a copy, it threw an error saying "Invalid partition ID of 6"
Here is my question.
Is there a way to change the IDENTIFIER back to disk0s4 from disk0s6 and save my Windows 7 partition, is there some other way to save my files to a backup and clean install, or is he dead, Jim?
Sorry if this was a little long-winded, but I figured too much information would be better than not enough.
Thank you in advance for anyone brave enough to read this.
TL;DR
Partition table went bogus because of a bad Ubuntu OS install. Windows can't find a bootable device. Disk0s4 is now disk0s6. Possible way to change this?
MacBook Pro with Retina display, OS X Mavericks (10.9.2)