24.3 Disk Errors

On reboot a check will be made to determine whether a disk needs to be checked for errors. This will usually be after every fixed number of reboots or after a fixed amount of time. The fsck is run and can take some time.

On login we might see a message like:

*** /dev/sdc1 will be checked for errors at next reboot ***

On belinos I have been seeing this message for some time [120819] and yet the disk is not checked on a reboot.

Note that a check can be triggered on the root partition if there is a file forcefsck in the root of the partition. For other partitions, we can unmount the partition, do fsck, then remount it.

The file /var/lib/update-notifier/fsck-at-reboot contains the message re file systems requiring reboots. It is updated by /usr/lib/update-notifier/update-motd-fsck-at-reboot.

Here’s an example of what I did manually:

gjw@belinos: $ sudo dumpe2fs -h /dev/sdc1 | grep -i mount
dumpe2fs 1.42 (29-Nov-2011)
Last mounted on:          <not available>
Default mount options:    (none)
Last mount time:          Sun Aug 19 14:53:23 2012
Mount count:              86
Maximum mount count:      36
gjw@belinos:&nbsp;$ sudo umount /dev/sdc1
gjw@belinos:&nbsp;$ sudo fsck -y -c -f /dev/sdc1
fsck from util-linux 2.20.1
e2fsck 1.42 (29-Nov-2011)
Checking for bad blocks (read-only test):   
11.90% done, 9:13 elapsed. (0/0/0 errors)
/dev/sdc1: Updating bad block inode.
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

/dev/sdc1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdc1: 131/18317312 files (0.0% non-contiguous), 66340569/73262416 blocks
gjw@belinos:&nbsp;$ sudo mount /dev/sdc1
gjw@belinos:&nbsp;$ sudo dumpe2fs -h /dev/sdc1 | grep -i mount
dumpe2fs 1.42 (29-Nov-2011)
Last mounted on:          <not available>
Default mount options:    (none)
Last mount time:          Sun Aug 19 17:02:47 2012
Mount count:              1
Maximum mount count:      36
gjw@belinos:&nbsp;$ sudo /usr/lib/update-notifier/update-motd-fsck-at-reboot


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0