<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thank you for reviewing this patch. Indeed the copy-pasting of
      the patch replaced some tabs with spaces in my mail client, sorry
      about that. Please find below the patch i meant to send in my
      previous mail.</p>
    <p>I could replicate the failing t1700 test too, i will investigate
      the issue, i hope i can submit an updated patch soon.</p>
    <pre>diff --git a/doc/C/parted.8 b/doc/C/parted.8
index c852112..13973fa 100644
--- a/doc/C/parted.8
+++ b/doc/C/parted.8
@@ -81,7 +81,7 @@ should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos",
 Create a new partition. \fIpart-type\fP may be specified only with msdos and
 dvh partition tables, it should be one of "primary", "logical", or "extended".
 \fIname\fP is required for GPT partition tables and \fIfs-type\fP is optional.
-\fIfs-type\fP can be one of "btrfs", "ext2", "ext3", "ext4", "fat16", "fat32",
+\fIfs-type\fP can be one of "btrfs", "exfat", "ext2", "ext3", "ext4", "fat16", "fat32",
 "hfs", "hfs+", "linux-swap", "ntfs", "reiserfs", "udf", or "xfs".
 .TP
 .B name \fIpartition\fP \fIname\fP
diff --git a/doc/parted.texi b/doc/parted.texi
index 5d4074d..10fdd3e 100644
--- a/doc/parted.texi
+++ b/doc/parted.texi
@@ -624,6 +624,7 @@ partition table.
 @itemize @bullet
 @item btrfs
 @item ext2, ext3, ext4
+@item exfat
 @item fat16, fat32
 @item hfs, hfs+, hfsx
 @item hp-ufs
diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am
index 7fa8d14..66cbffd 100644
--- a/libparted/fs/Makefile.am
+++ b/libparted/fs/Makefile.am
@@ -28,6 +28,7 @@ libfs_la_SOURCES =            \
   ext2/ext2.h                  \
   ext2/ext2_fs.h               \
   ext2/interface.c             \
+  exfat/exfat.c                        \
   fat/bootsector.c             \
   fat/bootsector.h             \
   fat/count.h                  \
diff --git a/libparted/fs/exfat/exfat.c b/libparted/fs/exfat/exfat.c
new file mode 100644
index 0000000..87bdafc
--- /dev/null
+++ b/libparted/fs/exfat/exfat.c
@@ -0,0 +1,74 @@
+/*
+libparted
+    Copyright (C) 1998-2000, 2002, 2004, 2007, 2009-2014, 2019-2023 Free
+    Software Foundation, Inc.
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <a
    class="moz-txt-link-rfc2396E" href="http://www.gnu.org/licenses/"
    moz-do-not-send="true"><http://www.gnu.org/licenses/></a>.
+*/
+
+#include <config.h>
+
+#include <parted/parted.h>
+#include <parted/endian.h>
+
+#include <unistd.h>
+
+#define EXFAT_SIGNATURE "EXFAT   "
+
+static PedGeometry* exfat_probe (PedGeometry* geom)
+{
+    uint8_t *buf = alloca(geom->dev->sector_size);
+
+    if (!ped_geometry_read(geom, buf, 0, 1)) {
+        return NULL;
+    }
+    if (strncmp (EXFAT_SIGNATURE, ((char *)buf + 3), strlen (EXFAT_SIGNATURE)) == 0) {
+        uint64_t sector_count;
+        unsigned char bytes_per_sector_shift;
+        uint64_t fs_size;
+        PedGeometry *newg = NULL;
+
+        memcpy(&sector_count, buf + 0x48, sizeof(uint64_t));
+        memcpy(&bytes_per_sector_shift, buf + 0x6c, sizeof(unsigned char));
+        if (bytes_per_sector_shift < 9 || bytes_per_sector_shift > 12) {
+            return NULL;
+        }
+        fs_size = sector_count * (1ULL << bytes_per_sector_shift);
+        newg = ped_geometry_new(geom->dev, geom->start, fs_size);
+
+        return newg;
+    }
+
+    return NULL;
+}
+
+static PedFileSystemOps exfat_ops = {
+    probe: exfat_probe,
+};
+
+static PedFileSystemType exfat_type = {
+    next: NULL,
+    ops: &exfat_ops,
+    name: "exfat",
+};
+
+void ped_file_system_exfat_init()
+{
+    ped_file_system_type_register (&exfat_type);
+}
+
+void ped_file_system_exfat_done ()
+{
+    ped_file_system_type_unregister (&exfat_type);
+}
diff --git a/libparted/libparted.c b/libparted/libparted.c
index 204ce00..16ff7fa 100644
--- a/libparted/libparted.c
+++ b/libparted/libparted.c
@@ -115,6 +115,7 @@ extern void ped_file_system_ext2_init (void);
 extern void ped_file_system_nilfs2_init (void);
 extern void ped_file_system_btrfs_init (void);
 extern void ped_file_system_udf_init (void);
+extern void ped_file_system_exfat_init (void);
 
 static void
 init_file_system_types ()
@@ -133,6 +134,7 @@ init_file_system_types ()
        ped_file_system_nilfs2_init ();
        ped_file_system_btrfs_init ();
        ped_file_system_udf_init ();
+       ped_file_system_exfat_init ();
 }
 
 extern void ped_disk_aix_done ();
@@ -200,6 +202,7 @@ extern void ped_file_system_xfs_done (void);
 extern void ped_file_system_amiga_done (void);
 extern void ped_file_system_btrfs_done (void);
 extern void ped_file_system_udf_done (void);
+extern void ped_file_system_exfat_done (void);
 
 static void
 done_file_system_types ()
@@ -218,6 +221,7 @@ done_file_system_types ()
        ped_file_system_amiga_done ();
        ped_file_system_btrfs_done ();
        ped_file_system_udf_done ();
+       ped_file_system_exfat_done ();
 }
 
 static void _done() __attribute__ ((destructor));

</pre>
    <div class="moz-cite-prefix">Le 20/03/2026 à 22:21, Brian C. Lane a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:ab26YtaDaZV0tEnr@ohop.brianlane.com">
      <pre wrap="" class="moz-quote-pre">On Sat, Feb 14, 2026 at 05:37:27PM +0100, Victor Couty wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">Dear parted maintainers,

I would like to add support for the ExFAT filesystem to parted. This
includes displaying correctly ExFAT partitions and interpreting "exfat" as a
correct entry when specifying the fs type upon partition creation.
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">Thanks, a couple things -- your email mangled the patch (seems to be
missing some blank lines) so it didn't apply cleanly. It also needs
tests, at least t1700 needs to check that it is detected correctly. I
threw this in quickly and discovery isn't working right, it is reported
as msdos.

Brian

</pre>
    </blockquote>
  </body>
</html>