16

I'm new to Linux and am having problems automounting an exFat-formatted partition on a Lacie-disk in Ubuntu 16.04.

I installed exfat-fuse and exfat-utils and could then mount manually using:

sudo mount -t exfat /dev/sdb2 /media/maria/Lexfat

The exfat disk would not automount, however, so I edited /etc/fstab (not sure what the options mean, though, so perhaps the problem is there...?):

sudo nano /etc/fstab
/dev/sdb2 /media/maria/Lexfat exfat defaults,auto,umask=000,users,rw 0 0

(I tried to get an UUID using blkid, but this does not list my exfat disk)

Now, the disk is automounted when I startup Ubuntu, but owned by root user.

So I need to give password to unmount it and am not allowed to remount with GUI. I am not allowed to change ownership using chown, either.

I have transferred files from a remote server to the disk using rsync, which works fine except that I get

failed to set times-error

I'm guessing that both the mounting and rsync issues are ownership/permission problems, but I don't understand how to fix it. Any ideas, please?

1 Answer 1

29

Automount exfat with user permissions

When specifying the auto option, the devices gets automatically mounted at boot time with root-permissions. The proper options for exfat are described in the mount.exfat manpage. Change the /etc/fstab entry to:

/dev/sdb1 /media/maria/Lexfat exfat defaults,uid=1000,gid=1000 0 0

The defaults options (rw, suid, dev, exec, auto, nouser, and async) are good enough in most cases. The proper uid and gid for your current user can be obtained by

$ id $USER
uid=1000(yourusername) gid=1000(yourusername) groups=1000(yourusername),4(adm),24(cdrom),...

For a different user name, replace $USER with the desired user name.

Validate the /etc/fstab entry before rebooting the system by testing the entry:

$ sudo mount /media/maria/Lexfat

If the entry is wrong of faulty in any way, the system boot will stop working and you might need to fix it with the Ubuntu live system.

chown in exfat

Regarding the chown problems and errors: exfat does not support user permissions. So using chown on a file inside exfat will always fail:

$ sudo chown root:root /media/maria/Lexfat/test.txt
chown: changing ownership of ‘test.txt’: Function not implemented

rsync into exfat

The problem with time-stamps and permissions are the same as the ownership issue: exfat does not support it. But rsync will still work, just don't use the -a option.

$ rsync -r /from/here /media/maria/Lexfat
4
  • That suggested fstab totally Bjorked my system. Thanks. Commented Jan 27, 2023 at 0:20
  • 1
    @ShawnMcDonald I don't believe, a mount point in /etc/fstab is able to do that... But adding a not existing mount point to fstab will break the system boot. Adding the noauto option will e.g. work for usb sticks Commented Jan 27, 2023 at 8:11
  • 1
    @ShawnMcDonald The same thing happened to me when I had an drive failure. I learned the hard way that any additional drives I mount all need the "nofail" attribute added to the entry so there is "no failure due to error on boot" - man.archlinux.org/man/fstab.5#DESCRIPTION. I do this for all USB external drives.
    – Ron K.
    Commented Jan 28, 2023 at 19:00
  • 1
    @SimonSudler I used to have issues with rsync to EXFAT drives, so used different switches to overcome the Linux to EXFAT permissions and groups issue: rsync -vrltD --progress --stats /source/a/ /dest/a scivision.dev/rsync-to-exfat-drive Couple that with the UID and GID entries for accessing the drive and it's win win. "UUID=EAEB-D1B6 /mnt/mybook exfat defaults,uid=1000,gid=1000,umask=002,nofail 0 2" 6TB running on a raspberry pi 4
    – Ron K.
    Commented Jan 28, 2023 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .