Auto-mounting exFAT with fstab

Kernels & Hardware, configuring network, installing services

Auto-mounting exFAT with fstab

Postby skyblaster » 2020-11-02 00:45

I'm running testing/bullseye and therefore the newer Kernel 5.9 with native exFAT support.
Since I'm dual booting with Windows 10, I decided to use exFAT as a shared partition on my NVMe drive. I hope this was the correct decision....

It's been awhile since I've had to edit /etc/fstab, and I'm looking for the correct parameters to auto-mount this partition.

Here's my /etc/fstab as it stands:
Code: Select all
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=92EA-CD17                            /boot/efi      vfat    defaults,noatime 0 2
UUID=422def07-6c1e-4503-ae26-8ab4b4cb80de /              ext4    defaults,noatime 0 1
UUID=e4fe4b4f-d5ca-456e-93dc-11e24244cb0a swap           swap    defaults,noatime 0 2

And this is how the partition is mounted with Nautilus
Code: Select all
/dev/nvme0n1p7 on /media/user/Shared type exfat (rw,nosuid,nodev,relatime,uid=1000,gid=1001,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro,uhelper=udisks2)

Any help on a proper fstab entry is greatly appreciated!
skyblaster
 
Posts: 2
Joined: 2020-11-02 00:28

Re: Auto-mounting exFAT with fstab

Postby sgosnell » 2020-11-02 03:07

How did you mount it in the first place? The logical assumption seems to be that it was automounted when connected. If that's the case, there is no advantage to putting it in fstab. You have to use fuse to mount exfat filesystems. That is probably worth learning.
Take my advice, I'm not using it.
sgosnell
 
Posts: 906
Joined: 2011-03-14 01:49

Re: Auto-mounting exFAT with fstab

Postby skyblaster » 2020-11-02 04:50

sgosnell wrote:How did you mount it in the first place?

First I clicked the "Files" (ie. Nautilus) icon in Gnome shell, then clicked on "+ Other Locations" to see non-automounted drives, then clicked "Shared".
Additionally, I had to enter a password (similar to mounting an NTFS partition) in order to mount the partition.

So, no, it was not automounted, and I would love to save on needing to perform those extra mouse clicks.

sgosnell wrote:You have to use fuse to mount exfat filesystems. That is probably worth learning.

Actually, as of Kernel 5.7/5.8, exFAT no longer requires fuse: https://itsfoss.com/kernel-5-8-release/
It was what pushed me to choose it in the first place since it's supposed to be much faster than NTFS.
skyblaster
 
Posts: 2
Joined: 2020-11-02 00:28

Re: Auto-mounting exFAT with fstab

Postby sgosnell » 2020-11-02 13:48

Debian Buster uses 4.19. You didn't say that you're using the newest kernel.

For a normal mount in fstab, you have to make some choices. First, where do you want to mount the drive? The mount point must exist. Then, how do you want to refer to the drive? Using the UUID is the safest, and this can be found by running blkid as root. So an example would be (replace the mumbo-jumbo with actual info)
Code: Select all
UUID=alskejeorio4dkal84   /mount/point  exfat   defaults,nofail  0   0

That uses the UUID, which will always be the same, but change that to the actual UUID of the drive. It mounts the drive to your chosen mount point, which must exist, as exfat. /mnt is a common location for mounting, but the normal case is to use a subdirectory of /mnt. It's not strictly required, but it's good practice. The nofail allows the machine to boot even if the drive is not present. The default options, included in defaults, are rw, suid, dev, exec, auto, nouser, and async. You can change those as desired. It would be a good idea to learn the elements of /etc/fstab, and there are many examples available on the internet, easily discoverable through the magic of the search engine.
Take my advice, I'm not using it.
sgosnell
 
Posts: 906
Joined: 2011-03-14 01:49


Return to System configuration

Who is online

Users browsing this forum: No registered users and 22 guests

fashionable