Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 45

Thread: Ubuntu on MacBookPro - difficulties w partition tables

  1. #21
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,192

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    First, on most real BIOS-based systems, a conventional GPT boot works just fine. Therefore, it's not clear to me why rEFIt requires a hybrid MBR. I can think of three possibilities:


    • Apple's BIOS emulation is buggy in a way that necessitates use of a hybrid MBR. My Legacy BIOS Issues with GPT page might help somebody interested debug such problems.
    • The rEFIt boot loader may be crippled in such a way that it can only read MBR partitions. IMHO, if this is the case then it's broken by design. I'd look into trying to use GRUB 2 without rEFIt. (I don't know if that's possible, but it's worth investigating.)
    • The rEFIt developers (or whoever insists that hybrid MBRs are required to boot Linux on a Mac) are mistaken. This would be the easiest fix, since no fix would be required, but it'd be a shame that so many peoples have gone through so much needless frustration.



    Second, the page to which you link is wrong on at least one other point: the "you need a MBR partition table to use LILO/GRUB" issue. I'm not sure about LILO (I've seen conflicting stories on it and my own tests have been inconclusive), but GRUB 2 definitely works on GPT-only systems. There are also patched versions of GRUB Legacy that work with GPT-only systems. (I think that the version of GRUB Legacy that Ubuntu offers as an option is so patched, but I'm not 100% positive of that.) My comments apply to these boot loaders on a conventional BIOS-based system, though; if there's some Mac-specific wrinkle involving a Mac's BIOS emulation mode, I don't know what it is.

  2. #22
    Join Date
    Oct 2010
    Beans
    25

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    Quote Originally Posted by srs5694 View Post
    First, on most real BIOS-based systems, a conventional GPT boot works just fine. Therefore, it's not clear to me why rEFIt requires a hybrid MBR. I can think of three possibilities:


    • Apple's BIOS emulation is buggy in a way that necessitates use of a hybrid MBR. My Legacy BIOS Issues with GPT page might help somebody interested debug such problems.
    • The rEFIt boot loader may be crippled in such a way that it can only read MBR partitions. IMHO, if this is the case then it's broken by design. I'd look into trying to use GRUB 2 without rEFIt. (I don't know if that's possible, but it's worth investigating.)
    • The rEFIt developers (or whoever insists that hybrid MBRs are required to boot Linux on a Mac) are mistaken. This would be the easiest fix, since no fix would be required, but it'd be a shame that so many peoples have gone through so much needless frustration.



    Second, the page to which you link is wrong on at least one other point: the "you need a MBR partition table to use LILO/GRUB" issue. I'm not sure about LILO (I've seen conflicting stories on it and my own tests have been inconclusive), but GRUB 2 definitely works on GPT-only systems. There are also patched versions of GRUB Legacy that work with GPT-only systems. (I think that the version of GRUB Legacy that Ubuntu offers as an option is so patched, but I'm not 100% positive of that.) My comments apply to these boot loaders on a conventional BIOS-based system, though; if there's some Mac-specific wrinkle involving a Mac's BIOS emulation mode, I don't know what it is.
    rEFIt is not implying that it needs MBR, just that having an MBR triggers the BIOS emulation in Macs. Based on history, this makes sense: Apple introduced BIOS emulation as a firmware updated when it released Boot Camp, and Boot Camp specifically makes the bastard hybrids when it repartitions the hard drive for Windows. Based on googling it's also clear that at least before the video acceleration did really need the BIOS emulation, but I'm not sure if that situation has been improved on.

    Also while Grub can now boot from GPT, I usually find this with disclaimers about the feature being relatively untested, so it just might be outdated info. Also they do specifically mention elilo as being a GPT capable bootloader, and mention that rEFIt is not even needed to boot Linux.

  3. #23
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,192

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    Thanks for your post, tpievila; that clears up a few things in my mind. I wonder what it is about the hybrid MBR that triggers Apple's BIOS emulation. I'm wondering if it might be possible to do the job by creating something that's less horrible than a hybrid MBR, such as creating a 0xEE protective partition that's just a little bit short. Alternatively, in principle you could partition the disk so that it's got a tiny little throwaway partition (even just one sector in size) at the very end of the disk and create a hybrid MBR that contains nothing but that one partition. That way, the 0xEE protective partition will cover all the interesting partitions on the disk, making dangerous screw-ups much less likely than would be the case with a hybrid MBR that includes all the regular partitions.

  4. #24
    Join Date
    Oct 2010
    Beans
    25

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    Quote Originally Posted by srs5694 View Post
    Thanks for your post, tpievila; that clears up a few things in my mind. I wonder what it is about the hybrid MBR that triggers Apple's BIOS emulation. I'm wondering if it might be possible to do the job by creating something that's less horrible than a hybrid MBR, such as creating a 0xEE protective partition that's just a little bit short. Alternatively, in principle you could partition the disk so that it's got a tiny little throwaway partition (even just one sector in size) at the very end of the disk and create a hybrid MBR that contains nothing but that one partition. That way, the 0xEE protective partition will cover all the interesting partitions on the disk, making dangerous screw-ups much less likely than would be the case with a hybrid MBR that includes all the regular partitions.
    I haven't been able to find a proper technical discussion on how the Apple EFI works. But just having the MBR there won't be enough, you need to boot the first bootloader from a MBR partition too, if I understood it correctly. Finding someone who actually has first hand knowledge about the EFI would be great, but I'm not sure how much effort anyone in the Linux community is yet putting there, there's no indication that the industry would be moving away from BIOS yet (though GPT will be here sooner than later given the 2TB barrier, thus the work on GPT enabled tools).

  5. #25
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,192

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    On EFI, the "first bootloader" is in the EFI itself. My understanding is that it reads files from the EFI System Partition to determine what to boot. None of this requires any MBR partitions (aside from the MBR's protective partition, which is part of the EFI specification); in fact, creating any MBR partitions aside from the protective partition is a flat-out violation of the specifications. Of course, this refers to standard EFI; Apple's implementation is said to be a bit weird, and their BIOS emulation mode clearly inserts some extra wrinkles. I don't know how rEFIt gets loaded or what its requirements are.

    For general EFI information, you could read the relevant documents. Intel's EFI page includes links to the EFI 1.x specification; and you can find the UEFI 2.x specification here. Apple's EFI implementation is said to be closer to 1.x than to 2.x. I've read parts of both, but mostly I was interested in the GPT information rather than how the system boots.

  6. #26
    Join Date
    Sep 2010
    Beans
    13

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    I am running on an iMac, but I did run into the exact same situation as you. I use the following steps to get rEFIt working - it now either boots me straight into OSX or hands off to grub which takes me into Ubuntu.

    *Lets assume that you already have free space on your hard drive and rEFIt installed and you can boot to the bootcamp loader by holding the option key. Also, read the whole guide first - if you just did an install, deleted the bios partition, and synced the tables in rEFIt you can jump ahead to step 7.

    1. Boot to the lucid live CD/USB (I think you have to use bootcamp's loader on this one).

    2. Use Gparted to delete the partitions from the last install. You may have to turn off the swap partition before it allows you to delete it (right click on the partition, swapoff).

    3. Install to the largest continuous space/ Don't bother with any of the advanced options - grub is installed to to the ext4 partition by default. Just click through and fill out your user info and do the normal install.

    4. DONT CHOOSE THE RESTART OPTION WHEN ITS FINISHED INSTALLING. You have already waited for the Live CD to boot once and you dont need to do it again.

    5. Go back to Gparted. If you are dual booting OSX and went with the default install options the table should show:
    /sda1=EFI,/sda2=NFTS+,/sda3=Bios (I think it has a bios flag on it), /sda4=ext4, /sda5=swap.

    Delete /sda3. I don't know the exact reason why its there, but its going to cause the overlapping partition error in rEFIt if you leave it.

    6. Now you can do a full shutdown. Go to rEFIt and sync the partition tables.

    7. At this point (I think you have already gotten here once..) rEFIt is sync'ed but freezes on the penguin if you try to go straight to Ubuntu. Restart your computer and hold down option to go to the bootcamp loader. Ubuntu should show up as "Windows" on this page - boot it.

    8. You should get to the grub prompt... yay. All you need to do know is let it boot into the GUI and shut down (don't resart or log out). Next time the computer boots to rEFIt click on the penguin and it will take you to grub. Any time you change your partition table you will need to use the bootcamp loader the first time, but from here out it should work.

    Let me know if this gets you going. I tried to figure out the logic of this process in another thread - there has got to be an easier way. I cant see Ubuntu expecting the guy that bought his computer at a place called the "genuis bar" to be able to discern the dynamics of hybrid boot tables (no offense to mac users, I own two).
    Last edited by cath0dez; October 14th, 2010 at 04:53 PM.

  7. #27
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,192

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    Quote Originally Posted by cath0dez View Post
    5. Go back to Gparted. If you are dual booting OSX and went with the default install options the table should show:
    /sda1=EFI,/sda2=NFTS+,/sda3=Bios (I think it has a bios flag on it), /sda4=ext4, /sda5=swap.

    Delete /sda3. I don't know the exact reason why its there, but its going to cause the overlapping partition error in rEFIt if you leave it.
    If I understand you correctly, /dev/sda3 at this point is a BIOS Boot Partition. this is a partition that holds part of the GRUB 2 boot code when booting using GRUB on a BIOS-based computer. As described on the Web page to which I just linked, GRUB 2 is less reliable without it than with it. AFAIK, it's not required when using GRUB on an EFI system; however, as it seems you're using BIOS compatibility mode in this procedure, I'm not sure how GRUB will treat the system -- as EFI or BIOS. If the latter, it's best to leave the BIOS Boot Partition in place, from a GRUB perspective.

    If the presence of that partition is triggering a bug in whatever creates the hybrid MBR, then the best solution is to fix that bug. Of course, that's something that you probably can't do, so as a practical matter for individuals, the best solution is probably to substitute another program when creating the hybrid MBR. I don't know what's creating the hybrid MBR in the procedure you're using, but I do know that the two Linux programs that are often used for this purpose are gptsync and my GPT fdisk (gdisk or sgdisk). I just checked the latest version of GPT fdisk, and it does not create the duplicate 0xEE MBR partition, so it should be safe to use. (Some earlier versions had a hybrid MBR creation bug, but the symptom wasn't quite what I've seen reported rather frequently in these forums of late.)

    FWIW, I've recently ordered a refurbished Intel-based Mac mini, so I'll be able to study all this stuff myself in detail. With any luck I'll be able to come up with a better solution to these installation problems than are currently being used.

  8. #28
    Join Date
    Sep 2010
    Beans
    13

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    I have no idea how grub is treating it. This was really a trial and error process to get to these steps - they were the only way I could get hitch free, fast boots into both OS X and Ubuntu and not have to worry about the option/alt bootloader.

    It seems like a pretty safe method so far for me. I ended up shrinking my OSX partition and putting an ex4 partition before my original ex4 partion (it takes up the /sda3 label vacated by the bios) - the same procesess I used for the install worked to get this setup running fast.

  9. #29
    Join Date
    Oct 2010
    Beans
    25

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    Quote Originally Posted by srs5694 View Post
    None of this requires any MBR partitions (aside from the MBR's protective partition, which is part of the EFI specification); in fact, creating any MBR partitions aside from the protective partition is a flat-out violation of the specifications. Of course, this refers to standard EFI; Apple's implementation is said to be a bit weird, and their BIOS emulation mode clearly inserts some extra wrinkles.
    Well, like I mentioned, the hybrid MBR concept comes straight from Apple's Bootcamp. Before Bootcamp, there was no BIOS emulation whatsoever in Mac EFIs, so it seems pretty logical that it uses the hybrid to infer that the machine has been configured for Windows and thus requires acting like a BIOS.

  10. #30
    Join Date
    Oct 2010
    Beans
    25

    Re: Ubuntu on MacBookPro - difficulties w partition tables

    Quote Originally Posted by cath0dez View Post
    Any time you change your partition table you will need to use the bootcamp loader the first time, but from here out it should work.
    It's wonderful how computers are logical machines and you can just deduct why they do what they do.

    </sarcasm>

    What on earth is the Apple EFI doing when it loads a legacy os... it shouldn't _modify_ any data on hard drives, should it? Can you compare your GPT and MBR after and before booting with EFI? And maybe also the MBR bootloader data (the first 440 bytes)?

    Did you mean changing the partitions in Linux, OSX or both?

Page 3 of 5 FirstFirst 12345 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •