Fixing MBR Tables on iMac or MBP Triple Boot Setups

I spent several hours today struggling to fix my iMac triple boot setup with Mac OS X Lion, Windows 7 x64, and Ubuntu 11.10. rEFIt does not handle the new Apple Boot partition included in the latest release of Apple’s operating system. This article provides an example of how to fix your MBR table manually without using the rEFIt partition sync tool.

This is not a triple boot setup guide. I’m providing this information here for any of those poor souls who are also struggling with this problem and looking for a solution.

The Scenario and Problem

You have already gone through the motions of creating a triple boot setup. For example, you’re running Mac OS X Lion,  had installed rEFIt, installed Windows 7 x64, and installed Ubuntu 11.10. However, when the rEFIt menu appears, selecting Linux boots Windows. Selecting Windows also boot Windows. Selecting Mac OS X boots Mac.

If this sounds like the problem you’re having, then read on.

The Cause

You’ve followed all of the triple boot instructions that you can find online. For example, you’ve made sure to install the grub boot loader on the Linux partition rather than on the master boot record (MBR). Everything seems like it should work, but it doesn’t. Only stubborn old Ubuntu [or some other Linux distro] refuses to boot.

From what I can tell, the problem lies with rEFIt in combination with Mac OS Lion. Mac OS X 10.7 adds a new Apple boot partition. If you use the rEFIt partition sync tool, it may place this partition in your MBR table. Since the MBR table can only have 4 partitions in this implementation, that means that one of your other operating systems doesn’t make the cut. In my case, this was Ubuntu.

The Solution

The solution is to fix the MBR table yourself without rEFIt, since rEFIt doesn’t handle this new development. The guide that follows only serves as an example. Your case will likely differ, so read through this for the general process and make adjustments where you need.

  • Boot into Mac OS X
  • Run the Partition Inspector application. This application is normally installed with rEFIt in /Applications/Utiltities.
  • Launch terminal
  • Run the following command to find out what disk# you should be using: diskutil list [hint: it’ll be all the one with your operating system partitions on it, usually disk0].
  • Run the following command making any substitutions for disk number in your case: sudo fdisk -e /dev/disk0.

Upon running the fdisk command, it might complain at you and perhaps give you an error message that looks something similar to fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory. Just ignore that message. What’s important is that you should now be at the fdisk prompt which looks something along the lines of fdisk: 1 >

At this prompt enter print and you should get a readout somewhat like the following:

Now begins the fun. You need to update this table with the correct information, write it, and then reboot. To help make this process more clear, below is example output generated from the Partition Inspector application in my particular case. You will need to reference this information as you update the MBR partition. This example is also the finished product with everything working, so you can use the information under “Current MBR partition table” as an example of what you’re trying to achieve in the end.

Editing the partition table

This is an example of how the editing process will go based on my example scenario above.

We can cross reference the fdisk print report about the MBR and compare it to the GPT table. For example, in MBR slot #2 [in the fdisk print results above], it has a start of 40 and a size of 409600. This corresponds to the GPT entry “Partition at LBA 40.” This can also be found in the first group of results generated by the Partition inspector. This MBR entry #2 corresponds to GPT partition #1. It has a start of 40. You can calculate the end by subtracting 1 from the size. For example: 40 + 409600 – 1 = 409639 (the ending LBA).

In my case, MBR slot #4 is reportedly unused [in my case rEFIt reports this as the Apple Boot partition]. Comparing the MBR table to the GPT table we can see that the MBR table properly has my Mac partition, the EFI protection partition, and the Windows partition. So, I need to add my Ubuntu partition to the MBR table in slot #4.

Do not remove the “EFI Protective” partition from the MBR. According to the Myths page on the rEFIt Web site, this partition tells GRUB not to overwrite the GPT tables. Additionally, Curtis Shimamoto reports that the protective partition must start at LBA 1.

