2

I am running a very recent version of Arch linux.

I was doing a pacman update and somehow closed the terminal during an update.
Now after a reboot it won't boot.
The boot screen shows

Loading Linux linux ...
Loading initil ramdisk ...
error: file /boot/initramfs-linux.img not found

Press any key to continue ...

and the laptop goes no further than that.

I think the partitions I have on the laptop are

/dev/sda1 /boot/efi 300MB
/dev/sda2 ext4 214.47GB
/dev/sda3 linux-swap 8.8GB

but I am not entirely certian.

I downloaded an arch iso and live booted on the laptop, and did this

mount /dev/sda2 /mnt
arch-chroot /mnt

and saw that /boot/initramfs-linux.img appears to be missing.

But I'm not really sure what to do.

How can I be sure which partitions I have, and how to mount these all then what are the repair steps?

3
  • On a broken system, if I boot with a live linux from a USB stick, what is the best way to determine what partitions exist on the broken system, and their respective mappings, so that the correct mounts can be established, so that chroot can then be used?
    – Kes
    Jan 21 '21 at 17:48
  • I had an identical system, from which I was able to determine the correct partition mappings. If I had not had an identical system to get the mappings from, how would I have got these?
    – Kes
    Jan 21 '21 at 17:53
  • once / is identified and mounted /etc/fstab, the file systems table, will then give the correct mount points for the rest of the system.
    – Kes
    Jan 21 '21 at 20:56
4

It's fixed. Here's how I fixed it.

1. Get live arch working on bootable USB stick

a. downloaded working live arch installation to working computer.
Fastest was the torrent download from here https://archlinux.org/download/

b. Identify correct writing device /dev/sdX using gparted.
Write live arch to usb stick

sudo dd bs=4M if=/home/kes/Downloads/archlinux-2021.01.01-x86_64.iso of=/dev/sdb

c. booted broken laptop with USB stick

2. Get network going on laptop

Wifi-menu was pre-configured on broken laptop, so would not work.
Plugged ethernet cable in and re-booted.
pacman -Syy is now working

3. Identified correct mount points

a. Used

lsblk

to identify mount points.

b. Having identified the root partition as /dev/sda2 ie / was able to see /etc/fstab, the file systems table, which details all other mount points on the system. This, /etc/fstab, is the text file to look at, and will show you where your other mount points are.

c. Also was able to check the mount points on another identically built laptop, as follows

findmnt /dev/sda1

TARGET SOURCE FSTYPE OPTIONS /boot/efi /dev/sda1 vfat
rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro

findmnt /dev/sda2

TARGET SOURCE FSTYPE OPTIONS / /dev/sda2 ext4
rw,noatime,discard

4. Mounting mount points, Chrooting and Re-loading linux kernel

mount /dev/sda2 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi

arch-chroot /mnt

sudo pacman -Syy
sudo pacman -S linux

5. Finally

Switched laptop off, pulled out USB stick, pulled out ethernet cable, turned it back on and it's working again !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.