You are not logged in.

#1 2023-12-24 13:15:36

Oddwierdo
Member
Registered: 2023-07-29
Posts: 40

A few questions about fsck/fstab/tune2fs and how it "works".

Out of curiousity i started to read about fsck on the arch wiki and stumbled over some things i don't really understand so i'd appreciate if someone could help me out.
According to the Arch-Wiki fsck is set to be done every 30 reboots. Which i guess is set via tune2fs? But i have a hard time understanding what ftsab does and what role it plays in the end:

As far as my understanding goes. The setting in fstab determines the order in which fsck runs but alos if it runs at all?  So depending on what number is set in the sixth column it will either 0 not scan, 1 scan first, 2 scan afterwards.
For example:

/dev/sda1   /         ext4      defaults       0  1
/dev/sda2   /other    ext4      defaults       0  2
/dev/sda3   /win      ntfs-3g   defaults       0  0

Though what happens when tune2fs is set to check every 30 reboots while ftsab is set to 0? Is there any priority?  Would the Filesystem still get checked every 30 mounts? And wouldn't fsck cause trouble on  encrypted drives when it is set on by default?

Offline

#2 2023-12-24 22:04:08

ponyrider
Member
Registered: 2014-11-18
Posts: 112

Re: A few questions about fsck/fstab/tune2fs and how it "works".

Archlinux does this by default by setting hooks in mkinitcpio. See https://wiki.archlinux.org/title/Fsck

tune2fs with the -c flag invokes e2fsck. e2fsck is loaded as a mkinicpio hook from /usr/lib/initcpio/install/fsck.

The takeaway is that tune2fs is just a frontend tool for administrators.

Oddwierdo wrote:

Though what happens when tune2fs is set to check every 30 reboots while ftsab is set to 0?

it skips it

Oddwierdo wrote:

I there any priority?

Yes, root filesystem is first. Read about the -A flag in $ man fsck

Oddwierdo wrote:

Would the Filesystem still get checked every 30 mounts?

See point 1. if it's 0, then no

Oddwierdo wrote:

And wouldn't fsck cause trouble on  encrypted drives when it is set on by default?

Volume is decrypted first

Offline

Board footer

Powered by FluxBB