1

I have the following entry in /etc/fstab:

UUID=foo /media/bar xfs noauto,x-systemd.automount,nofail,x-systemd.device-timeout=1,noatime 0 2

Running cat /proc/mounts | grep bar returns the following:

systemd-1 /media/bar autofs rw,relatime,fd=41,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=1419 0 0
/dev/sdb1 /media/bar xfs rw,noatime,attr2,inode64,noquota 0 0

There are a few things I don't understand:

  • Is this "duplicate" entry normal?
  • Why does the systemd line show autofs and relatime instead of xfs and noatime ?
  • When this drive is unplugged, I can boot but I cannot access any partition besides /! e.g. ls / will work butls /media/bar and even ls ~ will not (/home is on a separate partition).

This third issue might be unrelated for all I know, still I am interested in the first two.

1

Is this "duplicate" entry normal?

Yes, it is normal. It is how autofs works (see below).

Why does the systemd line show autofs and relatime instead of xfs and noatime ?

Again, it is how autofs kernel subsystem works.

At boot time, systemd mounts a pseudo-filesystem autofs on the desired mount point. Its mount options should not and will not correspond to your desired mount options.

When userspace accesses any file below this mountpoint, the Linux kernel pauses the userspace process, notifies systemd (which mounts the real xfs filesystem over the pseudo autofs filesystem as specified in the respective .mount unit) and finally allows userspace to proceed, which then accesses the real filesystem.

When this drive is unplugged, I can boot but I cannot access any partition besides /! e.g. ls / will work but ls /media/bar and even ls ~ will not (/home is on a separate partition).

Accessing paths below a mountpoint that is supposed to be automounted but can't be (for example, due to a missing drive) will fail. If systemd is not able to mount a real filesystem over the pseudo one, the kernel will return failure to the accessing process.

If /home is not automounted, then I cannot explain /home inaccessibility.

  • > notifies systemd which mounts the real xfs Does that mean the mount options are parsed then from fstab? > /home is on that drive too? Sorry I wasn't clear: no, it isn't. / and /home are on sda3 and sda5, which is why this makes little sense. Thanks for the clarifications! – Bhuz May 12 '18 at 10:37
  • @Bhuz I have clarified my answer appropriately. /home inaccessibility seems to be a different problem; I can't tell if this is expected in your configuration or not. Try providing some logs. – intelfx May 12 '18 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.