How can I read a GUID Partition Table (GPT) and its entries?
To read the MBR partition table, we use an offset 0x1be
, similarly, which is the offset to read T (possibly) GP (artition) records (that is, the number of partitions and their sizes).
I am writing a C program using "gdisk" to create partitions, I need to write filesystems to those partitions. So for this I need to read the GPT header to get the number of partitions and their allocated sizes.
+3
source to share