Jump to content

How to create GPT/MBR hybrid disk without format?


lemonsat
 Share

11 posts in this topic

Recommended Posts

Hi everyone,

 

I would like to make a triple boot (7 - Ubuntu - Snow Leopard) on a HP Pavillion DV6-1210SL, wich I've buoght this week. It cames with vista preinstalled.

 

I would like to create an hybrid GPT/MBR partition table resizing without reformatting the windows partition. Is this possible? Can Disk Utility make this? Or what software can make this for me?

 

Thanks!!

 

Leo

Link to comment
Share on other sites

Yes, it's possible, but with some important caveats. Most importantly, Windows is fussy about its boot partition. Sometimes you can get away with resizing it with third-party utilities, but other times Windows refuses to boot after you've finished and you'll need to repair it or even re-install from scratch. I recommend dealing with that re-install, if necessary, before you proceed to installing Linux or OS X.

 

As to how to do it, you'll need to do three things:

 

  1. Resize your Windows partition. Quite a few tools will do this, such as the commercial Partition Magic or the open source GNU Parted. Try doing a Web search or ask for advice if you've never done this sort of thing.
  2. Convert your disk from MBR to GPT format. I know of three utilities that will do this: My own GPT fdisk under Linux, FreeBSD, or Mac OS X; the standard "gpt" utility of FreeBSD; and the Windows gptgen (which is also supposed to compile under Linux, but didn't for me).
  3. Create a hybrid MBR from your now-GPT disk. My GPT fdisk will do this, as will a tool called gptsync (I know of no central URL for it, but Googling should turn up some download links).

 

If you do these three tasks in this order, there's a good chance that Windows will be rendered unbootable, so you may need to repair it at this point. Alternatively, you could plan on doing a clean re-install: Create a fresh GPT setup, hybridize it, and install Windows to its new partition.

 

Note that it may be tricky to get all the tools you need to do all this working before you install Linux. Parted Magic is a useful tool for this; it provides a Linux boot environment with several useful utilities, including my GPT fdisk, so you can muck with your GPT configuration before installing Linux.

 

Another alternative is to install Linux before you convert to GPT form. Linux will survive such a conversion, but you'll need to re-install your boot loader, and you may need to adjust your /etc/fstab file. The advantage to doing this is that some Linux installers don't cope well with GPT, although once installed and converted you should be fine. I don't know offhand how Ubuntu deals with GPT disks.

Link to comment
Share on other sites

Just to be sure...

 

After I've resize the windows partition, and deleted the HP recovery partition, how many partition have I to create?

 

1 Windows

2 Mac OSX

3 EFI partition

4 Data partition (NTFS)

5 Linux partitions (HOW MANY??)

 

I don't know how many partition create for for Linux,or Linux itself divide one partition to its needs?

Link to comment
Share on other sites

Linux can use anywhere from one partition to a dozen or more. If you're new to Linux, I recommend three partitions for Linux:

 

  • The root partition (/) of 15-50GB (this holds the OS itself)
  • A /home partition of whatever size you think you need (user files go here)
  • A swap partition of 1.5-2x your RAM size

 

You can add to that if you like. For instance, you can split off /usr, /usr/local, /var, /tmp, /opt, and others. Getting their sizes right can be tricky if you're not already experienced, though, and if you get the sizes wrong, it'll be a pain to resize them. That's why I recommend just three Linux partitions for new Linux users/administrators. In fact, going down to two (root and swap) can help if you're tight on space, but the advantage of having /home in its own partition is that you can then wipe out the OS and upgrade it without worrying about your data files. IMHO, this is worth the space inefficiency of having the extra partition.

 

I'd also add one more multi-OS partition: Create a small BIOS Boot Partition (perhaps 100-200KB). This will hold the second stage of some boot loaders, such as GRUB2. Most boot loaders don't require it, but some benefit from it today, and it may be required in the future. See this page for a bit more information on it. Note that it won't hold a filesystem, just a "raw" boot loader binary, so there's no need to format it or create a mount point for it.

 

Of the partitions you and I have mentioned, only Windows and the shared data partition need to have hybrid MBR entries. I recommend putting those at the end of the disk. That way, the 0xEE (EFI GPT protective partition) will cover the area used by your GPT-only partitions, reducing the risk of an errant GPT-unaware disk utility damaging them.

Link to comment
Share on other sites

After a long time, I have a triple boot ready! Only Mac Osx don't boot, bau this is another story....

 

I have a new problem:

 

I have this partiton table:

 

1 EFI

2 Windows

3 MacOsx

4 Ubuntu root

5 Ubuntu home

6 Shared data

7 Ubuntu swap

 

Hybrid with partitions 1 2 3 4 in MBR record

 

Ubuntu and Osx (I think) can see every partition.

 

Windows 7 can't see the shared data partition...

If I set 1 2 3 6 partition in MBR, ubuntu doesn't boot

 

I would like to put partitions 2 3 4 6 in mbr record, but I don't know how to do it, your software allow to choose only 3 partitions...

 

Thanks

Link to comment
Share on other sites

I'm glad to hear you got it working!

 

I strongly suspect you slightly misinterpreted your original "4-partition" hybrid MBR configurations. I suspect that you saw the type-0xEE "EFI GPT" partition and believed it was the MBR equivalent of your EFI System partition in the GPT scheme. The two aren't equivalent. The MBR type-0xEE partition is a protective partition that, in a standard GPT setup, covers the whole disk as a way of protecting it from damage by GPT-unaware utilities. It's not really a partition at all, in the sense that you'd never be able to mount it as a filesystem, use it as swap space, etc. The EFI System partition in the GPT scheme, OTOH, starts and ends at different points than the MBR 0xEE partition, and the EFI System partition normally does contain a real filesystem. (Intel specifies a FAT-32 variant, but at least one OSx86 utility puts HFS+ on it.) I can see how the two partition types could be easily confused; they've got similar names, and in your initial configurations, they'd be almost the same in size and position.

 

In theory, Ubuntu shouldn't need to be in the MBR, although depending on several configuration details, it might work better if it is. If Ubuntu fails to load when you remove its root (/) partition from the MBR, my suspicion is that this is a boot loader failure -- either a failure of GRUB or a failure of whatever you're using as your primary (MBR-based) boot loader (the two could be one and the same, or you might be using an OSx86 boot loader in the MBR). You'd need to experiment to be sure, but it's probably not worth it at this point. ("If it ain't broke, don't fix it.")

 

One additional comment, which you might want to consider for future installations: Your partition placements aren't optimal. For best performance, you should arrange your partitions such that disk head movements are minimized when any one OS is in use. That means, among other things, placing the Linux swap partition somewhere near the center of the Linux partitions (or perhaps between the Linux and shared partitions, if you expect to make heavy use of the shared partition in Linux) and placing any shared partitions in-between the main partitions for your most commonly-used OSes. I doubt if the improvement in performance from such a configuration would justify investing the time necessary to move your current partitions or to re-partition and re-install even one OS, though. That said, if I were to set up a system with the partitions you've got, I'd do it like this:

 

1 BIOS Boot Partition

2 EFI System

3 MacOsx

4 Ubuntu home

5 Ubuntu swap

6 Ubuntu root

7 Shared data

8 Windows

 

Note that I've added a BIOS Boot Partition, as I described in an earlier post. This configuration also enables you to put all your hybrid MBR partitions at the end of the disk, which lets the EFI GPT partition protect all of the GPT-only partitions, which adds a bit of safety to the setup. Alternatively, you could put the shared data partition between the OS X and Linux partitions, or move the OS X partition to between the Ubuntu and shared data partitions, depending on which OSes you expect to use most.

Link to comment
Share on other sites

  • 1 year later...
I'm glad to hear you got it working!

 

I strongly suspect you slightly misinterpreted your original "4-partition" hybrid MBR configurations. I suspect that you saw the type-0xEE "EFI GPT" partition and believed it was the MBR equivalent of your EFI System partition in the GPT scheme. The two aren't equivalent. The MBR type-0xEE partition is a protective partition that, in a standard GPT setup, covers the whole disk as a way of protecting it from damage by GPT-unaware utilities. It's not really a partition at all, in the sense that you'd never be able to mount it as a filesystem, use it as swap space, etc. The EFI System partition in the GPT scheme, OTOH, starts and ends at different points than the MBR 0xEE partition, and the EFI System partition normally does contain a real filesystem. (Intel specifies a FAT-32 variant, but at least one OSx86 utility puts HFS+ on it.) I can see how the two partition types could be easily confused; they've got similar names, and in your initial configurations, they'd be almost the same in size and position.

 

In theory, Ubuntu shouldn't need to be in the MBR, although depending on several configuration details, it might work better if it is. If Ubuntu fails to load when you remove its root (/) partition from the MBR, my suspicion is that this is a boot loader failure -- either a failure of GRUB or a failure of whatever you're using as your primary (MBR-based) boot loader (the two could be one and the same, or you might be using an OSx86 boot loader in the MBR). You'd need to experiment to be sure, but it's probably not worth it at this point. ("If it ain't broke, don't fix it.")

 

One additional comment, which you might want to consider for future installations: Your partition placements aren't optimal. For best performance, you should arrange your partitions such that disk head movements are minimized when any one OS is in use. That means, among other things, placing the Linux swap partition somewhere near the center of the Linux partitions (or perhaps between the Linux and shared partitions, if you expect to make heavy use of the shared partition in Linux) and placing any shared partitions in-between the main partitions for your most commonly-used OSes. I doubt if the improvement in performance from such a configuration would justify investing the time necessary to move your current partitions or to re-partition and re-install even one OS, though. That said, if I were to set up a system with the partitions you've got, I'd do it like this:

 

1 BIOS Boot Partition

2 EFI System

3 MacOsx

4 Ubuntu home

5 Ubuntu swap

6 Ubuntu root

7 Shared data

8 Windows

 

Note that I've added a BIOS Boot Partition, as I described in an earlier post. This configuration also enables you to put all your hybrid MBR partitions at the end of the disk, which lets the EFI GPT partition protect all of the GPT-only partitions, which adds a bit of safety to the setup. Alternatively, you could put the shared data partition between the OS X and Linux partitions, or move the OS X partition to between the Ubuntu and shared data partitions, depending on which OSes you expect to use most.

 

 

Im a little confused, just to confirm, because i want to format my drive as follows: GPT/MBR

 

See questions in ()'s

 

1 BIOS Boot Partition (how do you create this? is there a partition code type called "EF02"?)

 

EDIT: I found a post:

Download the magicparted CD. (The Sourceforge downloads page (http://sourceforge.net/projects/gptfdisk/files)

 

 

2 EFI System (isnt this created automatically when you format a GPT/GUID hard drive?)

3 MacOsx

4 Ubuntu home ((Partition code 0700?)

5 Ubuntu swap

6 Ubuntu root (Partition code 0700?)

7 Shared data (Partition code 0700?)

8 Windows ((Partition code 0700?)

 

Setting up your partitions like this does not allow XP to see the two MBR/Hybrid partitions at the end. The MBRs have to be in the first 3 i think.

 

some feel free to chime in.

Link to comment
Share on other sites

  • 6 years later...

This is an old thread but in case someone is having similar questions:

 

To respond to romefolks comment regarding Rod's last post:

 

"Setting up your partitions like this does not allow XP to see the two MBR/Hybrid partitions at the end. The MBRs have to be in the first 3 i think."

 

 

That is true if you create the hybrid MBR partitions with OS X Disk Utility. That's one of its limitations.

 

But not if you use Rod's gdisk utility. It lets you choose which partitions you want to hybridize, regardless of their position.

 

You can still partition the disk with Disk Utility but leave all partitions as HFS+. Then you use Rod's gdisk to hybridize the last two

 

and you answer yes to:

 

Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N)

 

That way, as Rod mentions, with the hybrid MBR partitions at the end of the disk, the protective MBR partition will protect all the GPT partitions that precede your MBR partitions, which is what it is designed to do in the first place. And as far as Windows is concerned, all those GPT partitions will be seen as one single MBR partition, out of the 4 partitions MBR allows.

 

Then you could use Disk Utility to convert the last two partitions to MS-DOS (FAT) but you don't have to. The Windows installation will have no problem formatting to NTFS the HFS+ partition you hybridized for it and you can also use the Windows installation disk (via the recovery console) to format the Data partition to NTFS, without messing up your hybrid setup (the same cannot be said for GParted).

 

- As a note, I would wait until after Windows XP has been installed to convert the Data partition from HFS+ to NTFS, otherwise the Windows XP installation will get confused between the two partitions.

Link to comment
Share on other sites

 Share

×
×
  • Create New...