[parted-devel] how to create compatible msdos partition tables?

Harald Dunkel harri at afaics.de
Sat Apr 23 07:55:41 BST 2022


Hi folks,

On 2022-04-22 07:44:34, Arvin Schnell wrote:
> 
> One difference in the partition id. For mbr.MacOS.img it is 0x07
> (NTFS), for mbr.Linux.img it is 0x83 (Linux). You can see that
> difference with fdisk.
> 

This was a very helpful hint. I can confirm that using

	(parted) mkpart primary NTFS 2048s -1s
	(parted) p
	Model: SanDisk Extreme SSD (scsi)
	Disk /dev/sdd: 976773120s
	Sector size (logical/physical): 512B/4096B
	Partition Table: msdos
	Disk Flags:

	Number  Start  End         Size        Type     File system  Flags
	 1      2048s  976773119s  976771072s  primary  ntfs         lba

does the trick. This sets the partition ID to 0x07. MacOS accepts the
partition table created by parted this way.

I didn't ask for partition ID 0x83 or 0x07 in the first place, but I under-
stand that some value had to be chosen. Problem is, parted doesn't show the
partition ID later. There is no indication for broken compatibility. Parted
just says "Partition table: msdos". It is unexpected.

Would it be possible to extend parted to allow listing and explicitly
changing the ID after creating the partition? Hopefully I am not too blind
to see, but I did not find such an option mentioned in the documentation.


Thank you very much for your help

Harri



More information about the parted-devel mailing list