Since upgrading one of my Leap machines 15.3 → 15.4 I’m frequently noticing at boot fsck running on the root partition, although this could be coincidence and unrelated to the upgrade. Apologies for the length of post, but I’ve been trying to understand this issue for the last few days :\ …
This machine uses an ext4 file system with “/” and “/home” on the same physical ssd. Smartctl indicates no problems with the drive and in use the machine shows no obvious signs of problems.
The fsck at boot is being triggered by systemd-fsck-root.service.
Looking through the journal I see this for when systemd-fsck ran:
Oct 23 10:52:17 HP255G7 systemd-fsck[445]: 32G-ROOT contains a file system with errors, check forced.
and looking further back this I believe is the source of the error that triggered the check:
Oct 23 10:13:42 HP255G7 kernel: EXT4-fs error (device sda2): __ext4_find_entry:1660: inode #1966862: comm plasmashell: reading directory lblock 0
“Plasmashell” encompasses rather a lot, so not particularly helpful
I am always able to find a preceding “… kernel: EXT4-fs error (device sda2): …” prior to a boot on which fsck ran, the error message, disregarding date/time, is always almost identical, the inode # is either #1966862 as shown above, or is #1966863.
During a typical KDE session I will generally use the same applications, there is no indication of any problems at all, so I have no idea if the ‘error’ has occurred or not until the next boot/reboot. It’s a system level problem rather user level as this is liable to happen irrespective of which user was logged in.
In a bid to gain further insight I began logging out of KDE switching to a VT and using:
tune2fs -l /dev/sda2 | grep -i 'filesystem state'
prior to shutting down.
When the error did occur in that KDE session:
paul@HP255G7:~> sudo tune2fs -l /dev/sda2 | grep -i 'filesystem state'
Filesystem state: clean with errors
paul@HP255G7:~>
I shutdown the system and booted from a live USB, established the drive identity and rans fsck manually with the -n (don’t fix) option:
linux@localhost:~> su -
localhost:~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 814.1M 1 loop /run/overlay/squashfs_container
loop1 7:1 0 4.8G 1 loop /run/overlay/rootfsbase
sda 8:0 0 223.6G 0 disk
├─sda1 8:1 0 500M 0 part
├─sda2 8:2 0 32G 0 part
└─sda3 8:3 0 184G 0 part /run/media/linux/184G-HOME
sdb 8:16 1 57.7G 0 disk
├─sdb1 8:17 1 927.5M 0 part /run/overlay/live
├─sdb2 8:18 1 20M 0 part
└─sdb3 8:19 1 56.8G 0 part /run/overlay/overlayfs
localhost:~ # fsck -n -v /dev/sda2
fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
32G-ROOT contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
205566 inodes used (9.80%, out of 2097152)
830 non-contiguous files (0.4%)
202 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 184667/91
1999069 blocks used (23.83%, out of 8388608)
0 bad blocks
1 large file
149925 regular files
21059 directories
0 character device files
0 block device files
2 fifos
11299 links
34237 symbolic links (20464 fast symbolic links)
334 sockets
------------
216856 files
localhost:~ #
Given my limited knowledge of fsck output, that to me looked as if there were no errors found(?)
Running fsck again, this time without the -n option:
localhost:~ # fsck -v /dev/sda2
fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
32G-ROOT contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
205566 inodes used (9.80%, out of 2097152)
830 non-contiguous files (0.4%)
202 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 184667/91
1999069 blocks used (23.83%, out of 8388608)
0 bad blocks
1 large file
149925 regular files
21059 directories
0 character device files
0 block device files
2 fifos
11299 links
34237 symbolic links (20464 fast symbolic links)
334 sockets
------------
216856 files
localhost:~ #
Finally running once more and the filesystem is clean with no ‘errors’:
localhost:~ # fsck -v /dev/sda2
fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
32G-ROOT: clean, 205566/2097152 files, 1999069/8388608 blocks
localhost:~ #
Wondering where to go next… I don’t really want to reformat the root partition and reinstall unless absolutely necessary.
…