[systemd-devel] [PATCH 3/3] Use a stamp file to avoid running systemd-fsck-root.service twice

Harald Hoyer harald at redhat.com
Tue May 5 07:30:11 PDT 2015


On 05.05.2015 15:24, Zbigniew Jędrzejewski-Szmek wrote:
> On Tue, May 05, 2015 at 10:48:48AM +0200, Harald Hoyer wrote:
>> On 03.05.2015 17:33, Zbigniew Jędrzejewski-Szmek wrote:
>>> On Sun, May 03, 2015 at 06:06:58PM +0300, Andrei Borzenkov wrote:
>>>> В Sun, 3 May 2015 16:17:15 +0200
>>>> Lennart Poettering <lennart at poettering.net> пишет:
>>>>
>>>>> On Sat, 02.05.15 13:16, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
>>>>>
>>>>> So, the last time we discussed this we figured we should do this
>>>>> differently, and simply generate systemd-fsck-root.service in the
>>>>> initrd as well, that uses a different command line internally. The end
>>>>> result would then be that we can do without flag file, and always have
>>>>> the guarantee that "systemd-fsck-root.service" is the services that
>>>>> fsck'ed the root file system, regardless whether in initrd or not.
>>>>>
>>>>
>>>> systemd-fsck at .service has explicit dependency on
>>>> systemd-fsck-root.service so other mounts (/usr, anything else?) will
>>>> be serialized after it. Currently they can run in parallel.
>>>>
>>>> Not I think it is a big problem, but at least to consider.
>>> Yeah, that's the main wart. I tried to outline it in the second bullet
>>> point below.
>>>
>>> I prepared a patch to generate systemd-fsck-root.service in
>>> generator_write_fsck_deps() first, but I wasn't happy with the result.
>>> If we ignore the dependency issue, it might be judged more elegant,
>>> since it just uses unit stat to pass information.
>>>
>>>>> Harald, can you comment?
>>
>> Zbigniew has a point with the ordering.
>>
>> But maybe the whole thing is easier than it appears:
>> - the initrd can provide a fake systemd-fsck-root.service, with /bin/true
>> - if /sysroot (or any needed fsck) is failing fsck, we don't boot the real
>> system anyway
> 
> Can you have a system with initramfs, with the root mounted initially ro,
> which checks the filesystem after transition to the main system? Or is
> something which is not supported?
> 
> Zbyszek
> 

It's better checked with the fsck binary in the initramfs and not with a
potential broken fsck on the root fs. So, I think we should require the fsck's
of the initrd to succeed, before the initrd can switch root.


More information about the systemd-devel mailing list