2

When Ubuntu boots up, all is well. But when system is up for more than a few hours, the Hard Disk including root filesystem and swap partition become read-only. The GUI desktop disappears, and some messages like I/O error , Read-only filesystem etc appears and freezes without the power button. When I press power button in such sutuation some more messages popup. I am using a laptop.

Here is the screenshot of one of that times when this occured:

Screenshot when error occurred

I tried to find the cause of problem according this answer and found this:

I booted into Ubuntu 18.04 Live CD.

This is the output of fsck -f /dev/sdXX :

$ sudo fsck -f /dev/sda5
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda5: 567831/2187264 files (0.4% non-contiguous), 6372147/8728576 blocks

I also checked the return code:

$ echo $?
0

Then I rebooted and started Disks application in live CD. These are the screenshots of HDD SMART data:

HDD SMART data 1

HDD SMART data 2

Then when booted into my Ubuntu 20.04 installtion and noticed, a message like Initramfs unpacking failed: Decoding failed appeared before appearing the boot logo and disappeared within seconds.

I executed sudo grep -i FPDMA /var/log/syslog* on terminal and it gave no output.

I booted into Live CD again and executed sudo e2fsck -fccky /dev/sda5 and it gave following output:

$ sudo e2fsck -fccky /dev/sda5
e2fsck 1.44.1 (24-Mar-2018)
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: done                                                 
/dev/sda5: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/sda5: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda5: 591731/2187264 files (0.4% non-contiguous), 6484554/8728576 blocks

It gave 0 return code:

$ echo $?
0

I returned to Ubuntu 20.04 and executed sudo fdisk -l which gave following output:

$ sudo fdisk -l
Disk /dev/loop0: 9.7 MiB, 9510912 bytes, 18576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 28.92 MiB, 30306304 bytes, 59192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 91.32 MiB, 95748096 bytes, 187008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 93.94 MiB, 98484224 bytes, 192352 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 54.66 MiB, 57294848 bytes, 111904 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 54.97 MiB, 57618432 bytes, 112536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 140.68 MiB, 147496960 bytes, 288080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 140.68 MiB, 147501056 bytes, 288088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500LM012 HN-M5
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A85852AC-BAD1-11E9-B49D-FE4A252694FC

Device         Start       End   Sectors   Size Type
/dev/sda1       2048 843642879 843640832 402.3G Microsoft basic data
/dev/sda2  843642880 844990463   1347584   658M Windows recovery environment
/dev/sda3  844990464 865961983  20971520    10G Windows recovery environment
/dev/sda4  865961984 872089599   6127616   2.9G Microsoft basic data
/dev/sda5  904894464 974723071  69828608  33.3G Windows recovery environment
/dev/sda6  974723072 976771071   2048000  1000M EFI System
/dev/sda7  872089600 904894463  32804864  15.7G Linux filesystem

Partition table entries are not in disk order.




Disk /dev/loop8: 160.16 MiB, 167931904 bytes, 327992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop9: 255.58 MiB, 267980800 bytes, 523400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop10: 4.2 MiB, 4403200 bytes, 8600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop11: 2.45 MiB, 2555904 bytes, 4992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop12: 14.77 MiB, 15466496 bytes, 30208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop13: 276 KiB, 282624 bytes, 552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop14: 956 KiB, 978944 bytes, 1912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop15: 956 KiB, 978944 bytes, 1912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop16: 3.66 MiB, 3825664 bytes, 7472 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop17: 2.17 MiB, 2273280 bytes, 4440 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop18: 62.9 MiB, 65105920 bytes, 127160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop19: 34.55 MiB, 36216832 bytes, 70736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Update: This happens when I do excessive read and write operation on virtual hard disk. (E.g. while using virtual machine)

37
  • I would guess that 1) your hard drive is full or 2) you have a hardware error. If the hard drive is not full, try booting from a "live" OS and run diagnostics on the hard drive. It is possible that your dev/sda5 device has one or more bad sectors.
    – user573739
    May 25, 2020 at 15:35
  • Please do my answer. Edit the output/screenshots into your question. Your HDD may be failing. Start comments to me with @heynnema or I'll miss them.
    – heynnema
    May 25, 2020 at 15:36
  • @heynnema I have added fsck output. I will add screenshots of HDD SMART data very soon. May 25, 2020 at 16:59
  • Thanks. Let me know...
    – heynnema
    May 25, 2020 at 17:01
  • 1
    @heynnema I agree with you. I think this is caused by upgrade to 20.04 as I described in a previous comment. While upgrading, the process was interrupted when dpkg was installing packages. Then I reinstalled all package downloaded by do-release-upgrade . Maybe this is cause. Jul 25, 2020 at 5:37

1 Answer 1

1

Let's first check your file system...

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

Then let's look at the HDD SMART Data...

Start the Disks application, select your HDD, go to the "hamburger" icon and select SMART Data & Tests. Edit your question with screenshot(s) of the SMART Data.

Read/write errors. No NCQ errors.

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/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 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.
4
  • fsck doesn't have the -f option?
    – Danijel
    Oct 19, 2022 at 15:37
  • @Danijel Did you try it with the -f option?
    – heynnema
    Oct 19, 2022 at 20:33
  • I didn't because I don't know what it does ("force"?). I tried man fsck, but there is no explanation about -f.
    – Danijel
    Oct 20, 2022 at 6:35
  • @Danijel If you check man e2fsck you'll see it. Also, the explanation was in my answer.
    – heynnema
    Oct 20, 2022 at 11:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .