[systemd-devel] systemd-fsck-root semantics

Thomas Bächler thomas at archlinux.org
Thu Jul 3 02:49:20 PDT 2014


Am 02.07.2014 14:29, schrieb Daniel Drake:
> If I'm reading things right, actually the default behaviour is (when
> no hints are supplied in kernel cmdline) :
>  1. systemd runs fsck on root from initramfs
>  2. systemd mounts root fs ro
>  3. switch-root onto real system
>  4. systemd-fsck-root runs
>  5. systemd-remount-fs remounts / as rw
> 
> Also just noticed another interesting thing -
> systemd-fsck-root.service is only loaded dynamically, when /etc/fstab
> has a non-zero passno for /. So maybe the idea is that anyone running
> a regular and modern dracut/systemd setup sets passno=0 for / in
> fstab, with the knowledge that fsck of / is done by the initramfs.

Tom and me are thought this through a couple of months ago when I
started looking into using Arch's mkinitcpio with systemd. We submitted
a few changes to fsck handling back then.

This is the setup we want to support (this is now the default in a new
Arch installation):
1) fsck in initramfs
2) initramfs mounts rw
3) no re-fsck in the system


This is still supported, for legacy systems that have not been
reconfigured properly:
1) no fsck in initramfs, or no initramfs
2) initramfs or kernel mount ro
3) fsck in the system
4) remount rw in the system


This setup works, but is not optimal:
1) fsck in initramfs
2) initramfs mounts ro
3) re-fsck in the system
4) remount rw in the system
In this case, I always recommend mounting rw right away. However, you
can also configure your fstab to skip fsck - I don't see why anyone
would prefer this though.

For your read-only case, you have two options:

* Have an fstab entry for / with passno=0
* Don't list / in fstab

I prefer the last option, since there is no benefit in adding / to fstab
- IMO, the correct mount options should always be given via the kernel
commandline to make remounting unnecessary.

In my opinion, there is no need to change anything in systemd here,
since all the right configuration options are already there.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140703/45fd3982/attachment.sig>


More information about the systemd-devel mailing list