Score:0

read-only filesystem - unrecovered read error - auto reallocate failed

cn flag
epx

Our Ubuntu turned to read-only filesystem.

I checked the dmesg log and found the following:

kernel: ata5.00: exception Emask 0x0 SAct 0x200000 SErr 0x0 action 0x0
kernel: ata5.00: irq_stat 0x40000008
kernel: ata5.00: failed command: READ FPDMA QUEUED
kernel: ata5.00: cmd 60/08:a8:68:08:80/00:00:3f:00:00/40 tag 21 ncq dma 4096 in
                 res 51/40:08:68:08:80/00:00:3f:00:00/40 Emask 0x409 (media error) <F>
kernel: ata5.00: status: { DRDY ERR }
kernel: ata5.00: error: { UNC }
kernel: ata5.00: configured for UDMA/133
kernel: sd 4:0:0:0: [sda] tag#21 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: sd 4:0:0:0: [sda] tag#21 Sense Key : Medium Error [current] 
kernel: sd 4:0:0:0: [sda] tag#21 Add. Sense: Unrecovered read error - auto reallocate failed
kernel: sd 4:0:0:0: [sda] tag#21 CDB: Read(10) 28 00 3f 80 08 68 00 00 08 00
kernel: blk_update_request: I/O error, dev sda, sector 1065355368 op 0x0:(READ) flags 0x3000 phys_seg 1 prio clas>
kernel: EXT4-fs error (device sda1): ext4_wait_block_bitmap:519: comm kworker/u16:0: Cannot read block bitmap - b>
kernel: ata5: EH complete
kernel: Aborting journal on device sda1-8.
kernel: EXT4-fs (sda1): Remounting filesystem read-only

Tried getting smartctl data but wasnt installed (and can't install now).

The only info I get from all that is: Unrecovered read error - auto reallocate failed

I havent turned off the computer yet... but does this mean the hard disk is dieing? Can a fcsk fix it? Is there anything relevant from the log that I am missing? Or should I start looking for a new drive?

heynnema avatar
ru flag
Please see my answer. If it's helpful, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
heynnema avatar
ru flag
Status please...
heynnema avatar
ru flag
Status please...
Score:1
ru flag

NCQ Errors

kernel: ata5.00: failed command: READ FPDMA QUEUED
kernel: ata5.00: cmd 60/08:a8:68:08:80/00:00:3f:00:00/40 tag 21 ncq dma 4096 in

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"

File System Check

  • 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, replacing sdXX with the number you found earlier
  • repeat the fsck command if there were errors
  • type reboot

Bad Block

Note: do NOT abort a bad block scan!

Note: do NOT bad block a SSD

Note: backup your important files FIRST!

Note: this will take many hours

Note: you may have a pending HDD failure

Boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode.

In terminal...

sudo fdisk -l # identify all "Linux Filesystem" partitions

sudo e2fsck -fcky /dev/sdXX # read-only test

or

sudo e2fsck -fccky /dev/sda1 # non-destructive read/write test (recommended)

The -k is important, because it saves the previous bad block table, and adds any new bad blocks to that table. Without -k, you loose all of the prior bad block information.

The -fccky parameter...

   -f    Force checking even if the file system seems clean.

   -c    This option causes e2fsck to use badblocks(8) program to do
         a read-only scan of the device in order to find any bad blocks.
         If any bad blocks are found, they are added to the bad block
         inode to prevent them from being allocated to a file or direc‐
         tory.  If this option is specified twice, then the bad block scan
         will be done using a non-destructive read-write test.

   -k    When combined with the -c option, any existing bad blocks in the
         bad blocks list are preserved, and any new bad blocks found by
         running badblocks(8) will be added to the existing bad blocks
         list.

   -y    Assume an answer of `yes' to all questions; allows e2fsck to be
         used non-interactively. This option may not be specified at the
         same time as the -n or -p options.
epx avatar
cn flag
epx
e2fsck is still running... 70% and its showing 280/0/0 errors. Not sure what to do once it finishes
heynnema avatar
ru flag
@epx How long has it been running? How big is the disk? How old is the disk?
heynnema avatar
ru flag
@epx Once e2fsck finishes, reboot, do the NCQ patch, reboot, backup your important files FIRST.
epx avatar
cn flag
epx
Thank you @heynnema Should I worry about those 286/0/0 errors and start thinking about getting a new hard drive and clone this one before it stops working?
heynnema avatar
ru flag
@epx Before I respond to that question... please answer the 3 questions that I asked 3 hours ago. Does it boot now? Thanks.
epx avatar
cn flag
epx
Thank you. It's a 2TB, 5 years old disk, that has been running for at least 4.5 years.
heynnema avatar
ru flag
@epx Does the computer boot now? Did you backup your important files?
epx avatar
cn flag
epx
I think e2fsck is stuck. it shows `Error reading block 77039 (Input/out error). Ignore error? yes` and then `Force rewrite? yes` Been there for at least 3 hours now. I have not tried stopping it and booting. And yes I backed up everything I needed.
heynnema avatar
ru flag
@epx Replace the disk.
epx avatar
cn flag
epx
Thanks for the help @heynnema
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.