You are not logged in.

#1 2018-10-31 09:37:15

markand
Member
Registered: 2015-04-09
Posts: 28

Disabling fsck hook and using systemd-fsck services instead

Hello,

I was reading the Silent boot page to make my boot as silent as possible. I've disabled the fsck hook in mkinitcpio.conf to avoid the message "/dev/sda2: clean ... files ..." and passed ro argument as kernel parameter as stated in the documentation.

The systemd-fsck-root.service runs correctly at boot and I don't have any messages anymore. It also says that my filesystem is clean.

$ systemctl status systemd-fsck-root.service 
● systemd-fsck-root.service - File System Check on Root Device
   Loaded: loaded (/usr/lib/systemd/system/systemd-fsck-root.service; enabled-runtime; vendor preset: disabled)
   Active: active (exited) since Wed 2018-10-31 10:29:21 CET; 3min 18s ago
     Docs: man:systemd-fsck-root.service(8)
  Process: 233 ExecStart=/usr/lib/systemd/systemd-fsck (code=exited, status=0/SUCCESS)
 Main PID: 233 (code=exited, status=0/SUCCESS)

Oct 31 10:29:21 arch systemd-fsck[233]: /dev/sda2: clean, 206603/3244032 files, 2370706/12975867 blocks
Oct 31 10:29:21 arch systemd[1]: Started File System Check on Root Device.

$ systemctl status systemd-fsck@dev-sda1.service 
● systemd-fsck@dev-sda1.service - File System Check on /dev/sda1
   Loaded: loaded (/usr/lib/systemd/system/systemd-fsck@.service; static; vendor preset: disabled)
   Active: active (exited) since Wed 2018-10-31 10:29:25 CET; 3min 44s ago
     Docs: man:systemd-fsck@.service(8)
  Process: 306 ExecStart=/usr/lib/systemd/systemd-fsck /dev/sda1 (code=exited, status=0/SUCCESS)
 Main PID: 306 (code=exited, status=0/SUCCESS)

Oct 31 10:29:24 arch systemd[1]: Starting File System Check on /dev/sda1...
Oct 31 10:29:25 arch systemd-fsck[306]: fsck.fat 4.1 (2017-01-24)
Oct 31 10:29:25 arch systemd-fsck[306]: /dev/sda1: 13 files, 10370/130812 clusters
Oct 31 10:29:25 arch systemd[1]: Started File System Check on /dev/sda1.

My only naive questions are: I presume systemd-fsck-root service runs the appropriate fsck.ext4 command after initramfs was loaded and / mounted read-only.

  • What happens if the file system is not clean and you need to boot as rescue systemd target? Will it also call fsck before remounting rw?

  • Is it safe that file system is checked within the system boot up instead of initramfs?

  • I have tested this on a virtual machine, on my own laptop I also encrypted my root partition, will it still work or I absolutely need fsck hook in my initramfs?

Cheers,

Offline

#2 2018-10-31 12:34:07

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,386
Website

Re: Disabling fsck hook and using systemd-fsck services instead

Mod note: Not an installation issue, moving to Kernel/Hardware.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2018-11-01 07:52:47

markand
Member
Registered: 2015-04-09
Posts: 28

Re: Disabling fsck hook and using systemd-fsck services instead

After some experiments, it looks like fsck hook is really needed. If not present, systemd-fsck-root will fails because fsck.ext4 is not there. It does not change anything if kernel parameter is rw or ro. Maybe the decrypt in sd-encrypt process changes the behaviour.

Last edited by markand (2018-11-01 07:53:12)

Offline

Board footer

Powered by FluxBB