01.12.2016 01:51, Carlos E. R. пишет:
Hi,
in the process of setting up my new miniserver, I bumped into a curios situation. Two days ago I copied several files from the old server, one of them, some entries from fstab. One, was this:
/dev/mapper/cr_hoard2 /data/hoard xfs nofail,noatime 0 3 LABEL=old_d_tmpry /data/waterhoard xfs user,relatime,exec,nofail 1 3
Then I noticed that systemd was trying to mount them and complaining about some dependency not found re mounting the disks - obviously, as they were not yet connected, I needed a new usb3 enclosure instead of the old usb2.
No big deal, just some log noise. I simply commented out the line:
#/dev/mapper/cr_hoard2 /data/hoard xfs nofail,noatime 0 3 #LABEL=old_d_tmpry /data/waterhoard xfs user,relatime,exec,nofail 1 3
Well, today I assembled the two disks and connected them. Both went online as soon as each was powered up, despite the line in fstab being deactivated!
/etc/fstab is read once when systemd is started. Editing it after that has no effect unless you reload systemd (systemctl daemon-reload) and even then previous units may be carried over.
No, I don't mean mounted somewhere in /media via the desktop. No. They were mounted in the places that figured in the fstab file!
When systemd creates mount unit from /etc/fstab line with "auto" option, it adds Wants dependency from device to mount unit. Which means that as soon as device appears (is announced by udev) systemd tries to start mount unit.
Seems things are getting worse in this respect in 42.2 than in 13.1 :-(
Well, systemd author believes it's a feature. If you can find arguments to convince him in the contrary ... I could not. Workaround is to create mount units manually, without this dependency.
(the password for the encrypted disk is in a file on the encrypted home partition, so that part was not a surprise)
Could you send me output of systemctl show '*'