Ubuntu error reading block

A few days ago I was told to update my computer. After the update it told me to restart. As it was restarting it needed to do the routine drive check. So I waited for it to finish but it gave me this instead. error reading block 12877911 (attempt to read block from file system resulted in short read) while getting next inode from scan. mountall: /dev/sda1: fsc/ terminated with status 4 mountall: file system has errors:/ Unit: mountall main process (411) terminated with status 3 mount

Error reading block. Run fsck manually. No idea what to do!

A few days ago I was told to update my computer. After the update it told me to restart. As it was restarting it needed to do the routine drive check. So I waited for it to finish but it gave me this instead.

error reading block 12877911 (attempt to read block from file system resulted in short read) while getting next inode from scan.
mountall: /dev/sda1: fsc/[419] terminated with status 4
mountall: file system has errors:/
Unit: mountall main process (411) terminated with status 3
mount of file system failed
A maintenace shell will now be started.
Control D will terminate this shell and retry
root@sarahlinux:~#

Im running the newest version of ubuntu. I also have dual boot windows 7. Windows 7 wont start either. Ubuntu was installed first.

Thanks!


Re: Error reading block. Run fsck manually. No idea what to do!

Boot to the Live CD, ensure none of your hard disk partitions are mounted and then in terminal run

Code:

sudo fsck /dev/sda1

Report back here any error messages it throws back at you, but hopefully that may solve the problem for you.


Re: Error reading block. Run fsck manually. No idea what to do!

/dev/sda1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error reading block 12877911 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes

Force rewrite<y>? yes

Error reading block 12877912 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes

Force rewrite<y>? yes

Error reading block 12877913 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? no

Error while scanning inodes (3220736): Can’t read next inode
e2fsck: aborted
ubuntu@ubuntu:~$

Last edited by Saraslife; March 17th, 2010 at 11:52 AM.


Re: Error reading block. Run fsck manually. No idea what to do!

I Typed: sudo fsck -y /dev/sda1
fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
/dev/sda1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error reading block 12976554 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976555 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976556 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976557 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976558 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976559 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976560 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976561 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976562 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976563 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976564 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976565 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976566 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976567 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976568 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 12976569 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 357200/4792320 files (2.0% non-contiguous), 2826891/19161520 blocks

Hope this works!


Re: Error reading block. Run fsck manually. No idea what to do!


Re: Error reading block. Run fsck manually. No idea what to do!

I’m very glad it worked, but think you should keep a careful eye on things, and also ensure you have up to date backups of everything, just in case it is your hard disk that is beginning to show signs of failure. Clonezilla perhaps?

If it were mine, I would also be slightly tempted to do a complete backup and format, and then a clean reinstall, though with a new version coming out in 5 weeks, it’s perhaps worth carrying on till then as you are, backed up, of course, and then do a clean install of the new 10.04 in April.


Re: Error reading block. Run fsck manually. No idea what to do!

Quote Originally Posted by ajgreeny
View Post

I’m very glad it worked, but think you should keep a careful eye on things, and also ensure you have up to date backups of everything, just in case it is your hard disk that is beginning to show signs of failure. Clonezilla perhaps?

If it were mine, I would also be slightly tempted to do a complete backup and format, and then a clean reinstall, though with a new version coming out in 5 weeks, it’s perhaps worth carrying on till then as you are, backed up, of course, and then do a clean install of the new 10.04 in April.

Once again good advice from AJGreeny. (how does he do it?? )

There is a thing called smartmontools that gives you good information about the state of your drive. Good to know before you go to the trouble of re-installing.
https://help.ubuntu.com/community/Smartmontools

Michael


Re: Error reading block. Run fsck manually. No idea what to do!

If you’re using Ubuntu 9.10, try installing (if necessary) and using the gsmartcontrol program. This will give you easy access to your hard drives’ built-in error monitoring systems, so that you can see if there are problems developing. On pre-9.10 versions of Ubunto, gsmartcontrol isn’t available as a standard package, so you may need to either hunt it down elsewhere (I’m afraid I don’t have any pointers handy) or use something else, such as the text-mode smartctl program (part of the smartmontools package).


Re: Error reading block. Run fsck manually. No idea what to do!

Quote Originally Posted by srs5694
View Post