Referring to the Partition inspector, we can see that the “Partition at LBA 1892034560” is the Ubuntu partition. This is because its boot code is “GRUB” and its filesystem is ext4. Those are some distinct GNU/Linux markers right there. Before heading back to fdisk though we need to do a quick bit of math. fdisk takes a start LBA, but it takes a size instead of an end LBA, so the size must be calculated. Fortunately, Partition inspector provides this information in the first grouping of results under “Current GPT Partition Table.” Take the end LBA and subtract the start LBA and add 1 to obtain your size. For example, 1953523711 – 1892034560 + 1 = 61489152.

Now that we have the information that we need, it’s time to go back to the terminal which should still be waiting at the fdisk prompt. Since I want to update MBR table slot #4, type in edit 4 The first thing it will probably say is Partition id ('0' to disable) [0 - FF]: [B] (? for help) ?. fdisk is asking for the partition type. If you enter “?” it will provide you with a list of all your options. In this case, for Linux, I’ll use “83”

If fdisk asks Do you wish to edit in CHS mode? say “n”.

fdisk will ask for the Partition offset. This is the starting LBA, so enter that. Remember that in my case it was 1892034560, but this is almost guaranteed to be different for you. The final question that fdisk will ask is for the size, so enter the previously calculated size.

Finally, write the MBR table with the write command. You will probably receive an error asking if it’s o.k. to make the changes after a reboot because the device could not be accessed exclusively. Say yes [“y”] and then quit with quit.

Repeat the process as necessary until your MBR table is completed.. If you’re only struggling with the new Apple boot partition taking up one of the MBR slots, then one pass similar to what I just did above should get the rEFIt triple boot menu back on track in and in working order.

Concluding Remarks

This is certainly an inelegant solution, but it’s a satisfactory workaround until the problem with the gptsync tool can be resolved. I have filed a bug report that can be tracked if you’re interested in following this issue: gptsync mishandles apple boot partition in Mac OS X Lion

