Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PNayo92

macrumors member
Original poster
Jan 1, 2011
59
0
Before I updated to mountain lion, I had 3 partitions on the boot-up menu - Mac OSX, Bootcamp, and Recovery HD.

After the update, I still have 3, but they are different: Mac OSX, Recovery HD, and Recovery-10.8

My bootcamp partition still exists (I see it in Disk Utility), but its partition is no longer accessible when I boot up my computer. In its place is "Recovery- 10.8"

Please tell me there's a way to fix this without wiping the partition and re-installing it
 
Please tell me there's a way to fix this without wiping the partition and re-installing it

There is. It requires patience and a steady hand. Please post the results from the following (ready-only) commands. In the forum message window, highlight the pasted text, click on the # button in the toolbar to add code tags so the results format correctly.

Code:
sudo gpt -r -vv show disk0
sudo fdisk /dev/disk0
 
Is it available in system preferences / startup disk ?

Yeah, it is available. The bootcamp icon shows up as a folder (instead of a startup disk). I haven't tried restarting with bootcamp as the default, though. I'm not sure what would happen?


There is. It requires patience and a steady hand. Please post the results from the following (ready-only) commands. In the forum message window, highlight the pasted text, click on the # button in the toolbar to add code tags so the results format correctly.

Code:
sudo gpt -r -vv show disk0
sudo fdisk /dev/disk0


Here are the results to the commands:

Code:
sudo gpt -r -vv show disk0
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
gpt show: disk0: mediasize=750156374016; sectorsize=512; blocks=1465149168
gpt show: disk0: PMBR at sector 0
gpt show: disk0: Pri GPT at sector 1
gpt show: disk0: Sec GPT at sector 1465149167
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34   419543865      1  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
   419543899     1269536      2  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
   420813435  1042656544      3  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  1463469979           5         
  1463469984     1269536      4  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  1464739520           3         
  1464739523      409600      5  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
  1465149123          12         
  1465149135          32         Sec GPT table
  1465149167           1         Sec GPT header
(Myname)s-MacBook-Pro:~ (Myname)$ sudo fdisk /dev/disk0
Disk: /dev/disk0	geometry: 91201/255/63 [1465149168 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 - 1465149167] <Unknown ID>
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 (Myname)s-MacBook-Pro:~ (Myname)$

I hope that provides helpful info...thank you
 
I have no idea how you arrived at such a partition scheme. It's non-standard.

Code:
Partition     Yours             Normal
    1         Windows           EFI System
    2         RecoveryHD        Macintosh HD
    3         MacintoshHD       RecoveryHD
    4         RecoveryHD        Windows
    5         EFI System        none

