Made a mistake, no longer see Mac HD in Startup Disk in Mavericks

ATC

macrumors 65816
Original poster
Apr 25, 2008
1,076
278
Canada
While installing windows 8.1 through Boot Camp recently I made a silly mistake where I inadvertently formatted disk1 partition (it was ~40mb in size) - you can say I was having finger trouble. However I was able to recover and proceed with the install fine.

Everything works, booting into OSX 10.9 or Win 8.1, no issues at all. I even tested the Recovery HD partition and all is well there too.

I'm not sure if it's a coincidence or not but I have since noticed that while in Mavericks when I got into System Pref > Startup Disk, I no longer see Macintosh HD there, just the Boot Camp disk. (see 1st pic)

However, in Windows 8.1 when I launch Boot Camp control panel, there are 4 items listed under Startup Disk (see 2nd pic) - Mac HD, Recovery HD, Boot Camp and Mac OS X (I have no idea what this last one is).

Is there anything I can do to fix this? Since everything is working fine I'm leery about re-installing everything. But ideally I would like to be able to set my Startup disk from within OSX. Right now I can only set it through Boot Camp within Windows 8.1.
 

Attachments


Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Can you please post the output of the following terminal command from inside OSX?
diskutil list

Also if you don't have gdisk installed already please go to the site below and download and install the .pkg file.

http://sourceforge.net/projects/gptfdisk/

Once installed please open a terminal and (assuming you have only one hard drive in your Mac) please run

sudo gdisk /dev/disk0

and when it shows an output type in a "p" (no quotes) and press enter. Please quote the output in your next post.
 
Last edited:

ATC

macrumors 65816
Original poster
Apr 25, 2008
1,076
278
Canada
I first ran the 1st command you requested (see 1st pic). I then installed gdisk and ran the second command but see 2nd picture, which option to choose?

Note: I have two external HDs attached, 1st is a 320GB (photo drive) and the second is a 1TB called "my drive". I'm guessing they're disks 2 and 3 respectively in 1st pic.
 

Attachments

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Sorry, I am in UK so was sleeping :)
For the moment (until we decide what's best) do a ctrl + c to abort.

Presumably the first disk is the one with the problem and that's your Mac's internal drive?
 
Last edited:

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
We need to be sure about which disk we are talking about. Is this regarding the 640GB drive?

If so you are getting this message in gdisk because there is both MBR and GPT data on your first disk (disk0).
This has happened because the first partition on your first drive should be an EFI partition. However yours is gone due to your earlier mistake. An EFI partition is mandatory for a GPT structure. This is causing a conflict even though both your installations still boot.
The EFI partition on a Mac is only used (as far as I'm aware) for processing firmware updates for your Mac. This is not insignificant.
Sadly, though the EFI partition can be re-created in terms of its boundaries, its contents can not easily be replaced. I suspect that an identical Mac would be needed to copy the files from.
The only way I know of to replace that partition and its contents is to reformat the drive using internet recovery or an OSX installation disc/usb.

Maybe others who know more about this than me could comment.

The decision is obviously yours to make.
In the meantime I would backup everything on that first disk, maybe as partition images with something like Clonezilla Live.
That way the disk could be reformatted, replacing the EFI partition, then the current partitions restored later.

It may be an idea to wait for others to comment, maybe with other ideas.
Good luck :)
 
Last edited:

ATC

macrumors 65816
Original poster
Apr 25, 2008
1,076
278
Canada
Hey no worries, and thanks for the help. :)

Yes the 640GB is the internal iMac HD. I had a suspicion I'll need a reformat and reinstall. I have my OSX side fully backed up and I now have the windows 8 side backed up too so a reinstall isn't going to be a huge deal.

I've just never used the recovery partition to reinstall OSX before. I presume the steps should be as follows: (?)

1. Back everything up - Done!
2. Reboot into Recovery partition
3. Launch Disk Utility and erase and format the 640 GB internal HD as a single partition as Mac OS Extended (Journaled)
4. Then launch OSX installer from within Recovery - which would then download and install the latest installer (10.9.1)?
5. Re-install windows 8 via Bootcamp later

Does that sound right?
 

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Yes I would say that sounds about right, if your iMac came with Mavericks. If not I believe it will install the version of OSX it came with.

It could still be worth waiting for other people's views on it first.

Out of interest could you post the output of this terminal command please?
sudo gpt -r -vv show disk0
 

ATC

macrumors 65816
Original poster
Apr 25, 2008
1,076
278
Canada
Sure, I'm at work but I can post that later tonight.

My iMac came with 10.5 (Leopard) I think. But I have 10.9 under store purchase history. Hope it installs 10.9 and not 10.5 lol.
 

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Thanks.
If you still have the Mavericks installer in the Applications folder there is a way to make a USB installer of Mavericks which you can use to boot from, run disk utility to format the drive (be careful which drive!!!) and install a fresh Mavericks.

