On 2018-02-28 16:01, Roger Oberholtzer wrote:
I am trying to use x-systemd.automount,noauto in /etc/fstab to set up automount of disks. For the most part it works fine. I am struggling with permissions.
When the disk is, say, CIFS, I can add uid=roger to /etc/fstab and the files will belong to roger. This is because the file system itself does not have user ownership of individual files. Or at least the CISF driver makes it so.
FAT doesn't have "users", and for NTFS the Linux driver doesn't support them.
If I want this to work with ext4, this seems not to work as I would like.
You can not se uid/gid on Linux filesystem via mount options, as the filesystem has them written in the metadata.
The problem is the top-level mount point. I do not seem to have any control over the permissions. So if a user inserts a disk, they cannot make any files in the top level of the disk. But that is what I need. When we were not using automount, the mount point's permissions were whatever the disk file had. They were not changed by the mount command. Autofs sets the permissions to rwx------.
We really want to use autofs. If the disks are not inserted and they are in /etc/fstab, the system will not boot. Autofs solves this nicely.
Any ideas on how to sort out permissions when systemd is managing autofs? I have googled, but all seems to discuss when you set up autofs yourself. I can do that. But we are trying to make this less complicated for the people who are managing the systems.
Not related at all. Mount the disk by your preferred method, then use chmod and chown to change the permissions normally. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)