Auto-mounted drives gives a strange error when trying to move files

I have added the following line to /etc/fstab:

/dev/sda1 /mnt/sda exfat defaults 0 0

After rebooting, the drive is properly mounted and seem to mostly be working properly. The problem comes when I try to move a file to that drive. For example, executing mv my-file.txt /mnt/sda gives the following error:

mv: preserving times for '/mnt/sda/my-file.txt': Operation not permitted
mv: preserving permissions for ‘/mnt/sda/my-file.txt’: Operation not permitted

The file still moves, but it does this every time. The interesting thing i that if I remove that line from /etc/fstab and just mount the drive manually, moving files around works just fine. Copying files works too.

exfat is a proprietary Microsoft filesystem which does not support rights management (e.g. times and permissions). Thats why you get these errors…

I am not sure what you mea with “mount manually” but did you compare the permissions of the mount points in both cases?

If that’s the case, why does it all work properly when I manually mount the drives in Dolphin?

Mount manually = click the drive in Dolphin and let the system mount it for me.

I have check the permissions and made sure they were the same: chmod 777

Only permissions is not enough, ownership (by user and group) are part of it.

And you can not chmod, because an exfat system does not have them. They are faked. They are set at mount and you can influence this with mount parameters (e.g. in your fstab entry).

Interesting. I’ll check that out.

That seems to have done the trick. If anyone else seems to find this in the future, I did two things:

  1. chown <my_username>:<my_groupname> /mnt/sda (This didn’t seem to do it, but I’ve left it anyway.)
  2. Changed my /etc/fstab to /dev/sda1 /mnt/sda exfat defaults,uid=1000,gid=1000,umask=002 0 0

Thank you for the help!

Why gid=1000?
Should be gid=100

stephan@linux64:~> id
uid=1000(stephan) gid=100(users) Gruppen=100(users),36(kvm),107(qemu),108(libvirt),462(davfs2),463(vboxusers),491(cdrom)

On Tumbleweed with only one user the gid is 1000

ich@laptop:~> id
uid=1000(ich) gid=1000(ich) Gruppen=1000(ich),460(vboxusers),461(vboxsf),462(vboxguest)

There was another thread which explained that the first user on Tumbleweed has the same name as his group. Each additional user gets the group users with gid=100…

Ok thats new to me.

Same as on my Debian Server.

I specifically checked both my user id and group id before setting them.

You can also move files from exFAT and, FAT, filesystems if, they’re mounted simply by plugging them into a USB port or, whatever, and, letting FUSE (File System in User Space) mount the things.

  • It may well be that, mounting such File Systems in System Space will place one or two (Linux) system constraints on such (non-UNIX®/Linux) File Systems …