[systemd-devel] [PATCH] fstab-generator: When parsing the root= cmdline option, set FsckPassNo to 1

Colin Guthrie gmane at colin.guthr.ie
Tue Oct 1 03:15:59 PDT 2013


'Twas brillig, and Thomas Bächler at 01/10/13 10:18 did gyre and gimble:
> Am 01.10.2013 02:58, schrieb Lennart Poettering:
>> Now, if we have the initrd, then I figure root-fsck.service doesn't make
>> much sense, but there's something missing I think: if we use
>> fsck at .service for the root device, how do we then communicate to the
>> root-fsck.service on the host that the file system has already been
>> checked? How is that supposed to work?
> 
> This is how I imagine things should work:
> 
> 1) initrd fsck's the device used for /sysroot.
> 2) initrd mounts /sysroot as rw

Why is it the initrd's job to do the rw mount? It should likely mount as
ro pretty much always no? It's up to the booted system to remount rw if
so desired (i.e. in the fstab). Of course the initrd could check the
/sysroot/etc/fstab for this info (it may need to look at this for the
/usr mount anyway), but something still makes me think it's up to the
system to do the remount rw if needed. I get your point below about not
needing remount-fs.service tho', so would be interested in Harald's
opinon too :)

> 3) initrd fsck's and mounts /usr and friends
> 4) switch-root
> 5) the main system only fsck's and mounts whatever isn't mounted yet.

This is generally OK, but we have to differentiate between initrd boots
and non-initrd boots too - as Lennart said, root-fsck is only really
sensible if and only if no initrd is used.

> This is what we now have as default in new Arch installations (including
> / being mounted rw in initrd). What we don't have by default yet is
> initrd being handled by systemd. In the systemd case, step 1) was
> missing and the root device was never fsck'ed, thus the patch.
> 
> The beauty of this setup is that systemd implicitly does everything
> right, there is no need to serialize any fsck state between initrd and
> main system.
> 
> In the setup I am aiming for as a default, neither
> systemd-root-fsck.service nor systemd-remount-fs.service are needed and
> both can go away (in fact, I always mask the latter, since that saves me
> a few milliseconds).

I think everyone agrees that systemd-root-fsck is not needed if you have
an initrd. It's only meant for initrd-less boots. Perhaps, the initrd
should just drop a masking symlink in /run/systemd/system for that
service to ensure it's not run? Likewise the initrd could do the masking
for the remount service too such that someone booting without an initrd
could still get it?

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list