Skip to content

Commit

Permalink
Add exFAT format option (#62)
Browse files Browse the repository at this point in the history
* add dependency needed for mkfs.exfat

exfat-utils is already installed by default on Linux Mint 18 and above and on LMDE 2 refresh. It may only not already be installed on Linux Mint 17.x and LMDE 2 installations from before March 2017.

* add exFAT tooltip and fix spacing in tooltip

* fix spacing in tooltip for FAT32

* add exfat format option

* correct partition type for exFAT

exFAT and NTFS both use partition type ntfs (0x07)
  • Loading branch information
Vincent Vermeulen authored and clefebvre committed May 7, 2018
1 parent 6766da7 commit 8859b35
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion debian/control
Expand Up @@ -21,7 +21,8 @@ Depends:
python, python-parted,
gir1.2-udisks-2.0,
gir1.2-xapp-1.0,
util-linux
util-linux,
exfat-utils
Conflicts: usb-imagewriter
Replaces: usb-imagewriter
Description: write .img and .iso files to USB sticks
Expand Down
12 changes: 8 additions & 4 deletions lib/raw_format.py
Expand Up @@ -21,7 +21,9 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
partition_path = "%s1" % device_path
if fstype == "fat32":
partition_type = "fat32"
if fstype == "ntfs":
elif fstype == "exfat":
partition_type = "ntfs"
elif fstype == "ntfs":
partition_type = "ntfs"
elif fstype == "ext4":
partition_type = "ext4"
Expand All @@ -42,7 +44,9 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
# Format the FS on the partition
if fstype == "fat32":
execute(["mkdosfs", "-F", "32", "-n", volume_label, partition_path])
if fstype == "ntfs":
elif fstype == "exfat":
execute(["mkfs.exfat", "-n", volume_label, partition_path])
elif fstype == "ntfs":
execute(["mkntfs", "-f", "-L", volume_label, partition_path])
elif fstype == "ext4":
execute(["mkfs.ext4", "-E", "root_owner=%s:%s" % (uid, gid), "-L", volume_label, partition_path])
Expand Down Expand Up @@ -72,8 +76,8 @@ def main():
elif o in ("-d"):
device = a
elif o in ("-f"):
if a not in [ "fat32", "ntfs", "ext4" ]:
print "Specify fat32, ntfs or ext4"
if a not in [ "fat32", "exfat", "ntfs", "ext4" ]:
print "Specify fat32, exfat, ntfs or ext4"
sys.exit(3)
fstype = a
elif o in ("-l"):
Expand Down
16 changes: 10 additions & 6 deletions share/mintstick/mintstick.ui
Expand Up @@ -269,19 +269,23 @@
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">FAT32
+ Compatible everywhere.
- Cannot handle files larger than 4GB.
+ Compatible everywhere.
- Cannot handle files larger than 4GB.

exFAT
+ Compatible almost everywhere.
+ Can handle files larger than 4GB.
- Not as compatible as FAT32.

NTFS
+ Compatible with Windows.
- Not compatible with Mac and most hardware devices.
- Occasional compatibility problems with Linux (NTFS is proprietary and reverse engineered).
- Not compatible with Mac and most hardware devices.
- Occasional compatibility problems with Linux (NTFS is proprietary and reverse engineered).

EXT4

+ Modern, stable, fast, journalized.
+ Supports Linux file permissions.
- Not compatible with Windows, Mac and most hardware devices.
- Not compatible with Windows, Mac and most hardware devices.
</property>
</object>
<packing>
Expand Down

0 comments on commit 8859b35

Please sign in to comment.