Is there a tool on Ubuntu Lucid which can dump the GPT (GUID partition table) of a block device in a human-readable form? The most important information I'm interested in is the byte offset of each partition.
parted should be able to
gdisk gives its offsets in sectors, you'd multiply sectors by Logical Sector Size to figure out # of bytes.
If you are asking that you probably want to read this: http://www.rodsbooks.com/gdisk/repairing.html
To dump raw bytes :
xxd /dev/sdx | more
sdx with your gpt device character
more is used to prevent data flowing without control on terminal.
happy hacking :)
Thank you for trying to help. The output of this command doesn't contain the byte offset of each paritition (directly), which was specified as a requirement in the question.– ptsApr 26, 2021 at 13:52
I used the answers to https://unix.stackexchange.com/q/154076 as inspiration.
sudo fdisk -l,
sudo gdisk -l DEVICE and
sudo parted -l dump the partition table of
DEVICE or all block devices, and all of them support (and autodetect) MBR and GPT. However, they don't display the byte offsets directly. They do display the unit (logical sector size) they use though, which is 512 bytes by default.