If you’re using Ubuntu 9.10, try installing (if necessary) and using the gsmartcontrol program….. such as the text-mode smartctl program (part of the smartmontools package).

These are all referred to on the page that I posted the link to.

Michael


Re: Error reading block. Run fsck manually. No idea what to do!

This worked for me too thank you.


Recently my Linux desktop computer can’t mount my 5TB external hard disk drive (HDD), and the file manager displays the “can’t read superblock” error on the screen. I’m going to share with you what I did to fix the error, so if you are in the same situation, this article may help you.

can't read superblock

But before doing that, I want to explain some basic knowledge about hard disk drives and filesystems on Linux, so you will really know what you are doing. If you don’t care about those details, you can jump directly to the solution. A hard disk drive (HDD) is magnetic disk. A solid-state drive (SSD) is electronic disk.

The Structure of Hard Disk Drive

A hard disk drive usually has several circular platters stacked vertically with a spindle that rotates the disk in the center. Each platter is coated with a magnetizable material to record data. Each platter surface is divided into tens of thousands of tracks. It’s like running tracks in sports.

can’t read superblock linux

Hint: Hard disk drives are very complex devices and can be easily damaged if you drop them to the ground.

Each track is divided into sectors. There are typically hundreds of sectors per track and each sector usually has the same length. A sector is the smallest unit for reading data from the disk. That is to say, even if you just need a portion of the data from a sector, the read-write head will read the entire sector to retrieve the data. Traditionally one sector stores 512 bytes of data. In 2009 the industry devised the 4K sector size format known as the advanced format to improve disk reliability and increase capacity. After January 2011, most new hard drives store 4096 bytes of data in one sector.

Physical Sector Size vs Logical Sector Size

Although new hard drives use the 4K advanced format, operating systems still expect a 512 bytes sector size, so the firmware on the HDD divides a 4K physical sector into several logical sectors, typically 512 bytes. On Linux, you can check the physical sector size and logical sector size of an HDD with the fdisk command.

fdisk -l /dev/sda

You can see from the screenshot that the physical sector size of my hard disk is 4096 bytes and the logical sector size is 512 bytes. I/O size is the minimal chunks of data the operating system reads from a disk.

fdisk physical sector size logical sector size

Partition Alignment

Using firmware to produce a logical sector can degrade performance, especially when file system partitions are not aligned with physical sectors. There are two requirements for partition alignment:

  • The number of sectors on each partition must be in multiples of 8 because a physical sector contains 8 logical sectors.
  • The start sector of each partition must be the first logical sector in a physical sector. Since sector 0 is the first sector of the entire disk, this means the start sector of each partition should be a multiple of 8, sector 0, sector 8, sector 16, etc.

When you create partitions on a hard disk drive, you should be aware of the following two partition tables.

  • MBR: Master Boot Record.
  • GPT: GUID Partition Table.

If you buy a new hard disk, it’s recommended to use the newer GPT format to partition your hard disk. Both MBR and GPT will use some sectors at the beginning of the disk, so you should leave some empty space (like 1MiB) before the first partition.  To create partitions that will be aligned with the physical sector, use sector as the unit when you partition your disk.

You can quickly check if your disk partitions are aligned with physical sectors with the parted (partition editor) utility. parted is a disk partition editor that supports multiple partition table formats, including MBR and GPT.

First, tell parted to use your disk. I use my/dev/sdb as an example.

parted /dev/sdb

Then type p to print the partition table on the disk. And run the following command to check partition alignment.

align-check opt partition-number

Type q to quit.

As you can see from the screenshot below, the first two partitions are not properly aligned. The third partition is aligned.

parted alignment check

SSD Partition Alignment

Note that the structure of SSD is very different than that of an HDD. The smallest unit of an SSD module is called a cell. Consecutive cells form a page, many of which are organized into a block. Read and write operations are executed at the page level. The page size of an SSD varies from manufacturer to manufacturer and from model to model. There’s no straightforward way to check page size using the Linux command line, because the flash translation layer makes the OS think the SSD is a traditional hard disk. The OS doesn’t understand SSD pages and still uses sectors to describe locations on SSD.

