:: Re: [DNG] Migrating advice - what n…
Top Page
Delete this message
Reply to this message
Author: Antoine
Date:  
To: dng
Subject: Re: [DNG] Migrating advice - what not to overwrite
On Wednesday, 8 October at 15:44, Didier Kryn wrote:
>
>    Is the bigger part of Grub stored into a non-formatted partition,
>or a free space of the device (some space which is not allocated by
>the partition table)?
>
>    As I could read on the Internet, if you have a DOS-type, also
>called MBR, partition table, you need to preserve free space before the
>first partition,


Indeed. On an MBR-partitioned disk with "grub legacy", you need a bit of
reserved space (the "MBR gap") before your first partition. This is
where you have a "stage 1_5" image which allows grub to read a
filesystem (there are therefore several such images, one for each type
of filesystem).

>which is what I've done since the advent of Grub2, but if you use a GNU
>Partition Table, you need a Grub-dedicated non-formatted partition.


This is also true (except that it's called a GUID Partition Table, I
believe).

There's a bit of a catch, though.
It's possible to have a GPT-partitioned disk on a BIOS computer or on a
UEFI computer.

On a UEFI computer, the EFI firmware boots into the partition flagged
"boot" (or maybe "esp"? I'm not entirely sure about this).
The GPT format also works on BIOS computers since it has a "protective"
BIOS table which makes it look enough like an MBR-formatted disk that
the BIOS is fooled, at least long enough for bootup. This means a
GPT-disk can have grub 2 installed on it as if it were an MBR-disk and
boot from BIOS. In this case, grub 2 doesn't use the MBR gap. Instead it
uses that unformatted partition (to prevent overwriting).

I have less experience with UEFI computers, so I invite anyone who knows
more to pitch in.

>However I don't know how the last is possible, because my little
>experience with GPT is that you need parted to crate it and parted
>automatically formats all the partitions.


I just checked my copy of parted and I was able to create an unformatted
partition, simply by not giving it a filesystem type.

>Is there a specific Grub partition type?


There is, on GPT disks. It's defined by the "bios_grub" flag.

>    Does anyone have a comprehensive explanation?


That's aboout all I know on the subject. Does anyone else know more ?

- Antoine

--
When in doubt, add accelerant
- Mythbusters