Boot message about disk clean: Can it indicate bad disk?

The message you see comes from the output of fsck filesystem checking and repairing utility (see the last line):

$ sudo fsck -V /dev/sdb6                                                                                                     
[sudo] password for xieerqi: 
fsck from util-linux 2.27.1
[/sbin/fsck.ext4 (1) -- /mnt/HDD] fsck.ext4 /dev/sdb6 
e2fsck 1.42.13 (17-May-2015)
/dev/sdb6: clean, 4580/26566656 files, 38351198/106257408 blocks

This means that your Ubuntu performs check at boot time, and is in fact configured in your /etc/fstab. As stated in man fstab:

The sixth field (fs_passno).

This field is used by fsck(8) to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a fs_passno of 1. Other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. Defaults to zero (don't fsck) if not present.

This answers couple questions as to why this happens and how to get rid of it. Basically, because it checks your root filesystem, which I'm guessing is on /dev/sda2 and you either have Windows partition in /dev/sda1 or swap partition for virtual memory. Of course, you can disable check during boot time with making last column 0 ( provided that you have sudo or root access to edit such important system files). However, I wouldn't recommend it, since after all it shows you health status of your filesystem.

And by the way, the output line you see is somewhat misleading as to what it actually says. What you see is count of inodes, not actual files. Compare output of fsck you see above, with df -i:

$ df -i | grep 'sdb6'                                                                                                        
/dev/sdb6      26566656   4580 26562076    1% /mnt/HDD

Speaking of health, systemctl -a /dev/sd<LETTER><INTEGER> is usually preferred to for checking health of a drive, and is indicated via how close things in VALUE column are close to THRESH column.


Another way to indirectly disable on-boot fsck is to change the period at which those checks are performed. From tune2fs(8):

-c max-mount-counts

Adjust the number of mounts after which the filesystem will be checked by e2fsck(8). If max-mount-counts is 0 or -1, the number of times the filesystem is mounted will be disregarded by e2fsck(8) and the kernel.

Therefore, it probably follows that all you have to do is to run tune2fs -c -1 /dev/sda to disable those messages.

However, according to lwn.net Max Mount Count check may have been disabled by default as far back as 2011 and as mentionied in mikewhatever's answer on related question and the cited tune2fs(8) documentation in the question, there are other potential causes of fsck appearing on boot ( unclean unmount of the filesystem, cable or failing HDD sectors ,etc ).


Side note: there's question around, such as this one, where OS hangs after seeing the /dev/sda1: clean message, and it should be noted that message and boot issue aren't related - in many cases that's an issue with graphics modules installed, particularly in case of Nvidia drivers.