Common page sizes are 8KiB, 16KiB, 32KiB. It’s also very important to have aligned partitions on SSD. If partitions are misaligned, then there will always be one extra page to read or write. Not only will it degrade performance, but also decreases the life span of SSD. To properly align partitions on SSD, all you need to do is to leave one empty page (e.g. 32KiB) at the start of SSD and make sure the size of every partition on SSD is multiples of the page size.

When you use GParted to create the first partition on SSD, it automatically leaves 1MiB empty space before the first partition, which is 32 empty pages (32 KiB * 32 = 1024 KiB). This is fine. The following screenshot shows creating an EFI system partition (ESP) for a UEFI computer. The partition size is 512MiB with a FAT32 file system.

ssd partition alignment in gparted

Blocks in Filesystem

There’s a concept in filesystem called block, which is similar to a sector on disk drives. Many folks are confused by these two concepts. It’s not really that hard to understand the difference. When you create a partition on a disk, you can use sectors to define its size. If you format a partition with a file system, blocks will be created.

Operating system and file system access data on the disk in blocks rather than in sectors. A block is usually a multiple of sector. So why don’t we just access data in sectors? Well, the block can abstract away the physical details of the disk. If you address a sector (find out the address of a sector), you need to use the CHS scheme (cylinder-head-sector). This is because a hard disk drive has multiple platters. You need to know which platter and track the sector is located at. If you address a block, you just use block 0, block 1, block 2, etc, without having to know the physical details of the disk. Each block is mapped to a sector (or several sectors) with the logical block addressing (LBA) scheme.

Superblock

The first block of a disk or of a partition is called the superblock, and it’s the primary superblock. Superblock can be damaged like in a sudden power outage, so there are backup copies of the superblock in a block group.

  • primary superblock
  • backup superblock

Can’t read superblock

There can be several reasons why your OS can’t read the superblock on your HDD.

  • The HDD is dropped to the ground and the superblock is damaged. This is usually physical damage to the corresponding sectors on the disk.
  • There’s a sudden power outage. Because the superblock is cached in RAM, if a power outage happens, there might be important changes to the superblock that hasn’t been written to the disk.

can't read superblock

If the primary superblock is damaged, you can’t mount the filesystem, and the operating system will probably tell you that it “can’t read superblock” if you try to mount the filesystem. We need to recover the bad superblock from backup copies. The following instructions show how to recover superblock for ext4 and Btrfs file system. My HDD is an external hard disk. If the damaged filesystem is your root file system, you need to boot your computer from a Linux Live USB stick.

Recover superblock on ext4 filesystem

Find out the device name of the damaged partition.

sudo parted -l

Determine the location of the backup superblocks.

sudo mke2fs -n /dev/xxx

For example, the device name of my HDD partition is /dev/sdb1, so I run

sudo mke2fs -n /dev/sdb1

It will tell you that the partition contains an ext4 file system, press y to continue. Don’t worry the -n option tells mke2fs not to create a file system.

mke2fs 1.45.5 (07-Jan-2020)
/dev/sdb1 contains a ext4 file system labelled 'Stretch'
	last mounted on /media/linuxbabe/b43e4eea-9796-4ac6-9c48-2bcaa46353732 on Thu Jan 28 02:43:43 2021
Proceed anyway? (y,N) y
Creating filesystem with 7864320 4k blocks and 1966080 inodes
Filesystem UUID: fcae3dc8-ee11-412c-97f0-27106601314e
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

At the bottom, you can see the location of backup superblocks. Next, restore the superblock from the first backup copy.

sudo e2fsck -b 32768 /dev/xxx

Now you should be able to mount your ext4 partition.

Recover superblock on btrfs filesystem

Find out the device name of the damaged partition.

sudo parted -l

Install a Btrfs utility.

sudo apt install btrfs-progs

Then run the following command to recover superblock.

sudo btrfs rescue super-recover -v /dev/xxx

If it tells you “All supers are valid, no need to recover”, then check the syslog.

sudo dmesg

You might find the following message, which indicates the log tree is corrupted, so it can’t replay the log.

BTRFS: error (device sdb1) in btrfs_run_delayed_refs:2227: errno=-5 IO failure
BTRFS: error (device sdb1) in btrfs_replay_log:2287: errno=-5 IO failure (Failed to recover log tree)

Then you need to run the following command to clear the filesystem log tree.

sudo btrfs rescue zero-log /dev/xxx