81 thoughts on “Fixing MBR Tables on iMac or MBP Triple Boot Setups

  1. Hi, I have a triple boot on my macbook. But I always gave me the error “no boot file” when I try to load Windows, and the Mint partition don’t appear.

    How could I load the missing partitions to my refit.

    *** Report for internal hard disk ***

    Current GPT partition table: # Start LBA End LBA Type 1 40 409639 EFI System (FAT) 2 409640 562348063 Mac OS X HFS+ 3 562348064 563617599 Mac OS X Boot 4 563617792 592914431 Basic Data 5 592916480 595011583 Linux Swap 6 595013632 625141759 Basic Data

    Current MBR partition table: # A Start LBA End LBA Type 1 1 39 ee EFI Protective 2 40 409639 0b FAT32 (CHS) 3 * 409640 562348063 af Mac OS X HFS+ 4 562348064 563617599 af Mac OS X HFS+

    greats

    1. Jimmy,

      From the looks of it, the MBR partition table only contains OS X partitions. MBR #1 (EFI Protective) is mandatory and can’t be removed, and MBR #3 is your OS X partition. So you can replace MBR #2 with the second operating system partition, and MBR #4 with the third.

      Linux Mint appears to be GPT #5, but Windows could be either #4 or #6. You’ll have to do some detective work while booted into OS X with disk utility to figure out which one actually contains Windows. If that was accidental you may want to reclaim the space and merge the two.

      1. Hi, thanks.

        I now where the SO are installed. GPT #4 is for Windows GPT #5 is for Linux SWAP GTP #6 is for Mint

        Is it possible that I add on MBR 5, 6 and 7 the GPT who aren’t mapped?

        greats

        1. I am fairly certain that Mac firmware only requires a couple of things regarding its hybrid MBR. First, it must have only one protective MBR partition, as some other implementations call for two, one in the beginning and one at the end. Second, it must start at block 1.

          This being the case, you can actually use the first partition to cover a fairly large amount of your HDD. For instance, if your OSX partition is 2nd, after the EFI system partition, then you can start your protective MBR at 1 and then have that cover the ESP as well as your OSX. Thus still leaving you with three potential spots in which to add to your MBR.

          Please scroll down to see my comment on using gdisk to create a hybrid MBR. Jon’s method certainly works, and it definitely helped me out when I first started purusing this goal. But since then I have found that there is a much much easier way. Gdisk allows for interactive creating of a hybrid MBR, without the need for knowing all the start/end points of each partition.

        2. Also Jimmy, why do you have your Mint install marked as microsoft basic data. That identifier is usually reserved for NTFS/FAT. You should be using 8300, which is Linux specific.

        3. Hi, I don’t have my macbook here, I will try your explaination later. Thanks.

          The partition is market as MS but I pretty sure that is an Ext3.

          If anyone have another way to solve my problem I will be greatfull if you can help me.

        4. @Jimmy You can not have more than 4 partitions in MBR (you could in theory have many “extended” partitions, but those are not bootable). Your setup seems mostly fine: you can have – windows recognize 4 partitions (esp, windows, and 2 others of your choice) – gpt showing all of them – windows booting in BIOS support mode – linux booting in UEFI mode – windows will see some empty space on disk, but that’s fine, as long as you do not forget that it is actually in use and try to format it 😉 You will have to resync the gpt and mbr, or edit mbr by hand to achieve that. You might also have trouble botting linux in efi mode, using latest version of mint is recommended. I made it work by using refind => grub as bootloader combo

  2. Hello,

    Wondering if you can point me to what i might be doing wrong:

    *** Report for internal hard disk ***

    Current GPT partition table: # Start LBA End LBA Type 1 40 409639 EFI System (FAT) 2 409640 1912518951 Mac OS X HFS+ 3 1912518952 1913788487 Mac OS X Boot 4 1913790464 1953523711 Basic Data

    Current MBR partition table: # A Start LBA End LBA Type 1 1 409639 ee EFI Protective 2 409640 1912518951 af Mac OS X HFS+ 3 1912518952 1913788487 ab Mac OS X Boot 4 * 1913790464 1953523711 07 NTFS/HPFS

    MBR contents: Boot Code: Unknown, but bootable

    Partition at LBA 40: Boot Code: None (Non-system disk message) File System: FAT32 Listed in GPT as partition 1, type EFI System (FAT)

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

    Partition at LBA 1912518952: Boot Code: None File System: HFS Extended (HFS+) Listed in GPT as partition 3, type Mac OS X Boot Listed in MBR as partition 3, type ab Mac OS X Boot

    Partition at LBA 1913790464: Boot Code: Windows BOOTMGR (Vista) File System: NTFS Listed in GPT as partition 4, type Basic Data Listed in MBR as partition 4, type 07 NTFS/HPFS, active

    Any help appreciated, Im not a MAC savvy person

    Cheers

    1. I have been messing with this quite a bit since moving to Linux full time. I found a much easier way to do it. You need to install gdisk (gpt-fdisk) http://sourceforge.net/projects/gptfdisk/?source=recommended and use that. It has a tool to convert partitions from your gpt (up to 3) and then create the protective EE partition from sector 1.

      gdisk /dev/diskXsY

      hit “p” to print the current gpt table and hit “?” to see options.

      use “r” (I think) or whatever is recovery and transformation

      use the “h” option to create a hybrid mbr

      from there you should be able to follow the prompts. It will ask you which partitions you want included, list them separated by a single space between each. It will then go one by one asking about each partition and its settings. the defaults “should” work because it pulls info from your gpt. then it will ask you if you want to create a protective partition, tell it yes and that you want it in the beginning.

      from there, hit “p” again to verify it is what you want.

      hit the “w” to write that sh*t and exit

      DONE!!!

      PS What the hell is Mac OSX boot? Is it really OSX, because if it is not, you need to change the partition type before you do the above. I rather suspect that is Linux, in which case it needs to be type 83 (mbr) or 8300 (gpt). GOOD LUCK!!! You’re almost there!

  3. I will say, this is an absolutely great guide and has made my triple boot configuration really easy to setup. This has worked without fail with every Linux distro I’ve used. Thanks again

  4. Hi Jon,

    I’m having grief with my Lion upgrade having ‘lost’ my Windows partition – it shows up in Disk Utility as Disk0s4. I’m not running a triple boot setup, just OSX with Windows in Bootcamp. Just curious to know whether you technique could be used to bring my Windows partition back to life? I’m not using rEFIt but I’m happy to install it to get the partition information.

    1. Graeme, perhaps. At least it’s worth a shot. You will probably want to mount the disk and back up any files you care about first just to be safe, but at this point since it’s not working you don’t have a lot to lose.

      It’s strange that it stopped working since it sounds like you were using a standard Bootcamp configuration…

      1. Hi Jon,

        Thanks for the info. What seems to have caused the problem was advice Apple gave me to work around a problem with the Lion install when it couldn’t create a Recovery partition. The advice was to shrink the main OSX partition by 5GB to create some free space for the Recovery partition and then once the upgrade was complete to enlarge the OSX partition to recover whatever free space was left after the upgrade. When I was clawing back the free space I noticed Disk Utility say it was repositioning a partition. I think that is what caused the problem.

        One question, how do I mount the Windows partition? I opened Disk Utility and attempted to mount the partition there but it didn’t want to know about it. I also booted the machine using an Ubuntu 11.10 live CD but I couldn’t even find the Disk0s4 partition (perhaps due to a lack of knowledge of Linux tools). So any advice about mounting the partition so I could get at the contents would be very helpful.

        Thanks again…Graeme

        1. Graeme, that’s a good question and I don’t have an answer if it’s not showing up in diskutil. Perhaps the partition is still there but in some kind of limbo, or maybe it’s toast. I’m not sure. You might try seeing if it shows up as a hidden partition in diskutil, but that’s probably a long stretch. Sorry I can’t be more help 🙁

        2. If you are booting from an Ubuntu Live CD, you should be using Linux partition identifiers. OSX lists partitions (and disks) and DiskXsY (ie Disk0s4) which Linux refers to them as sdaX (ie /dev/sda, /dev/sda1, /dev/sda2, etc). Otherwise the tools tend to work more of less identically. Although sometimes the command flags (the -e in Jon’s fdisk command above) are slightly different. Refer to the man pages to see the differences.

  5. Hi Jon! Thanks for the great guide! I followed the steps, and rearranged my MBR: removed Mac Revovery; moved Windows Vista as the 3rd one and added the Linux Partition as the 4th. REfit worked correctly, but now Windows refuses to boot. Any hint?

    1. I would need to see the data from the partition inspector and fdisk to say anything definitively. It’s possible that the sector calculations are off, or that the Windows boot sector become corrupted for some reason. If you’re sure the partition scheme is now fixed you might try reinstalling Windows [or perhaps trying one of the boot sector repair utilities].

      1. On the off-chance that you read this I have a similar problem where afterwards it no-longer boots into Windows. My fdisk readout after following your instructions is: fdisk: 1> print Disk: /dev/disk0 geometry: 30401/255/63 [488397168 sectors] Offset: 0 Signature: 0xAA55 Starting Ending

        #: id cyl hd sec – cyl hd sec [ start – size]

        1: EE 1023 254 63 – 1023 254 63 [ 1 – 39] 2: 0B 1023 254 63 – 1023 254 63 [ 40 – 409600] Win95 FAT-32 3: AF 1023 254 63 – 1023 254 63 [ 409640 – 166131544] HFS+ 4: 83 1023 254 63 – 1023 254 63 [ 459771904 – 27343751] Linux files

        One thing that stands out at me is that I’m only allowed four partitions it seems, and I need five.

        1. Alex, it looks like the #2 record is not correct. LBAs 40 to 409639 is typically “EFI System (FAT)” and probably is not big enough to be your Windows partition.

  6. I recently upgraded the Hard Drive in my Macbook to a 750gb Hybrid SSD (Caches commonly accessed blocks to SSD), from a 500gb Drive. As you can imagine it was a rather involved process.

    While upgrading, I took the oportunity to upgrade Ubuntu to 11.10, and also add an extra partition for Storage. Adding that Partition is what I believe caused me to have this issue.

    Thanks to your guide I was able to recover my triple boot. I also learned A LOT about GPT. MBR as well as EFI too. I’ve noticed that some people have reported loosing rEFIt after modifying the MBR table (Which you should). In order to fix this, rEFIt needs to be reinstalled and re-blessed. To do this, Boot into OS X and rename or delete the /efi/ folder. Don’t worry. This only gets rid of refit. Now download refit, and run through the installation. After the install is done open up a terminal window. cd to /efi/refit and issue the following command: “sudo sh enable.sh”

    You should see a bless command executed on refit and it’s configuration. Now type reboot to restart into refit. If refit doesn’t show up, boot back into OS X, and just reboot again. Refit should show up now (There is a bug that sometimes causes refit not to show up after reboot).

    Thanks for the awesome guide Jon, and good luck to anyone else having this issue!

  7. Awesome! I haven’t used fdisk and never for something like this. It worked like a charm so now I can access my win 7 partition again ( MBR/GPT was corrupted by gparted ). Thank you so much!

  8. Great guide, I have a quick question though. I ran rEFIt just fine until I upgraded to Lion. Seems like it was a mistake, now that I can’t get rEFIt to boot. I am trying to edit the partition in terminal but the format says “EFI System” and asks for a partition ID, but I can’t find anything to match. Do you know which partition ID I should pick?

    1. You’ll probably have to reinstall rEFIt after upgrading. As for the partition ID that you should pick I can’t say without seeing all of the information. How you need to rearrange your MBR will depend on what’s already in there and what needs to be added. For instance, in my example above, one of the EFI System partitions is the Linux partition which I needed to add to my MBR record by replacing one of the Apple partitions.

      1. I was able to fix it by deleting the rEFItblesser in the /library/startupitems/refitblesser folder. Then I opened up terminal and one of these commands

        /efi/refit/enable.sh

        apparently the following should do the same thing:

        cd /efi/refit then run ./enable.sh

        Thanks for the guide, I was afraid Lion would have been a waste of $30

  9. Your write-up came in handy today when I dared to add a swap partition to Ubuntu with ‘gparted’. The additional partition threw the already working (from me fixing triple-boot yesterday) out of the window and I was again presented with a “Missing Operating System” message upon reboot.

    Thanks again.

  10. Hello

    What do you think of this procedure to re-sync a partition table? I have a dual boot Lion 10.7.2 and Windows 7 SP1. No Unbuntu partition so I was going to use a live USB Ubuntu. This is all new to me. I would appreciate opinions.

    1. Load Ubuntu and make sure you are connected to the internet. You can connect to WiFi by clicking on the icon on the top right of the desktop.

    2. Once you are connected, go to Applications -> Accessories -> Terminal.

    3. Type sudo vi /etc/apt/sources.list and hit enter. You will be asked for your administrator (login) password to continue. This will load the list of sources for the package updater in the text editor vi so that we can add a new source.

    4. Scroll down to the bottom of the file using page down or simply by pressing the down arrow. When you reach the end of the file, press the letter o. This will open the edit mode on a new line.

    5. Type deb http://ftp.iinet.net.au/debian/debian sid main

    6. Press ESC. This will exit edit mode.

    7. Type :wq and hit enter. This will save the file and exit the text editor. If you make a mistake, you can exit without saving by typing :q!.

    8. Now we want to actually install gptsync. Type sudo apt-get install gptsync and hit enter. Install commands should pop up and (hopefully) it should install successfully.

    9. Type sudo gptsync /dev/sda and hit enter. You will receive a message to update partitions from MBR to GPT. Type y and hit enter.

    10. Restart the computer with no disc in the disc drive. Confirm that both Windows 7 and Mac OS X successfully load.

    Credit to JamesLittler @ insanelymac.com

    Thank you

    1. I haven’t prsonally tried it that way but it sounds like it should work. If you don’t have a Ubuntu partition, then you might be able to get away with the sync tool that comes with rEFIt. In fact, you might not even need rEFIt if you’re going to boot off a USB stick. I can’t say that I’ve tried it, but won’t Mac’s own EFI implementation give that as a boot option when the USB stick is plugged in? If that’s true then no special fixes would be required.

    1. May I ask if your Win7 is 64-Bit? Are you using UBUNTU 11.10? What size is your hard drive? What type of computer are you installing the software on: MAC Pro?

  11. Here’s my story… I have a Mac with Lion. I then installed windows 7 64-bit. Everything good at this point. I then tried to load UBUNTU 11.10. When everything booted up again I couldn’t get into windows. I’ve wiped the computer out 3 times already and tried to reinstall everything again and the results are the same. I came across your excellent write-up and was going to make another attempt. Does it sound like I have the symptoms you have? It says it can’t find the MBR in windows when I try to run windows. I don’t know what the rEFIt that you mention is. Does that load on it’s own?

      1. I added rEFIt after installing the MacOS on a brand new 2TB drive. I then installed Windows 7. Everything once again ok. I could use the boot window from rEFIt and it worked fine for Windows 7 and MacOS. Then my problem started after installing UBUNTU 11.10. (By the way, everything is 64-Bit.) I believe I have the exact problem as Andrea below. The problem is that it wouldn’t let me add the correct starting value on the forth entry. The number I had to enter was larger than the max allowed. It may be because I have a 2TB drive. I’m not sure. I tried erasing all four entries and put them back in one at a time. It just won’t let me put all the correct values in. I know if I were able to put the correct values in, that it would probably work. I kinda-of throw in the towel on this one. I’m trying to get my computer back up and running again. I’m going to leave UBUNTU 11.10 off for now till someone figures out how it can be done. Let me know if you have any other advise. Thanks for replying Jon. I have to give you credit on homing in on the problem. Prior to reading your comments above, I had no idea what was going on. Thanks again.

        1. Very interesting. 2TiB is the limit for partition sizes with MBR tables regardless of whether the operating systems involved are 32/64bit. How far above the 32bit limit of an integer are your LBA numbers? I’m surprised that this is an issue given that your drive is not larger than the limit. Perhaps you can sacrifice a few megabytes in the last partition to bring the last LBA number down within range of a 32 bit integer. I wouldn’t expect the loss to be too significant, but I didn’t crunch the numbers.

        2. I think it’s more than that. I erased all the parameters and tried to input them in one by one. The starting bit, ending bit and other info and it did not work out. I even tried to put it back to what it was before I changed it and it wouldn’t let me do that either. As a side note: if I were to try this again, I would do it with another drive. My question to you is, if I buy another 2TB drive to play around with, what program should I use to make an exact copy of my existing 2TB drive? I no longer want to experiment with my present drive. Thanks for your help.

        3. Walter, is there an error message that fdisk gives you when it rejects the numbers? If not, I’m afraid there’s no specific advice that I can give you. Something seems to be amiss though if you can’t restore the original numbers. MBR is supposed to support sizes up to 2TB anyways. I would have to get hands on and tinker with it a bit, but some things that you might want to double check are:

          • perhaps your primary 2TB disk identifier is not /dev/disk0
          • perhaps the disk geometry in fdisk is incorrect
          • you could try re-initializing the loaded MBR with defaults using fdisk [see help when you’re at the fdisk prompt]

          You could try Carbon Copy Cloner or SuperDuper! I have never used either of those, but I have seen them pop up quite frequently when discussing bit-for-bit backups. Keep in mind that getting another 2TB drive and cloning your original probably isn’t going to fix the problem. There’s always a possibility of course, but I highly doubt it.

          My particular system is a mid-2010 iMac with a 1TB hard drive.

        4. The error stays it’s out of range. Thanks for the advice. When I was doing the operations to my drive, I only had one drive in my computer at the time. It was /dev/disk0 I believe.

          I think it makes something up for the geometry that’s not correct. I think you’re on to something there.

          I did re-initialize and tried to put everything back one at a time but it wouldn’t let me. As I inputted every line, my range got smaller and smaller until I couldn’t put what I needed in.

          About the cloning: I wanted to clone the drive just for experimental purposes. I can’t afford losing anything or time by making changes on my present drive. I wanted to do more research but just don’t want to do it on my present drive. Thanks for all your time and help.

  12. I’ve tried your guide… but is refit working properly for you in the first place? Did you installed it the automatic way (with Lion)?

    1. Yes, refit should otherwise be working. In other words, the menu should appear at boot and its functions working, such as booting either Macintosh or a second operating system.

  13. Jon, this was an incredible job you have done with your post! I have to thank you for a perfect guide, with enough information to follow your steps. It was the first time ever, that I had my hand on disk sector level 🙂 But it worked like a charm and I was able to fix a broken Win7-64bit + Ubuntu11.10 MBR entry!

    Two comments for other following your trail: * yes type => 07 is correct for NTFS even if fdisk mentioned it not explicit in “?” help * fixing all that MBR stuff doesn’t mean, that rEFIt does not have the gptsync error afterwards. But it works!

    Kudos with best regards Peter (=PA=)

  14. My mbr does not have all partitions on gpt. how can I create the missing ones?

    *** Report for internal hard disk ***

    Current GPT partition table: # Start LBA End LBA Type 1 40 409639 EFI System (FAT) 2 409640 602240951 Mac OS X HFS+ 3 602240952 603510487 Mac OS X Boot 4 603510784 1205340159 Basic Data 5 1205342208 1234636799 Basic Data 6 1234638848 1250263039 Linux Swap

    Current MBR partition table: # A Start LBA End LBA Type 1 1 39 ee EFI Protective 2 40 409639 0b FAT32 (CHS) 3 * 409640 602240951 af Mac OS X HFS+ 4 602240952 603510487 af Mac OS X HFS+

    MBR contents: Boot Code: None

    Partition at LBA 40: Boot Code: None (Non-system disk message) File System: FAT32 Listed in GPT as partition 1, type EFI System (FAT) Listed in MBR as partition 2, type 0b FAT32 (CHS)

    Partition at LBA 409640: Boot Code: None File System: HFS Extended (HFS+) Listed in GPT as partition 2, type Mac OS X HFS+ Listed in MBR as partition 3, type af Mac OS X HFS+, active

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

    Partition at LBA 603510784: Boot Code: GRUB File System: ext4 Listed in GPT as partition 4, type Basic Data

    Partition at LBA 1205342208: Boot Code: None (Non-system disk message) File System: FAT32 Listed in GPT as partition 5, type Basic Data

    Partition at LBA 1234638848: Boot Code: None File System: Unknown Listed in GPT as partition 6, type Linux Swap

    fdisk: 1> print Disk: /dev/disk0 geometry: 77825/255/63 [1250263728 sectors] Offset: 0 Signature: 0xAA55 Starting Ending

    #: id cyl hd sec – cyl hd sec [ start – size]

    1: EE 1023 254 63 – 1023 254 63 [ 1 – 39] 2: 0B 1023 254 63 – 1023 254 63 [ 40 – 409600] Win95 FAT-32 *3: AF 1023 254 63 – 1023 254 63 [ 409640 – 601831312] HFS+ 4: AF 1023 254 63 – 1023 254 63 [ 602240952 – 1269536] HFS+

    1. Andrea: you are suffering from the problems I described in this blog post. Partition inspector indicates that #4 in your MBR table is the new Mac OS X boot partition. Looking at your MBR table briefly, it appears that you already have Windows and Mac partitions in there. So, I would replace #4 in your MBR table with your Linux partition which appears to be “Partition at LBA 603510784” following the my example as a guide.

      Good luck!

    2. Andrea: Also, you can’t have more than 4 partitions in the MBR table in this implementation. However, I don’t think it’s necessary to have the Linux swap partition in the table. I haven’t tested with a Linux swap partition myself [they are not necessary anymore], but in theory it should be fine as long as rEFIt sees Ubuntu so that it can boot, and Ubuntu itself can see its own swap partition [again, in theory].

      If it does give you problems, you can reinstall Ubuntu without the swap partition. I did a Google search for “EFI protective partition” and found the myths page on the rEFIt website. It appears that you should not delete the EFI protective entry from the MBR, because this tells GRUB not to overwrite the GPT tables.

  15. Oh and before i reinstalled windows on a new partition.. i lost a partition that is just grayed out now. this :

    Partition at LBA 1836337624: Boot Code: None File System: Unknown Listed in GPT as partition 5, type Basic Data

    which was linux use to say ext4

    1. You may need to reinstall Ubuntu, because I’m not sure what happened there. One thing for certain is that you are suffering from the same problem as I was: you have the Mac OS X Boot partition in your MBR table.

      I suggest first correcting the MBR table by replacing #3 (Mac OS X Boot) with your Ubuntu partition. Then, if Ubuntu still doesn’t work I would reinstall it, remembering to install the bootloader on the partition (not the MBR). Also, remember not to run gptsync after fixing the MBR table.

  16. ok so I got frustrated and some how ended up reinstalling windows… now windows loads and ubuntu does not. I think I may just format and start over again. Unless you think you can salvage me. 8)

    *** Report for internal hard disk ***

    Current GPT partition table: # Start LBA End LBA Type 1 40 409639 EFI System (FAT) 2 409640 1738681367 Mac OS X HFS+ 3 1738681368 1739950903 Mac OS X Boot 4 1739952128 1836337151 Basic Data 5 1836337624 1875397079 Basic Data

    Current MBR partition table: # A Start LBA End LBA Type 1 1 409639 ee EFI Protective 2 409640 1738681367 af Mac OS X HFS+ 3 1738681368 1739950903 ab Mac OS X Boot 4 * 1739952128 1836337151 07 NTFS/HPFS

    MBR contents: Boot Code: Unknown, but bootable

    Partition at LBA 40: Boot Code: None (Non-system disk message) File System: FAT32 Listed in GPT as partition 1, type EFI System (FAT)

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

    Partition at LBA 1738681368: Boot Code: None File System: HFS Extended (HFS+) Listed in GPT as partition 3, type Mac OS X Boot Listed in MBR as partition 3, type ab Mac OS X Boot

    Partition at LBA 1739952128: Boot Code: Windows BOOTMGR (Vista) File System: NTFS Listed in GPT as partition 4, type Basic Data Listed in MBR as partition 4, type 07 NTFS/HPFS, active

    Partition at LBA 1836337624: Boot Code: None File System: Unknown Listed in GPT as partition 5, type Basic Data

    Disk: /dev/disk0 geometry: 121601/255/63 [1953525168 sectors] Offset: 0 Signature: 0xAA55 Starting Ending

    #: id cyl hd sec – cyl hd sec [ start – size]

    1: EE 1023 254 63 – 1023 254 63 [ 1 – 409639] 2: AF 1023 254 63 – 1023 254 63 [ 409640 – 1738271728] HFS+ 3: AB 1023 254 63 – 1023 254 63 [1738681368 – 1269536] Darwin Boot *4: 07 1023 254 63 – 1023 254 63 [1739952128 – 96385024] HPFS/QNX/AUX

  17. Hi there… in a desperate approach to get my mac to triple boot properly… first i made 3 partitions… installed windows then ubuntu… then when i try to boot into ubuntu it says “no os” …so then i tried to install some software on ubuntu but i had to use a software called iboot to boot into ubuntu again and used gptsync hoping to fix my problems…. then it just booted into “no os” from both my partitons…. so then i saw your page… i tried my best to do what it said but now ubuntu and mac boots fine but when i try to boot into widnwos its gives me the grub screen then i select windwos 7 but then it gives an error an goes into a red grub screen >>>???

    1. Sean, was Windows working before you installed Ubuntu? The first thing I would check is to make sure that the grub bootloader was installed on the Ubuntu partition, and not the MBR boot sector. That is, when you installed Ubuntu you have to explicitly install grub on to something like /dev/sda4, if that’s your Ubuntu partition. otherwise, you’ll toast the Windows bootloader.

      The second thing I would double check is that the MBR table is setup correctly as in my guide above. I can’t say anything specific in your case without seeing the fdisk report and the partition inspector report.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.