DEV Community

hub
hub

Posted on

more methods to format a usb-stick

Currently, many many ppl tell me that the best filesystem to share content between Windows and Linux is the so called exFAT filesystem. Well the told me that specially on USB pendrives and SD cards. exFAT is, roughly speaking the winner among all systems,

exFAT seems to be a kind of a revision of FAT32 without the 4GB max file size limitation.

Well is the best method to do that - with exFAT !?

Btw: if we have no exFAT on the machine - then we have to add it

$ sudo apt install exfatprogs # Debian/Ubuntu
$ sudo dnf install exfatprogs # Red Hat/Fedora/CentOS
$ sudo pacman -S exfatprogs # Arch Linux/Manjaro
Note: On systems with older kernels, use exfat-utils instead of exfatprogs.

From here, we have exactly two options. Use a graphical tool like gparted - which is pretty awful or (better)
the command line (which is more fun). Find below steps for the latter.

We can go like so:

Plug-in the USB pendrive/SD card.
Identify the device. It should be one of /dev/sd?. In a terminal, run the below command which will show connected devices
and partition mount points. In this example, /dev/sdb is the device, with two partitions, the first of which is mounted.

but well i think to compare different versions - we can go and have a closer look at the options.:

Step 2: Unmount and Format USB Drive
Unmount the USB drives before formatting. To do so, run this command:

sudo umount /dev/sdb1

Unmounting the USB drive.
After unmounting, format the USB drive using the preferred file system (here we can do a replace sdb1 with the name of our device):

and if we go ahead to format a USB drive with FAT32 file system, use:
sudo mkfs.vfat /dev/sdb1

in order to format a USB drive while using the NTFS file system run:
sudo mkfs.ntfs /dev/sdb1

and yes: if we are to format a USB drive in accordance with the exFAT file system use:
sudo mkfs.exfat /dev/sdb1

the next step the Step 3: Verify USB Drive Formatting
here we have to confirm the formatting process has completed successfully:

sudo fsck /dev/sdb1

fubakky we cab di a a USB drive with no files indicates successful formatting.

Top comments (1)

Collapse
 
Sloan, the sloth mascot
Comment deleted