[systemd-devel] systemd-fsck-root semantics

Daniel Drake drake at endlessm.com
Wed Jul 2 05:43:31 PDT 2014


On Wed, Jul 2, 2014 at 1:36 PM, Lennart Poettering
<lennart at poettering.net> wrote:
>> Then the system continues booting, switches root, and then
>> system-fsck-root.service starts from the root fs, and runs fsck on /
>> again. This is the bit I don't understand - we already checked from
>> the initramfs, why check again now?
>
> I think the idea is that the unit is still around, hence won't get
> started a second time.

dracut doesn't include systemd-fsck-root in the initramfs. I think
there is good reason for that - systemd-fsck-root causes fsck to run
on /, but at this point in the initramfs, / is a ramdisk and the thing
that needs checking is at /sysroot.

>> Also, systemd-fsck-root.service in itself seems a little questionable,
>> is it really safe in any context to run fsck on a mounted partition?
>> That could modify data structures which have already been cached in
>> memory in the kernel fs driver. In fact, e2fsck refuses to run on
>> partitions that are mounted, even ones that are ro.
>
> Well this is how things were traditionally done on initrd-less
> systems. It's really a horrible thing to do, and people really shouldn't
> do it. I certainly wouldn't run my systems like that.

I agree, but am a little worried that systemd might do this kind-of by
default. I now realise that this is a distro choice, they should
probably set passno=0 in fstab, I wonder if they actually do...

Daniel


More information about the systemd-devel mailing list