btrfs rescue clear the filesystem log tree

Now you should be able to mount your Btrfs file system.

If there’s periodic IO failure for your Btrfs file system, you can add a crontab job to automatically clear the file system log tree once a day.

sudo crontab -e

Add the following line at the end of the crontab file.

@daily umount /dev/xxx && btrfs rescue zero-log /dev/xxx && mount -a

Save and close the file.

Backing Up Files on your Disk

To prevent data loss, it’s recommended to use a tool like Duplicati to automatically back up your files to cloud storage. Duplicati will encrypt your files to prevent prying eyes.

  • How to Use Duplicati to Back Up Files on Debian, Ubuntu, Linux Mint

External HDD becomes Read-only?

Sometimes there can be error in the file system so Linux can only mount the external HDD in read-only mode. To fix it, you need to unmount the external HDD, then use the e2fsck command-line utility to fix the file system errors.

For example,

sudo e2fsck /dev/sdb1

then answer y to optimize or fix the file system, and you will be able to mount the external HDD in writable mode.

Tip

  • Some motherboards can still charge USB devices when you shut down the operating system. If you have an external HDD, it’s recommended to turn off electricity for USB devices when shut down, so your external HDD can stop spinning. This is good for its life span. For example, I have an ASUS PRIME z270 motherboard. I go to the UEFI advanced settings section and disable “charging USB devices in power state s5”.

Wrapping Up

I hope this tutorial helped you fix the “can not read superblock” error on Linux. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

When I tried to move one of my partitions, I got some error messages. Here are some extracts:

Move /dev/sda7 to the left  00:05:09    ( ERROR ) 

(…)

check file system on /dev/sda7 for errors and (if possible) fix them  00:00:10    ( SUCCESS )    
   e2fsck -f -y -v /dev/sda7

(…)

move file system to the left  00:04:52    ( ERROR )             
perform read-only test  00:04:52    ( ERROR )
   using internal algorithm    
   read 114013242 sectors    
   finding optimal blocksize 

(…)

read 113357882 sectors using a blocksize of 1024 sectors  00:04:36    ( ERROR ) 
   22527034 of 113357882 read    
   Error while reading block at sector 385849832    
23182394 sectors read    ( ERROR )  

(…)

libparted messages    ( INFO )          
   Input/output error during read on /dev/sda

What should I do to effectively move my partition?

Amith KK's user avatar

Amith KK

13.2k13 gold badges65 silver badges121 bronze badges

asked Jan 11, 2011 at 18:48

Agmenor's user avatar

1

You have bad sectors on your hard disk. Back up any important data NOW. Then run the disk utility and click the SMART diagnostics. Run the long self test, and when that finishes, look at the values of the following attributes:

Offline_Uncorrectable
Current_Pending_Sector
Reallocated_Sector_Ct

If the uncorrectable count is non zero, or the reallocated or pending counts are more than a few, you need to replace the drive. If there are only a few pending, then you can attempt to repair them. First you need to identify the number of the bad sector. The badblocks utility can be used for this. Then you can use hdparm —read-sector to try reading from it to make sure you have the right one, and then hdparm —write-sector to try and rewrite the sector with zeros. That will force the drive to try to correct the sector, or if it can not, will reallocate it from the spare pool, moving a count from the pending_sectors to reallocated. Repeat for all bad sectors.

answered Jan 11, 2011 at 19:19

psusi's user avatar

psusipsusi

36.5k2 gold badges67 silver badges104 bronze badges

2

This is what actually made me solve my problem. The response of psusi really helped, however it was really too rough for me and I spent something like three hours to get it all and to extract what would be interesting for me from his post. I had to search in Wikipedia, the official Ubuntu Forums and Ask Ubuntu. As a consequence I consider his post as a welcomed hint but not as the right answer.

  • Run Ubuntu on a Live-CD.
  • Using System -> Administration -> Gparted, disable the eventual swap partition (in other words, «swapoff»). Besides, note down the name of your corrupted drive, in my case «sda»
  • In a terminal, run the command sudo badblocks -sv -b 512 <device-name>, where in my case is to be replaced by /dev/sda. After a long time waiting, the result is a list of numbers which are the corrupted sectors.
  • Run the command sudo dd if=<device-name> of=/dev/null bs=512 count=1 skip=<sector>, where I replaced by dev/sda and by 385850816, the first number given by the previous command.
  • Repeat the previous point for each number.
  • To check if your rescue succeeded, run again the command sudo badblocks -sv -b 512 <device-name>. It should give (after a long while) no number.

