Recovering after interrupted Update fails: chroot: failed to run command '/bin/bash': Input/output error

Hi there,

some while ago, with your help, i managed to setup a Manjaro-XFCE for a relative.
It works quite well most of the time. Today, she did a update via the software manager an, after if not doing anything for a few minutes, she killed the laptop with a long power-button-press.
Now, when trying to boot, we get the typical error
“Fehler: Datei “/boot/vmlinuz-6.1-x86_64” nicht gefunden”

I found this solution: [HowTo] Recovering from an interrupted update/upgrade
So I downloaded the latest Manjaro XFCE Image and copied it on a Ventoy USB Drive.

but when trying “manjaro-chroot -a” after “sudo su -”, I get the error message:

[manjaro@manjaro ~]$ sudo su -
[manjaro ~]# manjaro-chroot -a
==> Mounting (ManjaroLinux) [/dev/nvme0n1p5]
 --> mount: [/mnt]
 --> mount: [/mnt/boot/efi]
 --> mount: [/mnt//home/birgit/Datenplatte/]
chroot: failed to run command '/bin/bash': Input/output error
 --> umount: [/mnt//home/birgit/Datenplatte/]
 --> umount: [/mnt/boot/efi]
 --> umount: [/mnt]

I think, the file system is ext4, but just to be sure, here is the output of GParted for both drives:


can you please help me here?

Did you try to repair the file system?

I/O errors are always refer to hardware damage or file system damage.

Not yet. I read about this fact, but did not want to make it any worse by trying anything.
What exactly should I do?

Run fsck on unmounted partitions. The next thing you can try is manually mounting / and /boot/efi and run manjaro-chroot /mnt.

fsck gives:

[manjaro@manjaro ~]$ sudo fsck /dev/nvme0n1p5
fsck from util-linux 2.39.3
e2fsck 1.47.0 (5-Feb-2023)
/dev/nvme0n1p5: clean, 512339/15106048 files, 31663113/60399872 blocks
[manjaro@manjaro ~]$ sudo fsck /dev/sda1
fsck from util-linux 2.39.3
e2fsck 1.47.0 (5-Feb-2023)
/dev/sda1: clean, 48404/62513152 files, 172240253/250050816 blocks

Probably this :thinking: :

fsck -f -y /dev/nvme0n1p5

That forces to check it and doesn’t assume it is clean.

Another thing could that the RAM is slightly corrupted and it wrote files corrupted… In that case fsck cannot do anything, because the corruption happens in the RAM and on the filessystem it is fine, although corrupted. Ext4 has no file checksum, only meta checksum.

fsck -f -y /dev/nvme0n1p5
fsck from util-linux 2.39.3
e2fsck 1.47.0 (5-Feb-2023)
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/nvme0n1p5: 512339/15106048 files (1.0% non-contiguous), 31663113/60399872 blocks

same for sda1 says 3.2% non-contiguous

sudo pacman -Sy nvme-cli
sudo nvme smart-log /dev/nvme0n1

:question:

Please don’t post images of text. As I said, try manually mounting / to /mnt and EFI to /mnt/boot/efi. And run what I said in previous post.

ok sorry, will do so from now on.

how do I know, what exactly to mount?
is / just /dev/nvme0n1p5 and EFI /dev/nvme0n1p1?

Probably. You can take a look in fstab after you mount them. (Or else there won’t be any fstab. :P)

mount worked and fstab found :smiley:

But

manjaro-chroot /mnt
chroot: failed to run command '/bin/bash': Input/output error

still is there

From your first picture above:
/dev/nvme0n1p5 is your system root partition

sudo mount /dev/nvme0n1p5 /mnt

and /dev/nvme0n1 is the EFI partition

sudo mount /dev/nvme0n1p1 /mnt/boot/efi

then manjaro-chroot /mnt

or you can first look whether the /usr/bin/bash is there or not
ls -al /mnt/usr/bin/bash
before you (try to) chroot
but, if bash would not be there, the error message from chroot would be different (not: input/output error)

Ok then. Exit chroot then. Check that both are still mounted and try

pacman -r /mnt -Qnq | pacman -r /mnt -Syu - --cachedir /mnt/var/cache/pacman/pkg --dbpath /mnt/var/lib/pacman --gpgdir /mnt/etc/pacman.d/gnupg

Ah, should probably include missing kernels too, eg. ... -Syu linux66 linux61 - ...

ls -al /mnt/usr/bin/bash
-rwxr -xr-x 1 root root 1112784 Nov 23 16:24 /mnt/usr/bin/bash
[manjaro ~]# pacman -r /mnt -Qnq | pacman -r /mnt -Syu linux66 linux61 - --cachedir /mnt/var/cache/pacman/pkg --dbpath /mnt/var/lib/pacman --gpgdir /mnt/etc/pacman.d/gnupg
:: Synchronizing package databases.
error: failed to synchronize all databases (unable to lock database)
rm /mnt/var/lib/pacman/db.lck

Btw, I gave you example kernels, no idea which you/she was using before. Can’t go wrong with those two tbh. :stuck_out_tongue:

...
:: There are 2 providers available for dbus-units:++
:: Repository core
   1) dbus-broker-units    2) dbus-daemon-units

And oops, didnt recognize the kernel versions :smiley: Is there a way to find out?

See, are you willing to always do updates for her? Even you seem to not know what to do. Pick 1.

You can check

ls /mnt/var/cache/pacman/pkg/linux*