Benches macOS

7

Need to Restore MBR

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I was trying to install a modified version of XP using Boot Camp. After partitioning the drive, I couldn't get it to install. In an act of desperation, I followed some ill-advised "support" on another forum, and ended up manually deleting the Boot Camp partition as well as the smaller partition and trying to install it that way. It didn't work and Boot Camp couldn't erase the partition because I messed with it.

I booted up from my install disk and ran Disk Utility to bring my hard drive back to 1 partition and restored my data from my Time Machine backup. However, trying to use Boot Camp again, I still got "The startup disk cannot be partitioned or restored to a single partition" error.

Also, I found there was no option to boot from my hard drive from the "Startup Disk" menu. Only Network Startup and the install disk (when it's inserted) are available as startup options. I can only boot from Macintosh HD after holding the option key at startup. I tried booting from my install disk and used Disk Utility to repair permissions and repair the disk. That didn't solve the problem.

After doing some research I figured out I might have a problem with my master boot record (mbr). Sure enough, after running rEFIt, a partition inspector, I received the following report (I have no idea what to do from here):

* Report for internal hard disk *

Current GPT partition table:
No GPT partition table present!

Current MBR partition table:
# A Start LBA End LBA Type
1 63 625142447 af Mac OS X HFS+

MBR contents:
Boot Code: None

Partition at LBA 63:
Boot Code: None
File System: HFS Extended (HFS+)
Listed in MBR as partition 1, type af Mac OS X HFS+

Message was edited by: .Ant

7 replies

Sign in or join Beachball Help to reply.

  1. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Whatever you did the drive has not been partitioned correctly. Do this:

    Extended Hard Drive Preparation

    1. Boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger or Leopard.)

    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area. If it does not say "Verified" then the drive is failing or has failed and will need replacing. SMART info will not be reported on external drives. Otherwise, click on the Partition tab in the DU main window.

    3. Set the number of partitions from the drop down menu (use 1 partition unless you wish to make more.) Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID (required for Intel Macs) then click on the OK button. Click on the Partition button and wait until the process has completed.

    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.

    5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.

    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.

    To use Boot Camp to manage the Windows partition you cannot have but one GUID partition. Boot Camp will create the Windows partition. You cannot add or create any additional partitions or Boot Camp will not longer be able to remove the partition it created. Then to put the drive "right" will require re-partitioning.

  2. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    It may not be clear from Kappy's post that his procedure will *completely erase* your hard drive, so you must have a backup (on another drive, on DVD's or CD's, or with a remote service) of at least your important user files before you even think about doing this because you will lose everything on every volume of the drive.

    If you use the "Zero Data" option (which not all users agree is necessary) not even data recovery software will be able to retrieve any of the data on the drive. Apple designed this feature to be used to erase the drive for security reasons & it does this well enough that not even an expensive commercial data recovery service is likely to be able to recover any data from it if you apply it to the entire drive. It is even dubious that "heroic" efforts by government agencies could get much of use off any ATA type drive manufactured after about 2001 & greater than about 15 GB total capacity (which yours is almost certain to be) after it has been 'zeroed,' at least according to some authorities.

  3. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    ##
    Report for internal hard disk *

    Current GPT partition table:
    No GPT partition table present!

    Current MBR partition table:
    # A Start LBA End LBA Type
    1 63 625142447 af Mac OS X HFS+

    MBR contents:
    Boot Code: None

    Partition at LBA 63:
    Boot Code: None
    File System: HFS Extended (HFS+)
    Listed in MBR as partition 1, type af Mac OS X HFS+
    ##

    If I'm reading this correctly it says you have only one partition and it is a hfs+ partition.
    That of course will be your Leo partition starting at sector 63.
    Sector 1-63 is reserved for the 200MB EFI partition on intel macs.
    if you restored your drive to one partition, then you will of course, have no multiple startup
    option, simply because it is not needed, there is only one bootable partition.

    You can verify this by typing this command at the terminal.app prompt:
    diskutil list

    Here is a sample output from my machine:
    /dev/disk1
    #: TYPE NAME SIZE IDENTIFIER
    0: GUIDpartitionscheme *465.8 Gi disk1
    1: EFI 200.0 Mi disk1s1
    2: Apple_HFS Macintosh HD 151.1 Gi disk1s2
    3: Apple_HFS Mac Data2 314.3 Gi disk1s3
    /dev/disk2
    #: TYPE NAME SIZE IDENTIFIER
    0: GUIDpartitionscheme *232.9 Gi disk2
    1: EFI 200.0 Mi disk2s1
    2: Apple_HFS OSX 150.0 Gi disk2s4
    3: Apple_HFS Leopard 50.4 Gi disk2s3
    4: Microsoft Basic Data XP 32.0 Gi disk2s2
    ##

    Please note that the EFI partition is always first. It holds data about the any MBR partitions that
    exist and passes it on to apple's firmware. If no MBR partition exists it is in fact empty.

    With the current GUID setup on Apple machines, there can only be one MBR partition. Of course
    hfs+ file systems do not qualify and can never become the MBR partition. The MBR partition can
    be fat12 or 16, fat32 or NTFS file systems.

    You can in fact have multiple hfs+ partitions (data or bootable) on the same drive, but only one
    partition may contain a bootable master boot record.

    The MBR partition must be located as the last partition on the drive.
    It can be multi boot with a boot manager such as refit or Microsoft's NTLDR.

    When boot camp creates the Microsoft Basic File System it places a generic Master Boot Record
    in the MBR partition as a placeholder. Windows creates its own boot record during installation.
    The information linking the master boot record to the Apple firmware is written to the EFI partition
    The Firmware retrieves the information used to boot MBR based operating systems from there.

    You can manually create a bootable MBR partition with disk utility as long as you know the above
    rules. It must be the last partition on the drive and must be formatted with the correct file system
    by Disk Utility or a third party software such as ipartition (which allows an advanced user many
    more options than Disk Utility). Whatever software is used to do the job, it must be capable of
    creating the MBR partition, writing a placeholder MBR and correctly recording the information in
    the EFI partition.

    I hope this gives you the insight you need to properly prepare your windows installation.

    Kj

  4. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Some questions for you - slightly OT:

    1. If you were to create a Boot Camp partition on a drive starting out with a single GUID partition, install Windows on it, then use Disk Utility to shrink the OS X partition and add a second HFS+ partition (now three partitions on the drive) then Boot Camp can no longer manage the drive to remove the partition it created originally. Is this still true?

    2. If I use DU to remove the now unwanted Boot Camp partition what happens to the associated MBR? I had this happen to myself accidentally. I forgot about having the Windows partition when I made the second HFS+ partition. Boot Camp would not remove the partition it originally created. Although DU happily removed it, when I later made attempts to remove the second HFS+ partition and restore one unified partition DU refused to do so. Each time I attempted the repartitioning DU simply failed to make the changes. I was eventually forced to repartition the entire drive from scratch thus erasing the entire drive (it was fortunately backed up.) What's the dynamic going on here?

    3. You mention iPartition, but I've seen other reports that it is not fully compatible with Leopard (or at least with 10.5.6.) Have you information on this?

    4. Am I correct in understanding from your post that if you create a partition that is the last on the drive and format it MS-DOS that DU will enable this partition as a bootable MBR partition?

  5. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi kappy:

    1. I don't know if adding a partition with DU will disable boot camp. I do know that if you originally
    created a multi partition installation prior to using boot camp, boot camp has no issues with it.
    Since I purchased ipartition, I use it exclusively to create all my partitions including the boot camp
    partition. Note in passing: you can have a boot camp volume on each drive on a machine equipped
    with multiple drives, such as a Mac Pro.

    2. If you remove the boot camp partition, the associated MBR record in EFI partition is removed as
    well. Apple hfs+ partitions still boot as they have no dependency on MBR. In fact they have no
    dependency on the GUID partition scheme at all. You may back up your OS, repartition your
    boot drive as APM (apple partition format), restore your backup and your intel Mac will happily
    boot and run without the GUID scheme.

    One of many limitations in Disk Utility is the inability to move a partition. Should you delete a
    partition leaving free space before (in front of) another partition, you cannot reclaim that space
    without a reformat. the workaround is to combine the two partitions. That requires use of the
    command line (diskutil). The data is also destroyed in the partition farthest from the front of
    the drive in the process. ipartition overcomes this limitation.

    3. The latest ipartition (3.1.0) has no problems with 10.5.6. Most likely someone having problems
    is still using 1.5.x (version 2 was only released in Japan).

    4. Creating an ms-dos partition at the end of the drive with DU (on a drive using the GUID scheme)
    will create a potentially bootable MBR volume.

    Kj

  6. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Kappy wrote:
    1. If you were to create a Boot Camp partition on a drive starting out with a single GUID partition, install Windows on it, then use Disk Utility to shrink the OS X partition and add a second HFS+ partition (now three partitions on the drive) then Boot Camp can no longer manage the drive to remove the partition it created originally. Is this still true?

    In my limited experience playing with the current version of Boot Camp Assistant (the component of Boot Camp that does the partitioning), it still refuses to remove the partition it made for the Windows installation if I subsequently add any other partitions to the drive. Likewise, it still will not create the Windows partition if the drive already has multiple partitions. But if I remove the second HFS+ partition with DU, then Boot Camp Assistant will remove the Windows partition. IOW, Boot Camp Assistant's ability to manage the drive's partitions seems to depend only on the number of partitions on the drive, not what created them.

    4. Am I correct in understanding from your post that if you create a partition that is the last on the drive and format it MS-DOS that DU will enable this partition as a bootable MBR partition?

    I believe what is required is that the appropriate entry be made in the GPT (the GUID Partition Table), one of the three partition schemes that DU supports. GPT in turn supports booting from different partitions with entries in the table on EFI-based computers like Intel Macs. At boot time the EFI examines the table for boot candidates & hands off the process to the appropriate boot loader. But I do not believe DU actually writes the table entry identifying the partition as bootable, in much the same way that creating an HFS+ partition with DU does not in itself make that partition bootable. Something else, like the Windows installer, must write the table entry.

    FWIW, EFI is an Intel invention flexible enough to support many different boot loaders. However, since current Intel Macs can as noted also boot into OS X from drives with the APM partition scheme, which has no GPT, these Intel Macs must have some additional firmware enhancements to be able to do this. But AFAIK, the Mac firmware can not boot from a drive formatted with the MBR partition scheme, which a strictly BIOS-based computer could do. (In the GPT scheme, the table has an entry that makes it look like the MBR scheme to computers that do not support EFI, or at least that is my understanding of how all this works.)

  7. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Technical note TN2166 - Secrets of the GPT:
    http://developer.apple.com/technotes/tn2006/tn2166.html

    Kj