I had external USB harddrive that attached to raspberry-pi, linux desktop, windows, macOS and the only one FS that supported by these three system is exFAT. exFAT introduces by microsoft at 2006, to optimize storage by flash drive memories, but now adays exfat already become default when formating any kind USB drive either spining backed or flash backed.
Now let's begin:
exfat-progs
package
$ sudo apt install exfat-progs
blkid
$ sudo blkid
blkid
will show all your devices, becarefull to identify the disk you want to format
exfat
$ sudo mkfs.exfat -L "some-label-name" /dev/sdX
/dev/sdX
is your identified disk, assuming the disk is /dev/sda
, then use /dev/sda
for a whole disk, /dev/sda1
for the partition.
$ sudo blkid
Write up the UUID
We may notice that UUID
on exFAT formatted disk is pretty short only 8 characters, compared to another UUID
disk that usually got 32 characters. But its fine, no broken.
$ sudo mkdir /mnt/storage
You can use any name you want for the directory name
$ sudo nano /etc/fstab
UUID=####-#### /mnt/storage exfat defaults,uid=1000,gid=1000 0 0
Change the uid
and gid
to your desired one, dependss on the application or the user need to use the disk, uid and gid number may different. UUID
set to UUID
number we idenfitied at step 4
$ sudo mount -a;
mount -a;
will read the /etc/fstab
looking info for the disk that need to be mounted.
Then how about the automount? The line we added to /etc/fstab
will read everytime system starting up, and it will mounted without user interaction, like steps 7.