I would like to add an empty partition of type 0x00 to the beginning of the protective MBR of a GPT-formatted disk. I've found a way to do this, but the method relies on fdisk enhancements not present in Linux versions (specifically, the -p/-f
options available on fdisk on FreeBSD but not Linux). I've also found a way to add an empty partition after the first partition.
My protective MBR currently has one entry of type 0xEE. I would like to make this the second entry in the partition table and to add an empty entry of type 0x00 in front of it, without disturbing the GPT partition table or any of the GPT partitions on the disk. How can this be accomplished? The protective MBR can be edited with fdisk -t dos <device>
, but fdisk
refuses to add partitions because there are no free sectors available. And I'm unsure whether deleting the protective MBR partition and remaking two new partitions will affect the GPT partitions on the disk.
sfdisk
can do something similar to what the BSD version can do... cyberciti.biz/faq/…--dump
and--backup
options ofsfdisk
look promising. @oldfred: No, I'm trying to work around a badly written UEFI+BIOS that refuses to boot from GPT disks.sfdisk
checks whether the sectors are valid and refuses to write a table with invalid values, as must be the case for the desired partition table. Partial output ofsfdisk --label-nested dos /dev/sdb < pmbr.dump
: ">>> Script header accepted.\n [...] Created a new DOS disklabel with disk identifier 0x00000000.\n /dev/sdb1: Created a new partition 1 of type 'Empty' and of size 2 TiB.\n /dev/sdb2: Start sector 1 out of range.\n Failed to add #2 partition: Numerical result out of range.\n Leaving."-f/--force
it?