System won’t boot

So this happened to me right after booting, I booted into EndeavourOS and it won’t start.
This is what I get:

Starting version 249.7-2-arch
/dev/sda5 contains a file system with errors, check forced.
Error reading block 33031137 (Input/output error) while getting next inode from scan.

/dev/sda5: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
             (i.e., without -a or -p options)
_

I tried running fsck /dev/sda5 but nothing happens.
Is there anyway to fix this without reinstalling?

What does sudo fsck -V /dev/sda5 show?
For example I get

$ sudo fsck -V /dev/nvme0n1p8
[sudo] password for xxxx: 
fsck from util-linux 2.37.2
[/usr/bin/fsck.ext4 (1) -- /nvme0/n1/p8] fsck.ext4 /dev/nvme0n1p8 
e2fsck 1.46.4 (18-Aug-2021)
/dev/nvme0n1p8: clean, 3084/4743168 files, 13470578/18944000 blocks
1 Like

It doesn’t show anything, just a blinking cursor.
Am I supposed to wait?

Boot up a live image, open a terminal, and run the command suggested above. Post the output of that command here.

This is what I get:

fsck from util-linux 2.37.2
[/usr/bin/fsck.ext4 (1) -- /dev/sda5] fsck.ext4 /dev/sda5 
e2fsck 1.46.4 (18-Aug-2021)
/dev/sda5 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error reading block 33031137 (Input/output error) while getting next inode from scan.  Ignore error<y>? 


I googled for a solution maybe this post helps?

Based on what I read there, -c to update the bad blocks list -y to answer yes to all questions (saves having to answer yes - every time).
The implication is that answering yes means fsck fixes errors.
I may be wrong here, but it seems to me that you may lose some data.

So I run sudo fsck -cfy /dev/sda5 or sudo fsck -cy /dev/sda5?

-f is to Force checking even if the file system seems clean, so I’d say no harm is specifying that since you do want to ensure the file system is checked.

So I tried running sudo fsck -cfy /dev/sda5, but I got:

fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
/dev/sda5 is in use.
e2fsck: Cannot continue, aborting.

before running it I used ctrl + c to cancel the previous command which is sudo fsck -V /dev/sda5 but it got stuck so I force closed the terminal, is it because of that?

I appears that /dev/sda5 is mounted - unmount it before running fsck
For example I see

$ mount | grep /dev/sd
/dev/sda1 on /media/Music type btrfs (rw,nosuid,nodev,noexec,noatime,space_cache,autodefrag,subvolid=257,subvol=/@)

So I would have to type

sudo umount /media/Music

Your mount point will be different.

Running mount | grep /dev/sd returns nothing.
I tried running umount /dev/sda5 but it returns:

umount: /dev/sda5: not mounted.

Ooooh, I really don’t know what to do next :frowning:
Assuming that this is an ext4 filesystem, does using fsck.ext4 instead of fsck give you the same response?

What does lsblk -lf show?

Running sudo fsck.ext4 -cfy /dev/sda5 gives the same result.
Running lsblk -lf returns:

NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
     squash 4.0                                                    0   100% /run/archiso/airootfs
sda                                                                         
sda1                                                                        
sda2 ntfs         System Reserved
                        8A4AE4E14AE4CAD1                                    
sda3 ntfs               AE12EA3112E9FDE9                                    
sda4 ntfs               F21CC0FE1CC0BEBB                                    
sda5 ext4   1.0         e4bd52e4-f66c-4635-961b-0994f0d5fb56                
sdb                                                                         
sdb1 exfat  1.0   Ventoy
                        5A90-43CB                                           
sdb2 vfat   FAT16 VTOYEFI
                        E5A3-3431                                           
sr0                                                                         
ventoy
     iso966 Jolie EOS_202111
                        2021-11-30-19-29-26-00                     0   100% /run/archiso/bootmnt

Doh - sorry, I don’t know how to help you fix this.

I can’t use the tutorial, whenever I use fsck -f /dev/sda5 I get:

fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
/dev/sda5 is in use.
e2fsck: Cannot continue, aborting.

Will rebooting into the live image fix it?

You would need to unmount that disk first. If you can’t do that from your running system, you’ll need to do it on the live ISO.

Rebooting fixed the /dev/sda5 is in use. issue
But when running sudo fsck -f /dev/sda5 this is what I get:

fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
fsck.ext2: Permission denied while trying to open /dev/sda5
You must have r/w access to the filesystem or be root
[liveuser@eos-2021.11.30 ~]$ sudo fsck -f /dev/sda5
fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
Pass 1: Checking inodes, blocks, and sizes
Error reading block 33031137 (Input/output error) while getting next inode from scan.  Ignore error<y>? yes
Force rewrite<y>? yes

It’s stuck on this, does it take a long time or is it just stuck?

I would be inclined to give it some time to complete rather then interrupt the fsck.
The fact that it is taking a long time may indicate that your disk is on its way out.
You can use smartctl to work out if you should replace the disk.