If you don't have that you could download it again.

I suspect that internet recovery (if available on your machine) will install 10.5 again, though maybe somebody else could confirm that?
 

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Thanks that's interesting. The GPT seems to still have your EFI partition boundaries intact. I hate to get your hopes up but it might (just about) be repairable - possibly. It depends on whether your Apple folder still exists in that EFI partition.

For comparison if you could also post the output of
sudo fdisk /dev/disk0
so I can see what's what.

What exactly did you format (or try to) when you made the mistake?
 
Last edited:

ATC

macrumors 65816
Original poster
Apr 25, 2008
1,076
278
Canada
Thanks that's interesting. The GPT seems to still have your EFI partition boundaries intact. I hate to get your hopes up but it might (just about) be repairable - possibly. It depends on whether your Apple folder still exists in that EFI partition.

For comparison if you could also post the output of
sudo fdisk /dev/disk0
so I can see what's what.

What exactly did you format (or try to) when you made the mistake?
Ok, you're getting my hopes up. :)
In all seriousness whatever you think I can try is probably worth trying as I have nothing to lose at this stage but time.

On a side note, I'm actually thinking of waiting till Apple releases 10.9.2 and then download that installer and do a fresh install from there, if I don't sort this out in an easier way that is.
 

Attachments


Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
As you say it's worth a try, I think.

There are a few steps to go through but it shouldn't take more than a half hour or so using gdisk.

Run gdisk again
sudo gdisk /dev/disk0
and when it opens type "x" without quotes and press enter. This puts you in expert mode.

Then type "n" (no quotes) and press enter. When asked answer Y to continue.
When it's run type "w" and press enter, to write the changes to disk.

This will create a new protective MBR, making your disk pure GPT again.
This is the first dangerous bit. If it still goes well you might be ok.

Once that's done type in "q" and press enter to quit gdisk.

Reboot and hold the Alt key. Make a note of what choices are available in the boot menu then boot into OSX.

Let me know when you're there.
 
Last edited:

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Right, sorry that's my fault. This bit is new to me too.

Do another ctrl + c to quit.
Start up gdisk again and again answer 2 to the GPT question and hit enter.

It seems that it's going to automatically create a new protective MBR, which is good.
type "w" and enter
If asked to continue answer Y and press enter.

Once finished if you're still in gdisk type "q" to quit and reboot.

When rebooted in to OSX see if OSX is now listed in Startup Disk
 

ATC

macrumors 65816
Original poster
Apr 25, 2008
1,076
278
Canada
Ok, I think we're getting somewhere.

So the process completed and I then rebooted. On reboot I held down the option key and interestingly I did not see the Windows partition on startup, it was gone.

Booted into OSX fine and I can now see both Windows and Macintosh HD in Startup Disk in System Pref, so that's good.

In Finder I also still see the bootcamp disk but I rebooted again and I again the windows partition was gone.

Any ideas?
 

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Yes that's fine and a good start!
We'll hopefully get Windows back shortly.

But first can you open a terminal again and run these 2 commands

mkdir /Volumes/efi

sudo mount -t msdos /dev/disk0s1 /Volumes/efi

Once that's done open a Finder window and in the left pane there will be a EFI option (probably at the bottom).
Click on that and in the right pane you should see a folder labelled EFI.
Inside that should be a folder named Apple
Inside that should be a folder named EXTENSIONS
and inside that should be a file called Firmware.scap

If they're all there you're good and we can get Windows back.
Let me know please.
 

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Excellent! :D
Ok, please reboot now normally. This will fully unmount the EFI partition.

On rebooting fire up gdisk again
sudo gdisk /dev/disk0

You won't get the MBR or GPT question this time.

Type "r" and enter - to get to the recovery menu

Type "h" and enter - to create a new hybrid MBR

You will be asked if you want to include the EFI partition first in the new MBR
answer Y and enter

You will then be asked to enter 1 - 3 partition numbers

type 2 3 4 - that's 2 space 3 space 4 - and press enter

each of those partition numbers will appear in turn.
Accept default settings (press enter) for partition 2 and when asked if you want to make it bootable answer N

Do the same for partition 3.

For partition 4 accept defaults again but answer Y to making it bootable.

when finished type "w" and press enter

Answer Y to continue

Type "q' to quit then close the terminal and reboot holding the Alt key.

Windows should now be an option again in the boot menu. Select it and make sure it boots.

If all is ok, you're done! :eek:
 

Quackers

macrumors 6502a
Sep 18, 2013
645
1
Manchester, UK
Yes, carry on with the sequence.
I would have expected it to ask about the EFI partition though :confused:

Hmm, maybe the MBR can't see the EFI partition.
 

ATC

macrumors 65816
Original poster
Apr 25, 2008
1,076
278
Canada
And there's nothing I should worry about as far as that warning about Hybrid MBRs being flaky and dangerous?