[parted-devel] [PATCH 1/2] parted: Reset the filesystem type when changing the id/uuid

Brian C. Lane bcl at redhat.com
Fri May 13 19:43:05 BST 2022


Without this the print command keeps showing the type selected with
mkpart, which doesn't match the id/uuid set by the user. So rescan the
partition for a filesystem.
---
 parted/parted.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/parted/parted.c b/parted/parted.c
index b8a4acf..96da30d 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -991,6 +991,9 @@ do_type (PedDevice** dev, PedDisk** diskp)
 
         free (input);
 
+        // Reset the fs_type based on the filesystem, if it exists
+        part->fs_type = ped_file_system_probe (&part->geom);
+
         if (!ped_disk_commit (*diskp))
                 goto error;
         return 1;
-- 
2.35.3




More information about the parted-devel mailing list