You are not logged in.
Pages: 1
Hi everybody !
I want to automount an external drive as a user on $HOME/mnt directory.
I did modify my /etc/fstab and add :
UUID=... /home/myuser/mnt ext4 user,noauto 0 0
To be able to mount the fs as a user (this works great).
But create mount and automount systemd user units, this doesn't seem to work (permission using mount syscall).
Am I forced to create a path unit (/dev/disk/by-uuid/...) and a service user unit that mount the fs for this automount ?
What is the right way to do this ?
Thanks !
Last edited by NeverTooLate (2022-09-19 10:41:10)
Offline
mount and automount systemd user units
Joe Shmoe doesn't get to mount random stuff - is the fstab entry still there?
What do the units look like?
That aside, what's wrong w/ either automounting the drive or adding "x-systemd.automount" as mount option (behind noauto) to mount it on demand?
Offline
Yes the fstab entry is there.
The units looks like this for mount :
[Unit]
Description= external drive to /home/myuser/mnt
[Mount]
What=/dev/disk/by-uuid/...
Where=/home/myuser/mnt
Type=ext4
[Install]
WantedBy=default.target
And for automount :
[Unit]
Description= external drive to /home/myuser/mnt
[Automount]
Where=/home/myuser/mnt
[Install]
WantedBy=default.target
The thing is I use systemd-homed, I just wanted the automount for this particular user and replicate the behavior on multiple computers. Anyway this seems impossible for security reasons...
Last edited by NeverTooLate (2022-09-19 13:21:17)
Offline
You could have a regular user service that simply executes "mount /home/myuser/mnt"?
Offline
With a path unit for checking udev like I said...
Yes but I still need that entry in the fstab anyway...like you said Joe Shmoe doesn't get to mount random stuff.
Offline
Offline
Pages: 1