When you log into an Ubuntu box on the command line, the first thing you see is the "message of the day" (motd). It may have something like this in it:
*** /dev/sda1 will be checked for errors at next reboot ***
which doesn't go away even after rebooting. Here is how to solve that problem.
Possibility 1: The message of the day is out of date
In many cases the message of the day is out of date. Disks are actually getting checked (with fsck) at boot, but a stale cache is shown in the message of the day.
/var/lib/update-notifier/fsck-at-reboot contains a cache of the disk check messages. In some cases, this file may not get regenerated properly when its timestamp is wrong. The first thing to try is to remove this file and regenerate it:
sudo rm -f /var/lib/update-notifier/fsck-at-reboot
sudo run-parts /etc/update-motd.d/ | sudo tee /var/run/motd.dynamic
Possibility 2: Disks should be checked but are not
/etc/fstab file contains a "pass" column that controls whether or not each volume should ever be checked. From the fsck documentation:
pass num - Controls the order in which fsck checks the device or partition for errors at boot time. The root device should be 1. Other partitions should be 2, or 0 to disable checking.
This is the last column in
/etc/fstab. If that last value for the drive in question is a
0, change it to a
2 so that the drive actually gets checked next boot.
Possibility 3: Disks should not be checked, but have check intervals set
Finally, there are cases in which disks should never be checked at boot. When I run machines with Amazon AWS or other virtualization, I disable disk checks. Even if disks are set not to be checked by fstab, the message of the day will complain if their check intervals are not also disabled.
I make sure that
/etc/fstab has the
0 in the last column and I use
tune2fs to set the check intervals to
0. There are two types of intervals: time and mount count. Both need to be disabled for each drive:
sudo tune2fs -i 0 /dev/xvda1 # time interval check
sudo tune2fs -c 0 /dev/xvda1 # mount count check
After adjusting those settings, you can run the commands to regenerate the message of the day.