The easiest way for you to fix this, seriously, is to backup and restore Mac OS and Windows (noting that it's usually separate backup and restores for Windows as Time Machine will not back it up). It's so completely backwards.

The instructions for moving all of these partitions around would be complicated to write out, and as complicated to follow. Plus, there is no good way to protect the GPT itself since EFI System partition isn't first.

It is possible to make Windows bootable again in the meantime. Just be warned that this could make the computer unbootable so if you have other ways to make backups first, now is the time, before you do this...

Follow each line with a return:

Code:
sudo fdisk -e /dev/disk0
edit 1
07
n
34
419543865
edit 2
EE
n
419543899
<return/enter>         [return or enter button to accept default]
flag 1
quit
y

If you don't understand something or get stuck or make a mistake, either use control-c or use the exit command instead of quit. The command quite writes changes to disk.

Once you're done:
Code:
sudo fdisk /dev/disk0
Post the results so I can confirm it's correct.
 
It is possible to make Windows bootable again in the meantime. Just be warned that this could make the computer unbootable so if you have other ways to make backups first, now is the time, before you do this...


Wow murphychris thank you for all the help. Before I start this, though, you said that it may make the computer unbootable. How would I go about fixing that problem should it come up?

Also, I have no idea how I could back-up windows if I can't boot into it. Last time I backed it up, I used a free trial of MacDrive (so that I could back up windows from the partition itself onto a mac-only external hard drive). I had downloaded macdrive on the windows partition. If you don't know, I can just continue looking around to see if I can find a solution.

Those are my only 2 questions right now (how to fix an unbootable computer and how to backup windows). I regularly backup MacOSX with time machine anyhow. Thanks for all your help murphychris
 
How would I go about fixing that problem should it come up?

No because I have no idea if you'll screw up, let alone how. If you mess up the MBR, fortunately Mac OS X ignores it in favor of the GPT and at least it should still boot even if Windows won't. But you already have that problem so it's kindof low risk at this point. And even if you totally mess up the MBR, you in effect have backed up partition maps by virtue of posting them to the forum.

Also, I have no idea how I could back-up windows if I can't boot into it.
Your Windows partition is 200GB. If you have a spare 200GB somewhere, it's possible to sector copy that entire Windows partition without any additional software into a mountable disk image file, mountable within Mac OS X so you can extract whatever data you want, if it comes to it.

My suggestion is that you proceed with the instructions I wrote out, and then also post the results of the last fdisk command so I can confirm the MBR is correct before you attempt a reboot.
 
Here is the output from the last line of code:

Code:
(myname)s-MacBook-Pro:~ (myname)$ sudo fdisk /dev/disk0
Disk: /dev/disk0	geometry: 91201/255/63 [1465149168 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
*1: 07    0   0  35 - 1023 254  63 [        34 -  419543865] HPFS/QNX/AUX
 2: EE 1023 254  63 - 1023 254  63 [ 419543899 - 1045605269] <Unknown ID>
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
(myname)s-MacBook-Pro:~ (myname)$
 
@PNayo92

Yeah that looks good. So now let's hope that Apple's EFI and CSM aren't fussy about the 0xEE partition not being first in the MBR. Go ahead and reboot, holding down the option key, see if you get a Mac icon, and a Windows icon, and see if both of them work.
 
I rebooted my computer. Windows is the only partition option. When it's selected, the windows icon shows up but will not fully load into the operating system.

oh no...

then windows goes on to say that "Windows failed to start. A recent hardware or software change might be the cause. To fix...insert install Disc...and repair computer.

The boot selection failed because a required device is inaccessible"

windows said that because I rebooted while it was at the logo. it was taking over 5 minutes to boot
 
Last edited:
I rebooted my computer. Windows is the only partition option.

If you reboot and do nothing (do not hold the option key), what happens? Mac OS? Or the failed Windows boot?

To fix...insert install Disc...and repair computer.

The article on how to do that is here. What you have is a Windows volume that has been moved around for some reason, and so the bootloaders and/or BCD are broken. But before repairing Windows I want to know if you can even boot Mac OS X, because if you can't that should be fixed first.
 
But before repairing Windows I want to know if you can even boot Mac OS X, because if you can't that should be fixed first.

Booting normally goes straight to the screen "Windows failed to start"
(because I did a hard shut down while windows loaded)
 
Booting normally goes straight to the screen "Windows failed to start"
(because I did a hard shut down while windows loaded)

OK so it appears that Apple's EFI or CSM will choose to ignore the GPT entirely if the 1st entry of the MBR is not 0xEE. Irritating.

So you either need to boot this computer with a DVD, any version of Mac OS will do, and get to Terminal. Or you need to attach this computer booted in Firewire target disk mode, to another Mac. I'll write up new fdisk instructions and we'll see if that makes both OS's work...
 
It's possible the disk will not be /dev/disk0, it might be /dev/disk1 or /dev/disk2, depending on how you've had to boot. Use this command:
Code:
diskutil list
and should be able to find your disk based on the partitions/names. I'm going to assume disk0 but you'll need to use the correct designation for this first command:

Code:
fdisk -e /dev/disk0
edit 1
EE
n
1
33
edit 2
07
n
<return/enter>          [accept default of 34]
419543865
edit 3
AB
n
<return/enter>          [accept default of 419543899]
1269536
edit 4
AF
n
<return/enter>          [accept default of 420813435]
1042656544
flag 2
quit
y

Go ahead and reboot and see if you get both Windows and Mac OS options. I'm hoping for three, actually, including one of the Recovery HDs.

Thing is, MBR only has four entries and you have five (plus GPT equals six) that are needed. So I can't fully protect the disk. Hopefully you can boot Windows and Mac OS, get backups, and blow away this whole disk and restore it correctly with all of the partitions in the proper order.

If you get stuck, write back, but I'm unlikely to respond until much later night or tomorrow.
 
It's possible the disk will not be /dev/disk0, it might be /dev/disk1 or /dev/disk2, depending on how you've had to boot.

How do I know to use /dev/disk1 or /dev/disk0 ?? I'm not sure what name I'll be looking for.
Under /dev/disk0, it lists 6 different types of disks with their sizes:

0: GUID_partition_scheme
1: Microsoft Basic Data BOOTCAMP
2: Apple_Boot Recovery HD
3: Apple_HFS Mac OSX
4: Apple_Boot Recovery HD
5: EFI

Under /dev/disk1
0: Apple_partition_scheme
1: Apple_partition_map
2: Apple_HFS Mac OS X Install ESD

Under /dev/disk2
0: Apple_partition_scheme
1: Apple_partition_map
2: APple_HFS Mac OS X Base System

then it lists disks 3 through 13 with one small "untitled" disk under each of them.

I'm guessing the correct one is /dev/disk0, but I really don't want to mess anything up
 
Last edited:
How do I know to use /dev/disk1 or /dev/disk0 ?? I'm not sure what name I'll be looking for

Code:
diskutil list

That will list all devices, and their partitions, the very first line will be /dev/diskX where X is either 0, 1, 2, etc.
 
Code:
diskutil list

That will list all devices, and their partitions, the very first line will be /dev/diskX where X is either 0, 1, 2, etc.

Right, I guess I'm just not sure what device name I'm looking for. I edited my previous post with what the "diskutil list" command lists for me.

EDIT:

I went with /dev/disk0, since that seemed to be common sense. I restarted and ended up getting

"Mac OSX, Windows, Recovery HD, Recovery-10.8"

and the install disc that I still had in the computer from when I used terminal.
I'm going to see if each partition works now. Thank you for all your help. I'll update this post soon

UPDATE:

The Mac OSX partition works. It took noticeably longer to shut off the computer though.
The Windows partition still doesn't work. I tried doing the system recovery from the install disc, and that didn't solve anything. The next step was to look at the Bootrec.exe tool from the link that you sent me. I wasn't able to do any commands, because I wasn't sure what my "situation" was in terms of the cause of system failure on Windows OS.

At least now my Windows partition is accessible and available, although not functional, along with the Mac partition.

Also, one more thing I thought was interesting. When the Windows 7 Install Disc was loading on the boot-page, two icons appeared alongside the other 4 partitions: Windows (install disc) and "EFI". Just thought it was worth noting.

Thanks murphychris for all the assistance and help that you've taken the time to provide
 
Last edited:
The next step was to look at the Bootrec.exe tool from the link that you sent me. I wasn't able to do any commands, because I wasn't sure what my "situation" was in terms of the cause of system failure on Windows OS.

Doesn't matter what the cause is. You just need to go through the steps to restore the bootloaders, and possibly reconstruct the BCD as well. To me, this looks like these were transferred from another disk. It's exceptionally difficult to use one disk and rearrange the partitions.

Also, one more thing I thought was interesting. When the Windows 7 Install Disc was loading on the boot-page, two icons appeared alongside the other 4 partitions: Windows (install disc) and "EFI". Just thought it was worth noting.

I'd get the data off Windows and Mac OS partitions as soon as practical, and start from scratch with this disk (definitely it needs to be repartitioned so that the MBR and GPT are created from scratch, as well as a new EFI System partition which will be created first, automatically and will be invisible in Disk Utility). How you restore your data depends on how you back up...obviously. Just make sure Mac OS is first and Windows is the last partition.
 
Going off of this link: http://support.microsoft.com/kb/927392

So to fix the windows partition, I just type in:
Code:
bcdedit /export C:\BCD_Backup
c:
cd boot
attrib bcd -s -h -r
ren c:\boot\bcd bcd.old
bootrec /RebuildBcd

into the bootrex.exe command window?

I'm sorry, I've never had experience dealing with this type of problem through command windows. I'm not sure if I type in the above code, or type the whole thing multiple times while replacing the "/RebuildBcd" at the end with "/ScanOS", "/FixBoot", or "/FixMbr".

And as far as starting from scratch, that's fine with me. I'm not sure how to wipe my entire disk and all the partitions to a factory state, though. And I'm still looking into different ways to backing-up and restoring my Windows from a Mac partition on a mac-specific external hard drive. Do you think it's possible to correctly back-up the Windows partition even if I can't boot it?
 
I'm not sure if I type in the above code, or type the whole thing multiple times while replacing the "/RebuildBcd" at the end with "/ScanOS", "/FixBoot", or "/FixMbr".

No idea. I'm not much of a Windows expert. Partitions, bootloaders, linux...not Windows.

I'm not sure how to wipe my entire disk and all the partitions to a factory state, though.

When you boot from the Mountain Lion installation image, you get a menu, one of which is Disk Utility. You choose the drive, choose the Partition tab, and change the scheme from Current to 1 Partition. Poof.


And I'm still looking into different ways to backing-up and restoring my Windows from a Mac partition on a mac-specific external hard drive. Do you think it's possible to correctly back-up the Windows partition even if I can't boot it?

Yes. Winclone can do it. Or even through the Finder in Mac OS you can read-only the Windows volume and get your data (only) out. Or you can make a disk image out of the Windows partition if you have space for that big of a file somewhere...

Quite honestly, all of your problems, and the challenge with backup and restore, etc. it's so complicated that it's why I don't use Boot Camp. I use Virtual Box and run these OS's in VM. Unless you're playing games, the performance is very close to running natively. And it's nowhere near this hard. The one gotcha with VM is that the VM's virtual disk, if one file changes, the whole virtual disk image appears to be a changed file from Time Machine's perspective - and that virtual disk image is ~20-50GB, so it's big. That's a lot to back up everytime. So a way around this is to get everything in Windows configured/installed the way you want, then make a snapshot. That freezes the original virtual disk image, and uses a 2nd one for additional changes and that's a VASTLY smaller file.

Or you can exclude the virtual disk from Time Machine backup, and just copy the virtual disk image manually to your Time Machine drive every now and then.
 
While trying to use Winclone, Mac OSX turned all white and essentially restarted (without turning the whole computer off).

Winclone was interrupted in the middle due to some problem, and now bootcamp is unmounted. At this point I don't even care if I can back up my partition. I just want to re-mount it and re-format my entire disk. I just need to figure out how to remount it now

basically all of the options for the bootcamp in disk utility were greyed out

:/
 
Last edited:
I can't tell you why this is happening, as I've never experienced the GUI turning all white and then rebooting unprompted. That's pretty weird. But file system corruption can manifest in all sort of bizarre ways, as can hardware problems.

Try booting with Safe Boot again, holding down the shift key at the startup chime, and let it run. Then try backing up again. You don't have much to lose by trying. Only one attempt needs to work, then you can move on.

Another option is to sector copy the Windows and Mac OS X partitions into mountable disk images, and you can deal with extracting your data from those images later. That would require 200GB and 500GB respectively, which is not space efficient, but can be done booted from a Lion/MLion install DVD – neither Mac OS nor Windows need to be mounted to do sector copies (actually, in fact they need to be unmounted).

I'd personally zero this disk also - that removes bad sectors from use, if there are any. I really wish it were easier to get smartmontools installed on Mac OS X - the tools are free open source and use SMART diagnostics built into every hard drive to see if they're having problems.

Does the forum accept binary attachments? Probably not... potential for malware I suppose.
 
Well Winclone provides a warning before use, saying to make sure that Windows was shut down correctly and the partition has been checked for disk errors. Maybe that's what went wrong, because the disk is unbootable?
 
Well Winclone provides a warning before use, saying to make sure that Windows was shut down correctly and the partition has been checked for disk errors. Maybe that's what went wrong, because the disk is unbootable?

I don't know.

It's worth booting off a Windows DVD and running chkdsk, and chkdsk /p until it no longer finds problems. I think the Startup Repair option does a chkdsk /r along with the bootloader repairs you were attempting manually, because Startup Repair can take hours. But at least it offers a GUI.
 
EDIT:

I'll be zeroing my harddrive and attempting to restore as much as I can. Thanks for all the help murphychris, you're a lifesaver. I'll update when I'm finished
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.