2

Screen text reads:

Error reading block 23108274 (input/output error). 
/dev/sda5: UNEXPECTED INCONSISTENCY; run fsck MANUALLY

and:

fsck excited with status code 4
done
Failure: file system check of the root filesystem failed
The root filesystem on /dev/sda5 requires a manual fsck

At browsing Ask Ubuntu, I found similar problems mentioned but none of the previous solutions work.

After I tried the exit command, this was the result:

enter image description here

However, I retried the exit command, and then used "reboot", which got me stuck on the following screen :

enter image description here

As I'm told that each reboot aggravates the problem, I feel hesitant to force a shutdown.

I had no other option but to pull the plug. At restart, I got to an "enter setup f2" message on the bottom left, which I did. Within setup, I hit some of the keys to navigate. The system responded so slow that I doubt whether it did so at all and instead shifted through the different tabs at random. I managed to exit setup, and now find myself staring at this:

enter image description here

It took me some time but I now have an Ubuntu Live USB.

karel
  • 114,770
guf
  • 53
  • I would boot a live media and fsck from there (or if dual boot, boot and run it from another OS on your system, eg. my system has Ubuntu groovy I'm using now & Ubuntu 18.04 LTS, I could fsck this partition after booting 18.04). I'd also check the health of your drive (unless you know a reason for your issue, such as machine being turned off). IO error implies hardware issue to me, thus the SMART suggestion https://help.ubuntu.com/community/Smartmontools – guiverc Sep 12 '20 at 09:50
  • 2
  • Edit your question and show me screenshot(s) of the Disks app scrollable SMART Data window. Start comments to me with @heynnema or I'll miss them. – heynnema Sep 12 '20 at 19:15
  • @heynnema I had no other choice but to unplug. This led me to setup which, after exiting, gave me: OS not found. – guf Sep 13 '20 at 10:05
  • Where you able to do the fsck from my answer, below? Does the BIOS recognize that your disk is there, and enabled? HDD or SSD? How big? Desktop or laptop computer? Are you still getting the initramfs prompt? Do you have a Ubuntu Live DVD/USB? – heynnema Sep 13 '20 at 15:03
  • @heynnema: No, I never got to the fsck option anymore. How do I find out whether Bios recognises the disk? I know neither the disk type nor its size. It is a laptop. I no longer get the initramfs prompt. Don't have an Ubuntu Live device. Probably you already guessed this, but I'm not the most tech-savvy Ubuntu user. – guf Sep 13 '20 at 16:11
  • Enter the BIOS, and look for something like a hardware configuration tab/page. There you should find which devices it sees, and if they're enabled or not. Without a Ubuntu Live DVD/USB, you can't do much. – heynnema Sep 13 '20 at 16:15
  • @heynnema: I'll first create an Ubuntu Live usb. Will be for tomorrow though, as I've to go to the library to use a computer. – guf Sep 13 '20 at 16:56
  • Let me know after you've successfully booted to the Ubuntu Live, and I'll give you more instruction. – heynnema Sep 13 '20 at 17:02
  • @heynnema : will do. Thanks for your help thus far. Greatly appreciated! – guf Sep 13 '20 at 17:57
  • @heynnema : I now have an Ubuntu Live usb and will try to access the drive according your suggestions. I'll keep you posted. – guf Sep 17 '20 at 11:29
  • @guf Status please... – heynnema Sep 20 '20 at 01:23
  • @guf Status please... regarding PXE boot error... see my Update #1 in my answer. – heynnema Sep 24 '20 at 14:23

2 Answers2

5

First we repair the disk with fsck. Then we fix the NCQ errors. Then we bad block the disk.

fsck

At the initramfs prompt, type:

fsck /dev/sda5

NCQ

You have NCQ disk errors.

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, and watch /var/log/syslog or dmesg for continued error messages.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash libata.force=noncq"

badblock

  • 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/sda5 # 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 means:

   -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.

Update #1:

When you were in the BIOS, you accidentally changed the boot order, and now you're getting the PXE boot error. Go back to the BIOS and change the boot order back to something like: DVD/USB/Disk/PXE

heynnema
  • 70,711
  • I had a similar issue. I ended up booting from grub into recovery mode, which dropped me into a bash shell. I ran fsck /dev/sda1 and auto repaired all errors. I was safe to do this as I had just restore the disk from a compressed backup using dd. After fixing drive errors, I rebooted normally and everything was fine. – lacostenycoder Mar 11 '23 at 07:16
0

You must force fsck to run at system boot.

For that you must create a file called forcefsck in the root partition of the system with the following commands in a terminal:

cd /
sudo touch /forcefsck
sudo reboot
kyodake
  • 15,401
  • After CD / nothing happens. The (initramfs) prompt remains. From there, both sudo commands results in: "sh: sudo: not found" – guf Sep 12 '20 at 17:19
  • I personally wouldn't recommend even a touch on a dirty file-system. I would recommend cleaning the fs first before this should be applied, as the touch (though minimal) may make issues worse. – guiverc Sep 12 '20 at 22:12