Systemd Unmounting Removable Drive – Troubleshooting

mountsystemdvfat

I have following line in /etc/fstab:

UUID=E0FD-F7F5 /mnt/zeno vfat noauto,utf8,user,rw,uid=1000,gid=1000,fmask=0113,dmask=0002 0 0

The partition is freshly created by gnome-disks under the respective user, and spans the whole card.

Now: Running mount /mnt/zeno as user (1000) succeeds, but right after that I find out that it's actually not mounted: following umount /mnt/zeno fails with umount: /mnt/zeno: not mounted. When watching journalctl -f, I can see following messages appear when mounting:

[...] kernel: SELinux: initialized (dev mmcblk0p1, type vfat), uses genfs_contexts
[...] systemd[1]: Unit mnt-zeno.mount is bound to inactive service. Stopping, too.
[...] systemd[1]: Unmounting /mnt/zeno...
[...] systemd[1]: Unmounted /mnt/zeno.

So it seems that systemd indeed keeps unmounting the drive, but I can't find out why. I don't remember creating any custom ".mount" files. I tried to find something in /etc/systemd and in my home folder but did not find anything.

So what is this "mnt-zeno.mount" file and how can I review it? And most importantly, how can I mount the drive?

Best Answer

mnt-zeno.mount was created by systemd-fstab-generator. According to Jonathan de Boyne Pollard's explanation on debian-user mailing list:

[systemd-fstab-generator is] a program that reads /etc/fstab at boot time and generates units that translate fstab records to the systemd way of doing things [.....]

The systemd way of doing things is mount and device units, per the systemd.mount(5) and systemd.device(5) manual pages. In the raw systemd way of doing things, there's a device unit named "dev-sde1.device" which is a base requirement for a mount unit named "media-lumix\x2dphotos.mount".

After altering fstab one should either run systemctl daemon-reload (this makes systemd to reparse /etc/fstab and pick up the changes) or reboot.