[SOLVED] closed terminal during pacman update and now wont boot

Post Reply
kes__
Crewman
Posts: 9
Joined: Fri Jun 05, 2020 11:30 am

[SOLVED] closed terminal during pacman update and now wont boot

Post by kes__ »

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

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

Code: Select all

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.
Last edited by kes__ on Thu Jan 21, 2021 12:45 pm, edited 2 times in total.

User avatar
erikdubois
Captain
Posts: 4240
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

Re: [OPEN] closed terminal during pacman update and now wont boot

Post by erikdubois »

if you can arch-chroot you can solve anything.

lesson learned - never interrupt an update

Code: Select all

sudo mkinitcpio -p linux
if you have the standard linux kernel (linux-lts, linux-zen, linux-hardened) - use the correct kernel you are on

or you reinstall the linux kernel and have the same result

Code: Select all

sudo pacman -S linux
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.

kes__
Crewman
Posts: 9
Joined: Fri Jun 05, 2020 11:30 am

Re: [SOLVED] closed terminal during pacman update and now wont boot

Post by kes__ »

After chrooting to /dev/sda2, my root prtition,
this is what is in /boot
├── efi
├── grub
│   ├── fonts
│   ├── grub.cfg
│   ├── grubenv
│   ├── themes
│   └── x86_64-efi
├── memtest86+
│   └── memtest.bin
├── syslinux
│   └── syslinux.cfg
└── vmlinuz-linux
Below two files are missing
/boot/initramfs-linux-fallback.img
/boot/initramfs-linux.img

Do I need to mount
/dev/sda1 /boot/efi
before making the repair
Last edited by kes__ on Thu Jan 21, 2021 12:45 pm, edited 1 time in total.

kes__
Crewman
Posts: 9
Joined: Fri Jun 05, 2020 11:30 am

Re: [SOLVED] closed terminal during pacman update and now wont boot

Post by kes__ »

Thanks for your help.

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

Code: Select all

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

Code: Select all

lsblk
to identify mount points.

b. Having identified the root partition, /, as /dev/sda2, 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

Code: Select all

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

Code: Select all

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

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

Code: Select all

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 !

User avatar
erikdubois
Captain
Posts: 4240
Joined: Tue Nov 07, 2017 3:45 pm
Location: Belgium
Contact:

Re: [SOLVED] closed terminal during pacman update and now wont boot

Post by erikdubois »

Thanks for the guidelines.

It will sureley help someone in the future. :ugeek: :geek:
Learn, have fun and enjoy.
But first use the power of the Arch Wiki
use the tutorials on https://www.youtube.com/erikdubois
then use the power of google
then use the power of our moderators.

Frank1971
recruit crewman
Posts: 2
Joined: Sat Apr 17, 2021 3:01 pm

Re: [SOLVED] closed terminal during pacman update and now wont boot

Post by Frank1971 »

erikdubois wrote:
Fri Jan 22, 2021 7:23 am
It will sureley help someone in the future. :ugeek: :geek:
Yes, me! thanks guys for this guide.

Something went wrong yesterday with my update and my machine was in bootloop with no kernel.
This guide made me fix it in 30 minutes. Linux is amazing, i love it.

Just changed from Win for about 3 month, using Arco till 10 weeks as my daily driver. Great thing you did Erik, thx a lot for this distro.

Post Reply

Return to “Kernel & Hardware”