sys-apps/util-linux-2.24.1-r3 has gone stable, and this new version's fdisk supports GPT natively. This is great news! BUT it means that the instructions in section 4.a. code listing 1.1 don't work as expected. "fdisk /dev/sda" will actually read/modify the real GPT label now, it won't read the protective MBR. This needs to be changed to "fdisk -t dos /dev/sda" to force it to look at the MBR, *then* you can set the bootable flag as instructed. Alternatively, if we want to document the parted method (seems like we're preferring parted these days?), that would be: # parted /dev/sda (parted) disk_set pmbr_boot on Let me know if any more info is needed, thanks!
The other way to set this flag for GPT with fdisk is: # fdisk /dev/sda x (extra functionality / expert mode) A (toggle the legacy BIOS bootable flag) w (write/quit) #
Thanks. I've updated the fdisk instructions accordingly. I'm not certain about the parted "disk_set pmbr_boot on", is this the same as toggling the boot flag as through fdisk? If so, is this the fix for bug #507454? Also, if fdisk uses GPT now, what is the result of the "a" option in it then? Does that still set the bootable flag as documented?
Sven, I'm doing a new gentoo installation today and hit the issue on this cause the disk I'm trying to partition is 3Tb. The thing is, you say in the handbook about fdisk + GPT, however, if someone does "fdisk /dev/sda", the default disklabel will be DOS. You have to explicitly add "-t gpt" and I'm still doing the partitioning so don't know how/if it works. Will tell you more later. <snip> (chroot) rescue portage # fdisk -l /dev/sdb Disk /dev/sdb: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes (chroot) rescue portage # fdisk -t dos /dev/sda Welcome to fdisk (util-linux 2.25.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. The size of this disk is 2.7 TiB (3000592982016 bytes). DOS partition table format can not be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT). Created a new DOS disklabel with disk identifier 0xae470aa9. Command (m for help): quit (chroot) rescue portage # fdisk -t gpt /dev/sda Welcome to fdisk (util-linux 2.25.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Command (m for help): </snip>
See also the default behaviour: <snip> (chroot) rescue portage # fdisk /dev/sda Welcome to fdisk (util-linux 2.25.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. The size of this disk is 2.7 TiB (3000592982016 bytes). DOS partition table format can not be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT). Created a new DOS disklabel with disk identifier 0xd5642529. Command (m for help): quit (chroot) rescue portage # </snip>
Also, this is what happens on me, when I try to creat a GPT partitioning schema using the stable util-linux's fdisk: <snip> (chroot) rescue util-linux # fdisk /dev/sdb Welcome to fdisk (util-linux 2.24.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. The size of this disk is 2.7 TiB (3000592982016 bytes). DOS partition table format can not be used on drives for volumes larger than (2199023255040 bytes) for 512-byte sectors. Use GUID partition table format (GPT). Created a new DOS disklabel with disk identifier 0x096c885c. Command (m for help): quit (chroot) rescue util-linux # fdisk -t gpt /dev/sda Welcome to fdisk (util-linux 2.24.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Command (m for help): n fdisk: /var/tmp/portage/sys-apps/util-linux-2.24.1-r3/work/util-linux-2.24.1/libfdisk/src/label.c:163: fdisk_add_partition: Assertion `cxt->label' failed. Aborted (chroot) rescue util-linux # </snip>
Thanks a lot for testing this out. I've updated the instructions so that we recommend fdisk for MBR and parted for GPT (again), and added in a note that although fdisk should support GPT it has shown to still have some issues with it. I also included its default behavior of using MBR as layout, but with a note to watch its output just in case future fdisk versions change this behavior.
Ok, keeping parted for GPT and fdisk for msdos in the instructions, so I think this bug can then be closed.