Recurring need to run fsck because system won't boot
To answer your last question first, a fsck
is a file system check, not a disk check. You can of course check your whole disk, but fsck
will check and possibly repair each file system separately, possibly in parallel.
Encountering bad blocks at each run of fsck
does indicate a hardware failure. The contents of a bad block are copied to an available good block, and then the block is marked as "bad", meaning the file system software will no longer use it. So the number of bad blocks on your disk seems to increase. You may want to verify that you have proper backups.
fsck
Let's repair your file system (again)...
- boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode
- open a
terminal
window by pressing Ctrl+Alt+T - type
sudo fdisk -l
- identify the /dev/sdXX device name for your "Linux Filesystem"
- type
sudo fsck -f /dev/sda1
, replacingsdXX
with the number you found earlier - repeat the
fsck
command if there were errors - type
reboot
Bad blocks and SMART Data
The SMART Data indicates what would normally be a failing HDD. However, we have an SSD that's not too old. We'll look at solving NCQ errors first.
Note: Determine the manufacturer and model # of the SSD, and then visit their web site to check for updated firmware.
Note: Maintain good backups, just in case the SSD is failing.
NCQ errors
grep -i FPDMA /var/log/syslog*
/var/log/syslog:Sep 21 13:40:19 adam-gregs-better-computer kernel: [ 728.921941] ata3.00: failed command: READ FPDMA QUEUED
/var/log/syslog:Sep 21 13:40:19 adam-gregs-better-computer kernel: [ 729.213899] ata3.00: failed command: READ FPDMA QUEUED
Native Command Queuing (NCQ) is an extension of the Serial ATA protocol allowing hard disk drives to internally optimize the order in which received read and write commands are executed.
Edit sudo -H gedit /etc/default/grub
and change the following line to include this extra parameter. Then do sudo update-grub
to write the changes to disk. Reboot. Monitor hangs/etc., and watch grep -i FPDMA /var/log/syslog*
or dmesg
for continued error messages.
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash libata.force=noncq"