Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

TL:DR

I have Mac, which means I have EFI and a GPT formatted disk with a hybrid MBR. I am considering adding a fifth partition; to do this, I will mask my first three GPT partitions with one partition in my protective and hybrid MBR.

However, if, say, I fire up an operating system after these (say, on my fourth I have Linux), will I be able to mount filesystems from inside the protective MBR? I.e., can an OS like Linux that has been booted from a legacy MBR view GPT partitions, or does it rely on the MBR to tell it what partitions exist?

Does mount rely on MBR, or will it find (my) GPT disks?


Full / Old Question

I have a hybrid MBR of 4 partitions on my Mac.

1. EFI System Partition
2. Mac OS X
3. Mac Recovery Partition
4. Ubuntu

Now, I want to add Archlinux to the end, i.e., append 5. Archlinux, but I would also like to maintain a reasonable MBR (because an MBR can only have four records).

My idea is to create a MBR partition that covers both partitions 1 and 2, or 2 and 3, or 1-3, thus making the MBR think that there is one partition, and nothing will touch it (this is typical of GPT disks, which have a protective MBR which covers all the GPT partitions with one legacy MBR partition for safety reasons).

My question is: Does Ubuntu use the MBR to mount filesystems? If I do create my nice protective partition, will I no longer be able to mount my Mac OS X filesystem in Ubuntu, assuming Ubuntu is installed using the legacy MBR method, and not the GPT / EFI boot Ubuntu.*

*Or maybe EFI compatibility in Ubuntu is better now?

share|improve this question
    
Should this be moved to AskUbuntu? –  kalaracey Mar 5 '13 at 3:13
1  
I can't fully answer your question, but mount itself would not rely on the MBR. I know this as it is possible to mount loopback images and entire block devices, so presumably its more a question of what will your kernel recognise. –  davidgo Mar 5 '13 at 4:17
    
@davidgo Oooh. That's a good point... So I should look at how the kernel detects partitions / devices. Thanks. –  kalaracey Mar 5 '13 at 12:07
    
@davidgo Alright, but I think that maybe how the kernel detects partitions might depend on the MBR, and then mount will depend on the kernel to tell it what's there. –  kalaracey Mar 6 '13 at 13:17
add comment

1 Answer

The answer is OS-dependent. It's not really mount per se that uses GPT or MBR; it's the OS kernel. OS X's kernel depends on the GPT data in preference to the MBR data, so it reads hybrid MBR disks as GPT disks. The same is true of the Linux kernel if that kernel includes GPT support, as most binary kernels distributed by major distributions do. If you build your own kernel and omit GPT support, though, it will ignore the GPT partitions and use the MBR partitions instead.

Windows ignores the GPT data if it sees a hybrid MBR. That's what makes hybrid MBRs useful (albeit ugly and dangerous): Windows sees a hybrid MBR disk as an MBR disk, which means it will install to the disk when booted in BIOS mode, whereas Windows will not install to a GPT disk when booted in BIOS mode.

FreeBSD works in a third way: It presents both sets of partitions using different device nodes. GRUB 2 does something similar; you can specify which table to use by preceding the partition number with a code, as in (hd0,gpt3) to use the third GPT partition on the first disk.

One more point: Because of the dangers of hybrid MBRs, if you're dual-booting between OS X and Linux but not booting Windows, it's best to convert your hybrid MBR to a standard protective MBR. Given the Mac's architecture, though, this will require you to boot Linux in EFI mode. This works fine on most Macs, but there are problems with hardware detection on some models. Thus, you may want to install an EFI-capable boot loader to test your ability to boot and use Linux in EFI mode before you convert your hybrid MBR to a protective MBR. You can read more about EFI boot loaders for Linux here. You can convert a hybrid MBR to a conventional protective MBR by using GPT fdisk (gdisk); type x to enter the experts' menu, type n to create a new protective MBR, and then type w to save your changes.

share|improve this answer
    
Wow... the great Rod Smith of rEFIt and GPT Fdisk fame has answered my questions! Thank you very much, for both the answer and the software you've put out. –  kalaracey Mar 13 '13 at 12:57
    
"this will require you to boot Linux in EFI mode... problems with hardware detection..." Yes, I have been worried about hardware issues. I am going to install linux on another partition to test soon. One thing: if I installed Linux with the bootloader (Grub) on the same partition as the OS, and that gets found by rEFInd, will that still be affected by the MBR? I.e. would Grub use the MBR for partition/disk information, even though it is not located there? –  kalaracey Mar 13 '13 at 13:00
    
AFAIK, GRUB's partition-detection logic is not dependent on where it's stored. –  Rod Smith Mar 13 '13 at 17:15
    
Does Grub's partition-detection logic depend on the contents of the MBR? Actually, I don't think it really matters that much, as long as it can detect Ubuntu, which is on the same partition as it (Grub) is installed. I would like to convert my MBR to a protective MBR, but I would still like to be able to boot Ubuntu. I am not yet prepared to get Ubuntu booting with EFIstub or Grub EFI. –  kalaracey Mar 13 '13 at 20:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.