Traditional filesystems need to run their respective fsck utility in case the filesystem was not unmounted cleanly and the log needs to be replayed before mount. This is not needed for BTRFS. You should set fs_passno to 0.
If you wish to check the consistency of a BTRFS filesystem or repair a damaged filesystem, see btrfs-check(8). By default filesystem consistency is checked, the repair mode is enabled via the –repair option (use with care!).
Any input on the subject is important, since this is a system critical modification (if we decide to apply it on Garuda systems and ISOs).
What are the effects we may have in other Garuda utilities/applications?
There is also systemd that does fsck on boot.
As in the explanation:
Boot time checking
Mechanism
There are two players involved:
mkinitcpio offers you the option to fsck your root file system before mounting it via the fsck hook. If you do this, you should mount root read-write via the appropriate rw kernel parameter.[1]
systemd will fsck all file systems having a fsck pass number greater than 0 (either with #fstab options or a user-supplied unit file). For the root file system, it also has to be mounted read-only initially with the kernel parameter ro and only then remounted read-write from fstab (note that the defaults mount option implies rw).
The first option is the recommended default, and what you will end up with if you follow the Installation guide. If you want to go with option 2 instead, you should remove the fsck hook from mkinitcpio.conf and use ro on the kernel command-line. The kernel parameter fsck.mode=skip can be used to make sure fsck is disabled entirely for both options.
That being said, unless it changed recently, fsck.btrfs does nothing useful and exits, returning success so it shouldn't be harmful, just pointless.
It is literally just this:
AUTO=false
while getopts ":aApy" c
do
case $c in
a|A|p|y) AUTO=true;;
esac
done
shift $(($OPTIND - 1))
eval DEV=\${$#}
if [ ! -e $DEV ]; then
echo "$0: $DEV does not exist"
exit 8
fi
if ! $AUTO; then
echo "If you wish to check the consistency of a BTRFS filesystem or"
echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'."
fi
exit 0
I understand, when using busybox init (not systemd) in mkinitcpio.conf, you add or exclude fsck from HOOKS to control disk checking. So when you don’t add fsck (with busybox init), the rest of the file systems (not btrfs, added manually) will not be checked. This is something the (inexperienced) user will not know. This is something that the user should know, not left to believe Linux is safe as advertised .
Adding the proper fsck for btrfs in fstab, does no harm and lets us add fsck in mkinitcpio HOOKS, so all the rest fstab fsck directives are gone through.
Your a very good coder @petsam, does the code look problematic to you. My skills are rather basic, but the code looks fine to me. However, you are correct even the best of code can sometimes produce unexpected results. In @dalto 's case I have full confidence in his code as I have never seen him recommend something that wasn't 100% solid. However, I guess it' s possible there could always be a first time.
Because you know me better , you should suspect that I don’t do silly questions (such as wondering if a simple line of code, proposed from a known good coder is safe).
I just wanted to raise the real question
Here is the iso build with the changes if you want to run some tests yourself
I’m proceeding to test an installation with the default “erase disk” option in a VM.