Gentoo Archives: gentoo-user

From: Andy Laursen <lists@×××××××××.cc>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Mac Mini with Grub booting Mac OSX and Windows?!
Date: Wed, 29 May 2013 17:18:57
Message-Id: 1369847926.11855.140661237231717.1958A0BA@webmail.messagingengine.com
In Reply to: Re: [gentoo-user] Mac Mini with Grub booting Mac OSX and Windows?! by Andrea Conti
1 On Wed, May 29, 2013, at 04:25 AM, Andrea Conti wrote:
2 > >> We can't have more then 4 primary partitions on a hard disk.
3 > >>
4 > >> Gentoo needs 2 partitions, /boot and a Virtual partition (that count's
5 > >> as well as one primary) with all the other folders.
6 > >>
7 > >> Windows will create 2. and Mac OSX minimum 1, am I right?!
8 > >>
9 > >
10 > > Your Windows partitions have to be in the first four, but OSX and linux
11 > > partitions can be anywhere thanks to the gpt partition table.
12 >
13 > Things are both simpler and more complex than that.
14 >
15 > The real problem is that while rEFIt/rEFInd, OSX and Linux have no
16 > problem dealing with a GPT partition table, Windows only supports MBR.
17 > (Windows 7+ supports GPT partition tables but it can only boot from a
18 > GPT disk in EFI mode. On a Mac OSes other than OSX must be booted in
19 > BIOS emulation mode, therefore the requirement for MBR on the system
20 > disk for Windows still stands).
21 >
22 > GPT and MBR, however, are only indexing schemes: they describe how many
23 > partitions are on a disk and their location, but apart from providing a
24 > high level 'type' label they have nothing to do with what's inside a
25 > partition.
26 >
27 > GPT-partitioned disks traditionallly have what's called a 'protective
28 > MBR', i.e. a dummy MBR which defines a single partition of type 0xEE
29 > spanning the whole disk; this is intended to keep partitioning tools
30 > that are not GPT-aware from considering the disk uninitialized and
31 > inadvertently destroying its contents.
32 > However, nothing prevents you from adding to the protective MBR regular
33 > entries for some of the partitions, and have the disk look like a
34 > 'normal' MBR disk as far as those partitions are concerned.
35 >
36 > The result is called a 'hybrid MBR' and it's the main trick behind Boot
37 > Camp. There is really nothing special about booting (or installing)
38 > Windows on a Mac: it just works, as long as you have both a properly set
39 > up hybrid MBR with an entry for the Windows partition and a suitable EFI
40 > boot manager.
41 >
42 > The former can be done with a tool such as gpt-fdisk (you can easily
43 > find a binary package for OSX, and there are directions for dealing with
44 > hybrid MBRs on the author's site); rEFInd is your best option for the
45 > latter. The standard Apple boot manager will also do, if you only need
46 > to boot OSX and Windows.
47 >
48 > Booting Linux works in a similar fashion. You don't even need a
49 > GPT-aware bootloader: good old GRUB 1 is perfectly up to the task, as
50 > long as there is an entry for its boot partition in the hybrid MBR. Then
51 > you can load a kernel with GPT support, and from there it's just a
52 > standard multiboot setup.
53 >
54 > HTH,
55 > andrea
56
57 Thanks Andrea. I had though that the MBR was automatically mapped to
58 the the first 4 gpt partitions because that's they way it's always been
59 on my system. So now I wonder how it's been set that way, because I
60 know i've never touched gpt-fdisk and I didn't use bootcamp. Maybe the
61 refit installer.

Replies

Subject Author
Re: [gentoo-user] Mac Mini with Grub booting Mac OSX and Windows?! Andrea Conti <alyf@××××.net>