I’m trying to get a partition automounted by adding an entry to /etc/fstab, but it’s not working. I’m not sure if this is because of Qubes, or something else.
On debian minimal 12, I’ve added /etc/fstab to bound-dirs, and added this line:
UUID=<partition-uuid> /mount/point auto defaults,nofail,x-systemd.automount 0 0
then rebooted and attached the partition. The contents of /etc/fstab persist, the partition is seen with lsblk, the UUID is correct and sudo mount -a mounts it. But it doesn’t happen automatically and sudo systemct status '*automount' doesn’t list the unit which was supposed to be created automatically.
Mounts listed in /etc/fstab will be converted into native units dynamically at boot and when the configuration of the system manager is reloaded. In general, configuring mount points through /etc/fstab is the preferred approach to manage mounts for humans.
x-systemd.automount
An automount unit will be created for the file system.
I won’t work that way, because bind-dirs is running after system mounted all necessary filesystems from either fstab and systemd.
So it’s too late.
You have 2 options.
add mount command to /rw/config/rc.local
make systemd auto mount on access (this can have idle time after which it will auto unmount)
– 1 –
It’s easier since you have fstab entry already then just edit /rw/config/rc.local and add line at the end:
sudo mount /mount/point
– 2 –
Doing it in template it will start without /rw/config/rc.local, but it will throw errors in journal if block device not present in other appVM’s based on that template.
But if done in appVM with bind-dirs you still need to add some commands do rc.local for it to start systemd services.
Whatever you chose template or appVM/rw you could do it in a way that it just mount on qube start but if device to mount not present during start then it won’t mount anything.
If you do auto mount on request then there will be service running that will auto mount it as soon as you enter inside /mount/point, like open it’s directory in file manager or do ls /mount/point.
Mehod 2 is lenghty with 2 service files to make and some additional commands to make.
But I didn’t made it in debian… is debian qubes have same systemd as fedoras?