Sunday, October 24, 2010

Dual boot Mini 9 MBR failure...or the wife is pissed

So the wife brings her Mini9 running OSX to me telling me it just died. First it froze, she rebooted it and the black screen prompt showed a couple of errors and "Operating System Not Found"

Of course there are many ways to fix this, boot from your windows CD and say "repair", etc...but this is a dual boot OSX hackintosh setup...there are 3 partitions, two are HFS and one NTFS, and the OSX was hacked to run on a standard Master Boot Record partition system.

For the question marks appearing, a short explanation. Imagine your hard drive is a vinyl long play record with (in my case) three songs on the side, and the quiet part between songs defines the partitions. Now imagine the chaos if those quiet spots disappear, and you don't know where one song ends and the next begins...Now imagine one song is quiet violin music, the next Henry Rollins Band, and the last, explosion and gunfire sound effects...

The MBR tells the computer where the partitions (songs) and how long they are...and even what kind of partitions they are...if it get corrupted or disappears, the data is still where you left just don't know where it is. And like the album without breaks, you can make a duplicate of the data, but you still can't use it.

Well any time you can see a drive, but it won't boot, assume MBR is the only thing you can fix that won't make things worse (for the most part).

So my big problem is HOW to fix these oddball partitions.

I knew that somehow I had booted the Mini9 before it had an operating system, and then partitioned the drive, installed the OS etc. So for roughly an hour I went about trying to retrace my steps to boot it of a USB thumb drive...then I remembered that I actually booted it off a linux boot I dug around and found the USB DVD drive...and the linux CD.

The one I had was actually a Gparted live CD (GNU Partition Editor). I booted it and ran sees a blank drive...or more accurately, it does not see any partitions. Now a mistake would be to create partitions at this point...'cuz now you HAVE made things worse, you will overwrite data, and it will be gone.

So drive is there (correct size) how to get the partition data back. I can't run a windows boot disk, it would puke over non windows partitions and probably trash the disk.

So I looked at the places I used to create the hackintosh that really helped...but someone did mention a program called Testdisk.

That program was on this Gparted live with much fear, I ran the program. The first time I told it to look for Intel/PC partitions...after a couple of error messages, it showed the three partitions, and their correct sizes, so I knew then that I has simply lost the MBR partition table.

However in front of each partition was the letter D that according to the text on the bottom means Delete (or perhaps deleted). So I went and changed the "D"s to anything else, P for Primary, L for Logical, E for Extended, or * for boot. When I did that, the first partition (used to fool OSX into booting) and the NTFS windows partition showed green...but the OSX partition had to remain D or the text on the bottom said something like "invalid disk" or something equally useful.

So I backed out of those menus to the top of Testdisk. This time I chose the Mac OS partition style...I didn't think it would work, but what the heck. It did its full scan and showed 2 partitions both in Green with P in front.

But the numbers didn't look quite right (locations on the disk) I backed out again and did the Intel/PC choice again. This time it showed all three partitions again, however this time all three were in Green, and the first one was a * (boot) with the other two showing P.

I hit apply, it did its thing and I rebooted. Of course it didn't boot. I actually didn't expect it two, because as I remembered, the actual boot was on the OSX partition, which also had the boot menu that allowed me to dual boot the computer to windows.

So I re-booted the Gparted Live CD, and this time when Gparted ran, it correctly showed the partitions...I simply set the OSX partition to boot, and rebooted...ta daa.

You may wonder how I knew which partition was which...the first partition is only about 100megs. The windows one was NTFS...that left the 19 gig HFS partition that was obviously the OSX one.

SO if you see 'No operating system found', try to repair the MBR first.

There is a down side to this...usually when the MBR fails, and you see slow downs in disk access, those are signs the drive is probably time to make a backup.

No comments: