File Systems
File systems are protocols for the organization of data. Compared to commercial operating systems, Linux is compatible with a large number of file systems.
See here for creating a partition table.
Contents
Setup
Devices are referenced as sdXN, where X is the relevant interface letter and N is the relevant partition number.
ext2 and ext3
Don't.
ext4
Run as superuser:
mkfs.ext4 /dev/sdXN
Consider disabling access time on secondary and storage drives. Setting this metadata isn't always helpful and carries a speed cost.
# <device> <dir> <type> <options> <dump> <fsck> /dev/sdXN /var ext4 defaults,noatime 0 0
FAT32
The main advantage to FAT32 is it near-universal mount-ability. (Expect issues on a vanilla macOS environment!) The cost is performance, instability, and incompatibility with standard Linux file metadata.
Run as superuser:
mkfs.fat -F 32 /dev/sdXN # or mkfs.vfat /dev/sdXN
MS-DOS
Run as superuser:
mkdosfs /dev/sdXN
But you should also know that mkdosfs is a symlink to mkfs.vfat.
Usage
A file system is used by mounting it as a disk.
mount
To manually mount a volume, try:
mount /dev/sdXN /mnt/DIR
You may need to specify the file system type, using the --types FSTYPE option.
If you run into persistent errors, try fsck /dev/sdXN to check for file system errors.
udisksctl
udisksctl wraps the udisks utility to aids in mounting devices.
Run udisksctl status to see an overview of all devices. A volume can be mounted or unmounted using udiscksctl mount -b /dev/sdXN and udiscksctl unmount -b /dev/sdXN,
fstab
See the fstab(5) file.