check /etc/fstab for custom /run mount options

Bug #1540803 reported by Stéphane Graber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Under upstart, I can have the following line in my /etc/fstab:
    tmpfs /run tmpfs defaults,size=10M 0 0

At mount time, mountall will use /etc/fstab as an override for the internal fstab (/lib/init/fstab) and so I end up with /run mounted with a 10MB limit.

Under systemd, the exact same fstab appears to be ignored and I end up with a /run that has a limit of half my memory.

This may very well surprise users upgrading production environments from 14.04 to 16.04 or users that have to follow some strict partitioning and mount configuration policies (we've seen a couple of those by now) so it'd be good to have this resolved.

I did testing with /run in LXD containers on 14.04 (upstart) and 16.04 (systemd).

Revision history for this message
Martin Pitt (pitti) wrote :

Some context: This was motivated on real hardware, not containers. For "full" installations like VMs or real-iron the initrd already mounts /run, and if it is already mounted then systemd won't touch it. As there is no initrd in containers, https://github.com/systemd/systemd/blob/master/src/core/mount-setup.c will kick in and mount early stuff like /run, /proc/, etc. We can't influence mounts from mount-setup.c with fstab as this happens (and needs to happen) before /etc/fstab even gets parsed. But we could either make initramfs-tools look at fstab and mount /run differently (preferred), or remount /run etc. later in the game (that sounds racy, inelegant, and might fail if you have options which can't be applied on remount; I don't like that very much).

Changed in systemd (Ubuntu):
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

As explained above, /run is mounted by initramfs-tools, thus changing the package.

affects: systemd (Ubuntu) → initramfs-tools (Ubuntu)
summary: - systemd doesn't respect /etc/fstab for internal mounts
+ check /etc/fstab for custom /run mount options
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.