[Parted-maintainers] Bug#1124312: libparted: Partition type is not updated after changing file system

Pascal Hambourg pascal at plouf.fr.eu.org
Tue Dec 30 11:02:45 GMT 2025


Package: libparted2-udeb
Version: 3.6-6
Severity: minor
Tags: d-i
Forwarded: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=80093
Control: affects -1 partman-basicfilesystems partman-target

Dear maintainer,

While testing a change in partman, I found out that setting a partition 
filesystem type may not update the partition type ID accordingly as one 
may expect in GPT and MSDOS partition tables.

Setting a partition filesystem type with ped_partition_set_system() is 
supposed to update the partition type ID/GUID accordingly.

GPT partition table:
- FAT, NTFS, UDF -> PARTITION_BASIC_DATA_GUID (flag "msftdata")
- HFS -> PARTITION_APPLE_HFS_GUID (no flag)
...
- linux-swap -> PARTITION_SWAP_GUID (flag "swap")
- default (ext4, btrfs...) -> PARTITION_LINUX_DATA_GUID (no flag)

MSDOS partition table:
- FAT16 -> PARTITION_FAT16 (no flag)
...
- linux-swap -> PARTITION_LINUX_SWAP (flag "swap")
- default (ext4, btrfs...) -> PARTITION_LINUX (no flag)

This mechanism is overridden if the current partition type ID is not 
related to a filesystem type (ESP, LVM, RAID...). However it appears 
that it may also be overridden when the current partition type is 
related to a filesystem type and has an associated parted flag:

- GPT partition table: PARTITION_BASIC_DATA_GUID, PARTITION_SWAP_GUID
- MSDOS partition table: PARTITION_LINUX_SWAP

As a consequence, partman may not update the partition type and flag 
when changing the filesystem type. For exemple it may leave a swap or 
ext4 partition with the "msftdata" flag, or a FAT or ext4 partition with 
the "swap" flag.

A workaround in partman is possible, but I'd rather fix this in libparted.



More information about the Parted-maintainers mailing list