I could have sworn I'd seen something like this in some hybrid ISO images (the sort used for Linux distributions so that they can be burned to a CD-R or written to a USB flash drive without post-processing); however, I just checked a few and they don't seem to be doing this. Maybe I'm not remembering correctly, or maybe I've just not checked the right ones. I also don't see anything about this in the isohybrid
man page -- but I'm not sure this is what's most commonly used to create these images. Still, you might want to follow this lead further than I did....
FWIW, I'm the author of GPT fdisk. It's been quite a while since I've had to touch the relevant code, but a quick review suggests that GPT fdisk should read a disk in which the primary partition table does not begin at LBA 2; however, GPT fdisk does not support changing this location, and I can't promise it would save the table back at the original location even if it could successfully read such a disk. You might be able to hack it to start that table elsewhere for experimentation purposes. In fact, I just gave that a try, but there are a number of places in the code that use hard-coded "1" or "2" values to populate the LBA values, and I didn't find them all in my initial attempt, so I ended up writing the header into the middle of the partition table, which of course was not pretty. If you want to try, look at the gpt.cc
file. Start by looking for where partitionEntriesLBA
and firstUsableLBA
are set -- but some of the relevant constants are in function calls, too.
As to the location of the primary GPT header, I doubt if you could change that. The protective MBR isn't really part of the GPT data structures per se; its purpose is to identify the disk as a GPT disk and to keep GPT-unaware tools from mucking with the disk, not to identify where GPT data structures begin. The StartingLBA
field there exists because it's part of the MBR data structure, not because GPT uses it for anything. I suppose it's possible that some tools might use the start point of the MBR protective partition as a pointer to the primary header, but I doubt if a majority would do that. Certainly GPT fdisk doesn't; it hard-codes LBA 1 as the location of the primary header.
If you have more questions about this, you might want to post on the edk2-devel mailing list. Lots of EFI developers hang out there, and it's possible that some of them know of precedents for what you're trying to do, or know of alternative ways to accomplish your goal.