As far as I am concerned, it solved my problem, and I was able again to move my partition. I have to admit I don’t really know why, since the commands here-upon seem to be only read and to write commands. But whatever, I encounter no problem any more.

Community's user avatar

answered Jan 23, 2011 at 17:21

Agmenor's user avatar

AgmenorAgmenor

15.5k18 gold badges65 silver badges103 bronze badges

1

It seems like there is a hardware issue with your hard disk, so I suggest you use something like ddrescue or gddrescue to make a copy of it on a different hard disk. Then try to fix the filesystem(s) (with fsck), and if that doesn’t work use photorec or similar rescue tools.

Or just put a backup back to another disk, if you have one, of course…

answered Jan 11, 2011 at 19:20

JanC's user avatar

JanCJanC

19k4 gold badges43 silver badges50 bronze badges

My notebook couldn’t start anymore.

I started it with a live USB Ubuntu 20.04 and tried mount /dev/sda5 but receive this error:

mount: /mnt: can’t read superblock on /dev/sda5

So I tried the commands below:

ubuntu@ubuntu:~$ sudo fdisk -l /dev/sda
Disk /dev/sda: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10SPZX-21Z
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: 8798743C-1711-4EC3-9829-F392872338D3

Device          Start        End    Sectors   Size Type
/dev/sda1        2048     206847     204800   100M EFI System
/dev/sda2      206848     239615      32768    16M Microsoft reserved
/dev/sda3      239616  408477642  408238027 194,7G Microsoft basic data
/dev/sda4  1951424512 1953521663    2097152     1G Windows recovery environment
/dev/sda5   408477696 1951424511 1542946816 735,8G Linux filesystem

Partition table entries are not in disk order.

I tried the solution that Xiao Guoa give in this site, but I haven’t sucesss.

Source: https://www.linuxbabe.com/desktop-linux/fix-cant-read-superblock-error

ubuntu@ubuntu:~$ sudo mke2fs -n /dev/sda5 
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 192868352 4k blocks and 48218112 inodes
Filesystem UUID: 9f522638-1d6a-451f-b608-dc03acd3250b
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000

Now I tried with all blocks * 4, without success.

block 98304 * 4 = 393216

Source: https://unix.stackexchange.com/questions/315063/mount-wrong-fs-type-bad-option-bad-superblock

ubuntu@ubuntu:~$ sudo mount -o sb=393216 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=655360 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.
ubuntu@ubuntu:~$ sudo mount -o sb=917504 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=1179648 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=3276800 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=3538944 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.
ubuntu@ubuntu:~$ sudo mount -o sb=6422528 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.
ubuntu@ubuntu:~$ sudo mount -o sb=10616832 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.
ubuntu@ubuntu:~$ sudo mount -o sb=16384000 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=31850496 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.
ubuntu@ubuntu:~$ sudo mount -o sb=44957696 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=81920000 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=95551488 /dev/sda5 /mnt
mount: /mnt: can't read superblock on /dev/sda5.
ubuntu@ubuntu:~$ sudo mount -o sb=286654464 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.
ubuntu@ubuntu:~$ sudo mount -o sb=314703872 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.
ubuntu@ubuntu:~$ sudo mount -o sb=409600000 /dev/sda5 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error.

After that I have runned e2fsck for 3 days, without success.

ubuntu@ubuntu:~$ sudo e2fsck -f -y -v -c -b 32768 /dev/sda5 
e2fsck 1.45.5 (07-Jan-2020)
Error reading block 1149 (Input/output error).  Ignore error? yes

Force rewrite? yes

Superblock has an invalid journal (inode 8).
Clear? yes

*** journal has been deleted ***

Resize inode not valid.  Recreate? yes

Error reading block 1117 (Input/output error) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error reading block 1133 (Input/output error) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error reading block 1118 (Input/output error) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error reading block 1134 (Input/output error) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error reading block 1119 (Input/output error) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error reading block 1120 (Input/output error) while reading inode and block bitmaps.  Ignore error? yes

Force rewrite? yes

