关于GRUB中fsck.mode=force是否覆盖fstab第6列选项的技术问询
fsck.mode=force是否覆盖fstab第6列选项的技术问询 Hey there, great question—let’s break this down clearly so you know exactly what’s happening with your setup!
核心结论
Yes, the fsck.mode=force and fsck.repair=yes kernel parameters you added to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub will completely override the 6th column (passno) settings in /etc/fstab, including your root partition’s 0 value.
具体细节解释
Let’s unpack why this works the way it does:
What the fstab 6th column (passno) does
Thatpassnofield controls when (and if) fsck checks your filesystems on boot:0: Never check the filesystem, no matter what1: Check this filesystem first (reserved for root partitions)2: Check after all1priority partitions are done (for non-root filesystems)
This is the default behavior when no kernel-level fsck overrides are set.
Why GRUB kernel parameters take precedence
Kernel boot parameters likefsck.mode=forceare high-priority, runtime overrides that bypass the normal fstab-based check logic.fsck.mode=forcetells the initramfs’s fsck hook to:Force a filesystem check on all mounted filesystems, regardless of their
passnovalue in/etc/fstabPair that with
fsck.repair=yes, and fsck will automatically fix any detectable, non-critical issues without waiting for user input during boot.Your root partition example
Even though you set your root partition’spassnoto0(which normally skips checks), adding these two GRUB parameters means:- On every boot, your root partition will be scanned for filesystem errors
- If errors are found, fsck will attempt to repair them automatically
Just a quick side note: If you ever want to go back to normal behavior, just remove those two parameters from your GRUB config, run update-grub, and reboot.
备注:内容来源于stack exchange,提问作者Faxopita

