I have just added a cgroup mount to /etc/fstab and my system appears to hang after mounting my root partition

Asked by James Hunt

I have just installed the cgroup-bin package:

  sudo apt-get install cgroup-bin

... and added a cgroup mount to /etc/fstab:

    none /cgroup cgroup defaults 0 0

However, on boot the system fails to boot to the desktop. In fact, Plymouth doesn't even start.
If you remove the "quiet" argument from the kernel command-line via group, the last line you see on screen is:

EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro

Question information

English Edit question
Ubuntu mountall Edit question
No assignee Edit question
Solved by:
James Hunt
Last query:
Last reply:
Revision history for this message
James Hunt (jamesodhunt) said :

This issue is rather interesting and is caused by a combination of the cgroup-bin, upstart and mountall packages. Note that the issue was caused by user error, but the explanation may be instructive.

Firstly, I should have RTFM for cgroup-bin since it mounts cgroups *itself* using info from /etc/cgconfig.conf. So, what was happening was:

- init (upstart) starts and starts jobs for the two job config files:
  - /etc/init/mountall.conf
  - /etc/init/rc.conf

The jobs representing mountall.conf and rc.conf run simulaneously (both are started on the "startup" event), but on my system it appears that rc.conf generally runs first. Thus, rc.conf runs "/etc/init.d/rc 2" which in turns runs "/etc/init.d/cgconfig". This script invokes cgconfigparser(8), which in turn calls mount(2) (via libcgroup.so.1).

At some *later* point, mountall(8) gets invoked by mountall.conf. This parses /etc/fstab and attempts to mount all entries. However, unbeknownst to mountall the cgroup mounts have _already_ been mounted (they show up in /proc/mounts, but *not* in /etc/mtab) and it is not legitimate to remount cgroup entries.


- remove the erroneous cgroup mount from /etc/fstab
- remove/comment out all entries in /etc/cgconfig.conf


- consider increasing amount of user feedback provided by mountall
- change rc.conf to only run sysv service scripts when mountall has finished?

  start on (runlevel [0123456] and stopped mountall)

  This should confusing mountall and also avoid /etc/mtab from differing significantly from /proc/mounts.


- This took a while to trace through since at the point mountall was having issues attempting to remount a cgroup mount, the root fs was mounted read-only. The solution I used was to create a ramfs.conf job which mounted a ramfs. I then modified mountall.conf to run mountall via strace, logging to the ramfs. Booting the system without "quiet" and then invoking "sysrq-F" killed mountall and dropped me back to a shell. I could then remount the root fs read-write and copy the ramfs data to it.