Error reading block 1122 (Input/output error) while reading inode and block bitmaps.  Ignore error? yes

Error dmesg

[217797.911529] ata1: EH complete
[217807.220171] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[217807.220191] ata1.00: irq_stat 0x40000001
[217807.220198] ata1.00: failed command: READ DMA EXT
[217807.220203] ata1.00: cmd 25/00:08:d8:e0:98/00:00:18:00:00/e0 tag 24 dma 4096 in
                         res 51/40:08:d8:e0:98/00:00:18:00:00/e0 Emask 0x9 (media error)
[217807.220220] ata1.00: status: { DRDY ERR }
[217807.220225] ata1.00: error: { UNC }
[217812.260182] ata1.00: qc timeout (cmd 0xec)
[217812.260211] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x5)
[217812.260222] ata1.00: revalidation failed (errno=-5)
[217812.260240] ata1: hard resetting link
[217812.575276] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[217818.410875] ata1.00: configured for UDMA/133
[217818.410924] sd 0:0:0:0: [sda] tag#24 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=20s
[217818.410936] sd 0:0:0:0: [sda] tag#24 Sense Key : Medium Error [current] 
[217818.410945] sd 0:0:0:0: [sda] tag#24 Add. Sense: Unrecovered read error - auto reallocate failed
[217818.410955] sd 0:0:0:0: [sda] tag#24 CDB: Read(10) 28 00 18 98 e0 d8 00 00 08 00
[217818.410960] blk_update_request: I/O error, dev sda, sector 412672216 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[217818.411029] ata1: EH complete
[217821.396529] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[217821.396556] ata1.00: irq_stat 0x40000001
[217821.396568] ata1.00: failed command: READ DMA EXT
[217821.396575] ata1.00: cmd 25/00:08:d8:e0:98/00:00:18:00:00/e0 tag 20 dma 4096 in
                         res 51/40:08:d8:e0:98/00:00:18:00:00/e0 Emask 0x9 (media error)
[217821.396604] ata1.00: status: { DRDY ERR }
[217821.396612] ata1.00: error: { UNC }
[217826.592096] ata1.00: qc timeout (cmd 0xec)
[217826.592112] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x5)
[217826.592116] ata1.00: revalidation failed (errno=-5)
[217826.592122] ata1: hard resetting link
[217826.908977] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[217845.710563] ata1.00: configured for UDMA/133
[217845.710611] sd 0:0:0:0: [sda] tag#20 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=27s
[217845.710624] sd 0:0:0:0: [sda] tag#20 Sense Key : Medium Error [current] 
[217845.710632] sd 0:0:0:0: [sda] tag#20 Add. Sense: Unrecovered read error - auto reallocate failed
[217845.710641] sd 0:0:0:0: [sda] tag#20 CDB: Read(10) 28 00 18 98 e0 d8 00 00 08 00
[217845.710647] blk_update_request: I/O error, dev sda, sector 412672216 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[217845.710670] Buffer I/O error on dev sda5, logical block 524315, async page read
[217845.710722] ata1: EH complete
[217861.384383] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[217861.384409] ata1.00: irq_stat 0x40000001
[217861.384420] ata1.00: failed command: READ DMA EXT
[217861.384428] ata1.00: cmd 25/00:08:d8:e0:98/00:00:18:00:00/e0 tag 0 dma 4096 in
                         res 51/40:08:d8:e0:98/00:00:18:00:00/e0 Emask 0x9 (media error)
[217861.384457] ata1.00: status: { DRDY ERR }
[217861.384465] ata1.00: error: { UNC }
[217866.528299] ata1.00: qc timeout (cmd 0xec)
[217866.528326] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x5)
[217866.528335] ata1.00: revalidation failed (errno=-5)
[217866.528352] ata1: hard resetting link
[217866.843346] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[217885.732336] ata1.00: configured for UDMA/133
[217885.732383] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=40s
[217885.732395] sd 0:0:0:0: [sda] tag#0 Sense Key : Medium Error [current] 
[217885.732404] sd 0:0:0:0: [sda] tag#0 Add. Sense: Unrecovered read error - auto reallocate failed
[217885.732414] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 18 98 e0 d8 00 00 08 00
[217885.732419] blk_update_request: I/O error, dev sda, sector 412672216 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[217885.732442] Buffer I/O error on dev sda5, logical block 524315, async page read
[217885.732492] ata1: EH complete
[217895.039725] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[217895.039750] ata1.00: irq_stat 0x40000001
[217895.039761] ata1.00: failed command: READ DMA EXT
[217895.039769] ata1.00: cmd 25/00:08:60:e0:98/00:00:18:00:00/e0 tag 1 dma 4096 in
                         res 51/40:08:60:e0:98/00:00:18:00:00/e0 Emask 0x9 (media error)
