@ananthp I’m going to start with the ending first Bottom-line: a fsck
is not done automatically on the root file system on a Manjaro distribution running systemd.
I did a search in the archived forum and found some helpful information. Copy and paste the link/URL into your browser’s address bar to view the topic. You might want to look at the search results for more topics.
-
Search mkinitcpio hook fsck:
https://archived.forum.manjaro.org/search?q=mkinitcpio%20hook%20fsck
-
Changes made to Grub-Quiet:
https://archived.forum.manjaro.org/t/changes-made-to-grub-quiet/59925/1
-
Why is “fsck” hook not enabled by default?:
https://archived.forum.manjaro.org/t/why-is-fsck-hook-not-enabled-by-default/148753
I think, in a systemd world, what will happen with a defective disk is that the system will boot, if it can, to the system target emergency or rescue, where you can shutdown and boot from a live disk or USB to examine, save what you can (hopefully you have backups), possibly “repair”.
Failures don’t normally happen all at once. You’ll notice hangs and strange behavior. You also might want to check smartctl in the Official Repositories.
https://www.smartmontools.org/
The output from systemctl status systemd-fsck-root.service
is saying the service was not run because the root filesystem is not mounted as ro (!=Not /=root ro=ReadOnly). See below.
Following the archwiki mentioned by @cscs and @Wollie, option #2 is the default for Manjaro, but action must be taken to modify grub menu at boot (temporary) or the grub file (permanent).
Temporary
Edit the grub menu at boot time. Be very careful. When the menu appears type e
.
- Keys
– E = edit
– F10 = save/boot
– ESC = discard
– End key or Ctrl-E goes to the end of the line
– arrow keys work
Scroll to find the line. The line may look like:
/boot/vmlinuxz-5.4-86_64 root=UUID=.... rw
Go to the end of the line and arrow back to change the rw
to ro
.
You might be thinking, where is this grub menu at boot I believe, by default, the grub menu is not displayed (see link above). You could try the ESC key right away at boot to get the menu to appear.
One of the first things I changed in Manjaro (or any Linux distribution) is all the quiet boot stuff, because of the nature of my environment I need to see it, plus a couple seconds at boot verses not seeing it is well worth it.
Permanent
To run every time, edit the grub menu file. The links below will help (notice the file name and the update-grub command). I’m sure there are more details in a search at https://archived.forum.manjaro.org
.
-
GRUB Menu Not Showing On Boot, Boots into Default Kernel Instead
https://forum.manjaro.org/t/grub-menu-not-showing-on-boot-boots-into-default-kernel-instead/13410/2
-
Grub Tips and Tricks
https://wiki.archlinux.org/index.php/GRUB/Tips_and_tricks
As far as Option #1 goes, I played with it on Archlinux first. #1 is the default on Archlinux. A user would need to run mkinitcpio which is a highly technical thing to do to get the hook on Manjaro, and it would have to be done for each kernel. It creates initramfs which grub loads from the initrd parameter in the grub file.
The sequence of events at boot: grub >initramfs >linux_kernel >systemd (init replacment)
-
See what hooks are already installed:
less -g --pattern='^HOOKS=' /etc/mkinitcpio.conf
-
List available hooks:
mkinitcpio --listhooks
-
List help for hooks:
mkinitcpio --hookhelp fsck
At boot, I added fsck.mode=force rd.log=all
. If I wanted this permanent I’d add it to the boot file.