[answered] A question on GPT and Filesystem Detection
Posted: Sun Jan 12, 2020 5:56 pm
Hello all,
I have been working on reading the GPT partition table and working my wayup to implementing a filesystem, currently Ext2. I have a couple questions though about this process:
1) Wikipedia indicates that the GUIDs (partition type GUID, partition GUID, ...) are in "mixed endian". What is the appropriate procedure for converting these "mixed endian" GUIDs into actual numbers? Rust allows me to manipulate and store 128-bit integers. Currently I just take the hole GUID, convert the words from the ATA device to little endian bytes, and then convert those into 128-bit integers. Will this suffice? As an example, my kernel currently shows the following data about this single partition I have (created via NBD):
3) What is the method for detecting what filesystem is on the partition?
I have been working on reading the GPT partition table and working my wayup to implementing a filesystem, currently Ext2. I have a couple questions though about this process:
1) Wikipedia indicates that the GUIDs (partition type GUID, partition GUID, ...) are in "mixed endian". What is the appropriate procedure for converting these "mixed endian" GUIDs into actual numbers? Rust allows me to manipulate and store 128-bit integers. Currently I just take the hole GUID, convert the words from the ATA device to little endian bytes, and then convert those into 128-bit integers. Will this suffice? As an example, my kernel currently shows the following data about this single partition I have (created via NBD):
- Partition type GUID: e47d47d8693d798e477284830fc63daf
- Partition GUID: 53b18f9bf4bf21bf402586be28bc51bf
- Starting LBA: 2048
- Ending LBA: 8388574
- Attribute flags: 0
- Partition name: Linux filesystem
3) What is the method for detecting what filesystem is on the partition?