[217895.039797] ata1.00: status: { DRDY ERR }
[217895.039806] ata1.00: error: { UNC }
[217900.067695] ata1.00: qc timeout (cmd 0xec)
[217900.067710] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x5)
[217900.067715] ata1.00: revalidation failed (errno=-5)
[217900.067723] ata1: hard resetting link
[217900.383017] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[217919.221200] ata1.00: configured for UDMA/133
[217919.221247] sd 0:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=33s
[217919.221260] sd 0:0:0:0: [sda] tag#1 Sense Key : Medium Error [current] 
[217919.221269] sd 0:0:0:0: [sda] tag#1 Add. Sense: Unrecovered read error - auto reallocate failed
[217919.221279] sd 0:0:0:0: [sda] tag#1 CDB: Read(10) 28 00 18 98 e0 60 00 00 08 00
[217919.221285] blk_update_request: I/O error, dev sda, sector 412672096 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[217919.221353] ata1: EH complete

In this thread rknichols show how to find a sector offset in the partition to zero the block safely, but I don’t really understand and I was afraid to do that.  

Source: https://www.linuxquestions.org/questions/linux-hardware-18/buffer-i-o-error-on-dev-sdb1-async-page-read-4175600715/

ubuntu@ubuntu:~$ sudo smartctl -a /dev/sda5 
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.11.0-27-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Blue
Device Model:     WDC WD10SPZX-21Z10T0
Serial Number:    WD-WXS1A877RJED
LU WWN Device Id: 5 0014ee 6081e1249
Firmware Version: 02.01A02
User Capacity:    1.000.204.886.016 bytes [1,00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      2.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 1.5 Gb/s)
Local Time is:    Wed Nov 10 02:11:30 2021 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.
See vendor-specific Attribute list for failed Attributes.

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        ( 7680) seconds.
Offline data collection
capabilities:            (0x71) SMART execute Offline immediate.
                    No Auto Offline data collection support.
                    Suspend Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 223) minutes.
Conveyance self-test routine
recommended polling time:    (   1) minutes.
SCT capabilities:          (0x3035) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   001   001   051    Pre-fail  Always   FAILING_NOW 19950
  3 Spin_Up_Time            0x0027   194   187   021    Pre-fail  Always       -       1258
  4 Start_Stop_Count        0x0032   092   092   000    Old_age   Always       -       8733
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   093   093   000    Old_age   Always       -       5258
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1222
191 G-Sense_Error_Rate      0x0032   001   001   000    Old_age   Always       -       31491
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       44
193 Load_Cycle_Count        0x0032   181   181   000    Old_age   Always       -       59346
194 Temperature_Celsius     0x0022   104   098   000    Old_age   Always       -       39
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   198   198   000    Old_age   Always       -       441
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0

