Red Hat Bugzilla – Bug 475770
Stateless boot does not work when /var is in separate partition
Last modified: 2014-02-10 18:03:59 EST
Description of problem:
When we use readonly root option from /etc/sysconfig/readonly-root the system won't boot when /var is on separate partition.
Version-Release number of selected component (if applicable):
Create machine with sepaprate / and /var. Boot with readonly root set to yes.
Steps to Reproduce:
Throws tons of errors and hangs during syslog startup.
boot up machine with / mounted as read only
if /var is manually mounted before rc.sysinit sets up the readonly symlinks this works.
Same goes for all files and directories mentioned in /etc/rwtab. If they are on a seperate partition, those partitions better be mounted before.
I'd say this is release-note worthy. I think if you're trying to support a stateless read-only configuration, restricting how it's partitioned is valid. Attempting to arbitrarily do the mapping when other filesystems are mounted is rather impractical.
Setting as 'requires release note'; the answer is mostly "don't do that."
There is a work around, so long as you are using an initrd. Create a /etc/fstab.sys with entries for the var partition and any other partitions you are pasting together to make a "root" partition.
Put these entries in /etc/fstab as well, with "noauto" option. Otherwise
after your stateless bind mounts are done, they will be covered over by /var being mounted again. This is all because this early in the process /etc/mtab isn't up to date. Actually is /etc/mtab is a symbolic link to /proc/mounts, then I think the "noauto" won't be necessary.
The entries in /etc/fstab.sys will get mounted from initrd, before the switchroot happens.
It would still be good if it were documented.
Given that that involves mounting local filesystems read-write without ever fscking them from the initrd, I don't think that's a solution we really want to push for people to use.
Yah. In my case the /var is an nfs mount so wouldn't fsck it anyway. It is not clear what the original case was.
And non-network filesystem partitions should be handled by https://bugzilla.redhat.com/show_bug.cgi?id=487926