Can you please tell me how to create a hybrid MBR/GPT partition on the USB drive? I need the MBR for the boot as my BIOS doesn't boot GPT partitions.
Windows – How to create hybrid MBR/GPT partition on USB drive
gptmbrpartitioningusbwindows
Related Solutions
I know its old news but if anyone else needs a hand regarding removing the Hybrid MBR, you could try gdisk
utility.
I was attempting to install Windows 8.1 on my MBP 2011 8,3 using the EFI method last night and the EFI installer would complain at the partitioning step that Windows couldnt be installed onto the partition I wanted as it could see the MBR partitions of the Hybrid MBR/GPT. Windows 8 doesnt try to look for a GPT partition once it finds an MBR one and so as you suggest, it can be removed which will hopefully make the Bitlocker tool happy as well.
This Stack Overflow question advises how to remove the Hybrid MBR. I'll quote the relevant bits from that answer here which is what I did last night to get around Windows 8.1 installer complaining about the hybrid MBR/GPT. Full kudos to Rod Smith for his excellent tool, website and and post.
The solution in this case is to clear the hybrid MBR data. A number of utilities can do this. I'll describe how to do it with my own GPT fdisk (
gdisk
) utility:
- Download GPT fdisk from its Sourceforge page and install it. (Versions are available for Linux, OS X, and Windows. I'll assume you'll do this from OS X.)
- Launch
gdisk
on your disk by typingsudo gdisk /dev/disk1
in a Terminal window. (Change the device identifier if it's not as you presented earlier or if you use another OS for the job.)- Type
p
to view the partition table to verify you're working on the correct disk. If not, typeq
to quit without saving your changes and try again with another device.- Type
x
to enter the experts' menu.- Type
n
to create a fresh protective MBR. Note thatgdisk
won't confirm a change; it'll just show you a new experts' prompt.- Type
w
to save your changes. You'll be asked to confirm this action. Do so.
Some other resources on the gdisk page
- Repairing GPT Disks: http://www.rodsbooks.com/gdisk/hybrid.html
As you request a clear illustration of how to do it, here it is. I assume you have your live Linux booted.
Partition the USB thumb drive
I recommend the command line tool
gdisk
. It produces very clean results. Alternatively, you can usegparted
.Create a new partiton table. Use GPT with a protective MBR.
Define these partitions:
- (optional) A data partition
- A Linux partition
- A legacy BIOS boot partition (1MB is enough)
- A EFI System partition (at least 32MB)
Example: On my 64GB thumb drive, the result looks like this:
Number Start (sector) End (sector) Size Code Name 1 2048 107632639 51.3 GiB 0700 DATA 2 107632640 124411903 8.0 GiB 8300 Linux filesystem 3 124411904 124413951 1024.0 KiB EF02 BIOS boot partition 4 124413952 124822453 199.5 MiB EF00 EFI System
Install Linux to the USB thumb drive using any method.
During the process, format the Linux partition with a filesystem of your choice, preferably
ext4
. Use this partition as root/
.
Format the EFI System partition with FAT16.
The BIOS boot partition remains unformatted.Install GRUB twice
In a final step, install GRUB for both boot methods, UEFI style booting and legacy BIOS booting.
grub-install --target=x86_64-efi --removable /dev/sdx grub-install --target=i386-pc /dev/sdx
Where
/dev/sdx
is your USB thumb drive, obviously.
That--removable
is important. Took me three hours to realize I need it on a removable USB thumb drive...If you install GRUB to the thumb drive from the "outside" (not having booted the Linux from the USB thumb drive), you need to mount the Linux partition first. Maybe you mount it into
/mnt
. Then you mount the EFI System partition into the Linux partitions/mnt/boot/efi
directory. Use--root=/mnt
as parameter forgrub-install
. Only thengrub-install
finds all necessary directories.
Done.
For further reading:
We did not really define partitions in the MBR. So you may ask, why it does work on legacy BIOS machines. Keep in mind, we installed GRUB into the MBR. During the legacy BIOS boot process, the bootloader stored in the MBR is executed. This loads stage 1 of GRUB, which then proceeds to load stage 2 from the legacy BIOS boot partition. But at this time, GRUB does not actually know anything about partitions MBR or otherwise. For this reason, the information about the position of the BIOS boot partition has been embedded into GRUB stage 1. Consequently, if the BIOS boot partition is moved, you need to reinstall GRUB. After GRUB stage 2 is loaded, GRUB understands GPT and can continue with booting the Linux kernel.
Best Answer
A standard BIOS doesn't really care about the partition table; the BIOS just reads the first sector of the hard disk and executes the code it finds there. That said, some implementations do more than this, and may refuse to boot from GPT disks. These are typically actually EFIs, which may use clues in the partition table to determine the boot mode. My Web page on the topic describes the problem, and workarounds, in more detail. Most commonly, setting the boot/active flag on the 0xEE partition in the MBR (using a GPT-unaware partitioning tool) often works around the problem.
If you're trying to boot Windows using the USB flash drive, be aware that it will see the MBR side of any disk that uses a hybrid MBR; thus, creating a hybrid MBR is pretty pointless -- you might as well just create a regular MBR disk and save yourself the hassles and risks of a hybrid MBR. For that matter, the advantages of GPT are modest except on disks larger than 2TiB, so even with other OSes, using a straight-up MBR on the disk might make more sense than using GPT. Alternatively, if the computer(s) on which you want to boot the disk use EFI, you might consider using an EFI boot loader.
All that said, if you insist on using a hybrid MBR, my GPT fdisk (
gdisk
) can do the trick.