SMART Error Log Version: 1
ATA Error Count: 219 (device log contains only the most recent five errors)
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 219 occurred at disk power-on lifetime: 5257 hours (219 days + 1 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 02 02 a8 03 e0  Error: UNC 2 sectors at LBA = 0x0003a802 = 239618

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 02 02 a8 03 e0 08   2d+00:46:14.317  READ DMA
  ec 00 00 00 00 00 a0 08   2d+00:46:14.316  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08   2d+00:46:14.316  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08   2d+00:46:14.212  IDENTIFY DEVICE

Error 218 occurred at disk power-on lifetime: 5200 hours (216 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 00 28 03 e0  Error: UNC 8 sectors at LBA = 0x00032800 = 206848

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 00 28 03 e0 08      02:27:11.836  READ DMA
  e5 00 00 00 00 00 00 08      02:27:11.836  CHECK POWER MODE
  ec 00 00 00 00 00 a0 08      02:27:11.835  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      02:27:11.825  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08      02:27:11.704  IDENTIFY DEVICE

Error 217 occurred at disk power-on lifetime: 5200 hours (216 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 00 28 03 e0  Error: UNC 8 sectors at LBA = 0x00032800 = 206848

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 00 28 03 e0 08      02:26:57.401  READ DMA
  e5 00 00 00 00 00 00 08      02:26:57.400  CHECK POWER MODE
  ec 00 00 00 00 00 a0 08      02:26:57.384  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      02:26:57.384  SET FEATURES [Set transfer mode]

Error 216 occurred at disk power-on lifetime: 5200 hours (216 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 80 27 03 e0  Error: UNC 8 sectors at LBA = 0x00032780 = 206720

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 80 27 03 e0 08      02:26:15.363  READ DMA
  ec 00 00 00 00 00 a0 08      02:26:15.349  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      02:26:15.337  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08      02:26:15.223  IDENTIFY DEVICE

Error 215 occurred at disk power-on lifetime: 5200 hours (216 days + 16 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 80 27 03 e0  Error: UNC 8 sectors at LBA = 0x00032780 = 206720

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 80 27 03 e0 08      02:26:03.763  READ DMA
  ec 00 00 00 00 00 a0 08      02:26:03.762  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      02:26:03.759  SET FEATURES [Set transfer mode]
  ec 00 00 00 00 00 a0 08      02:26:03.630  IDENTIFY DEVICE

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Someone can help me to solve this issue. I have some files that I don’t have backup and I wouldn’t like to give up before try everything to recover this hard disk.

Thank you.

In this article explains how to resolve the issue of /dev/sda5 filesystem with errors and initramfs on Linux or Ubuntu operating system.

I am unable to open my Linux machine due to /dev/sda5 fs with error. Below are fully error code in my command line prompt.

/dev/sda5 contains a file system with errors, check forced.

Inodes that were part of a corrupted orphan linked list found.

ata1.00: failed command: READ FPDMA QUEUED

ata1.00: cmd 60/08:c0:70:24:20/00:00:00:00:00/40 (error) <F>

55.506854]  ata1.00:  status : {DRDY ERR}

55.506923] ata1.00: error : {UNC}

55.829496] blk_update_request : I/O error, dev sda, sector 200 D flags 0x0 phys_seg 1 prio class 0

55.829647] Buffer I/O error on dev sda5, logical block398, Error reading block 398 ( Input / output error).

/dev/sda5: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY

(i.e., without -a or -p options)

fsck exited with status code 4

The root filesystem on /dev/sda5 requires a manual fsck

BusyBox, v1.30.1 (Ubuntu 1:1.30.1 - 4ubuntu 6.2) built - in shell (ask)
Enter 'help' for a list of built - in commands.

(initramfs)_

(initramfs)

Resolution:

After getting the above error, will try to resolve using simple Linux commands.

Step 1: Wait for (initramfs) prompt

Step 2: Once will get the initramfs prompt then enter the below command:

fsck -f /dev/sda5

Step 3: After execute the FileSystem Check command will get the window like below:

fsck from util-linux 2.34

e2fsck 1.45.5 (070Jan-2020)
Pass 1: Checking inodes, blocks, and sizes

760051] Buffer I/O error on dev sda5, logical block 87556896, async page read

Error reading block 87556896 (Input/ouput error) while getting next inode from scan. Ignore error <y>? —-> Here we need enter “y” then will proceed next line

Force rewrite <y> ? yes (Enter “y”)
Test 1 :- Pass 1 : Optimizing extent trees [ here hierarchy tree of file system of Linux]

Test 2: – Pass 2: Checking directory structure [ To check one by one FS ]
Entry ‘system journal’  in /var/log/journal/ d2dd23rds has deleted / unused inode 19270. Clear <y> ? yes (Enter “y”)

We will get same up to Pass 4 once click on all y (“yes”) once it is done.

The above resolution is completed then restart the machine. I try to open machine getting normal window like below.

Понравилась статья? Поделить с друзьями:
  • Ubuntu ошибка при установке службы общего доступа
  • Ubuntu ошибка при загрузке информации об источниках приложений ubuntu
  • Ubuntu error ragent file does not exists
  • Ubuntu error no such partition
  • Ubuntu error loading operating system