You are not logged in.

#1 2020-12-02 08:58:19

millus
Member
Registered: 2019-07-21
Posts: 193

[FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

So I did the usual pacman -Syu and rebooted. Usually this works 100% fine. But now after selecting 'Arch Linux' grub entry I get:

Loading Linux linux ...
error: file `vmlinuz-linux' not found.
Loading initial ramdisk ...
error: you need to load the kernel first.

Press any key to continue...

What happend and what am I supposed to do???

EDIT:
Fixed! See https://bbs.archlinux.org/viewtopic.php … 3#p1941023 below smile

Last edited by millus (2020-12-02 10:02:24)

Offline

#2 2020-12-02 09:35:24

millus
Member
Registered: 2019-07-21
Posts: 193

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

Ok, I booted from archlinux USB stick and mounted both the boot partition and the root partition and searched them for file vmlinuz-linux and sure enough it was not found!
Any idea what pacman did there and how to fix it?

Offline

#3 2020-12-02 09:46:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

If this is literally the error message you have a typo in your boot loader config.

If it's not the typo, what usually happens here is that you didn't have /boot mounted while needing it to, or the reverse having /boot mounted while not needing to, which of these cases is true depends on how the bootloader is configured. GRUB does not technically need the /boot and it's own partition to be the same.

What did you do here? Post your /boot/grub/grub.cfg and the output of lsblk -f The general way to fix this is to mount the partitions properly as configured and reinstalling the linux package or running mkinitcpio -p linux

Offline

#4 2020-12-02 09:57:42

millus
Member
Registered: 2019-07-21
Posts: 193

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

@V1del
Thanks it was just my typo here, since I had to type it by hand I made a mistake.
But I didn't "do" anything. I just use my system to do the usual stuff and sometimes do pacman -Syu so I have no idea why it suddenly decided to delete the linux and initram files, basically the /boot folder was suddenly empty except for /boot/grub which still existed just fine and had the correct files in it as usual.


Ok, I fixed it. I googled a bit on how to do chroot and also found a video that explains why basic chroot will fail (it's cause arch misses zsh binary). So, if pacman breaks your system, do this:
Download archlinux install image and install it on a USB stick with (replace /dev/sdb with your USB stick device, make sure to check via 'lsblk -f' command!):

sudo dd if=archlinux-2020.12.01-x86_64.iso of=/dev/sdb bs=1M status=progress

and boot from it.
Now mount your existing arch partitions into /mnt folder, replacce sdXY by your actual partitions again, check 'lsblk -f' eg:

mount /dev/sdXY /mnt
mount /dev/sdXY /mnt/boot
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts /dev/pts /mnt/dev/pts/

and finally chroot into it, with bin/bash or archlinux will fail with error that zsh doesn't exist:

chroot /mnt /bin/bash

And finally just simply install the linux package again!

pacman -Sy
pacman -S linux

And it should work again (did for me).
Man what a shocker, I wish it would not do sth like this out of the blue, lol.

Last edited by millus (2020-12-02 10:03:41)

Offline

#5 2020-12-02 10:02:58

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

millus wrote:

@V1del
Thanks it was just my typo here, since I had to type it by hand I made a mistake.
But I didn't "do" anything. I just use my system to do the usual stuff and sometimes do pacman -Syu so I have no idea why it deleted the linux and initram files, basically the /mnt/boot folder was suddenly empty except for /mnt/boot/grub which still existed just fine.


Ok, I fixed it. If pacman breaks your system, do this:
Download archlinux install image and install it on a USB stick with (replace /dev/sdb1 with your USB stick device, make sure to check via 'lsblk -f' command!):

sudo dd if=archlinux-2020.12.01-x86_64.iso of=/dev/sdb1 bs=1M status=progress

and boot from it.
Now mount your existing arch partitions into /mnt folder, replacce sdXY by your actual partitions again, check 'lsblk -f' eg:

mount /dev/sdXY /mnt
mount /dev/sdXY /mnt/boot
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts /dev/pts /mnt/dev/pts/

and finally chroot into it, with bin/bash or archlinux will fail with error that zsh doesn't exist:

chroot /mnt /bin/bash

And finally just simply install the linux package again!

pacman -Sy
pacman -S linux

And it should work again (did for me).

From what video tutorial did you got that?
dd’ing the iso to a key is ok, the rest is just arch-chroot and pacman -Syu linux...except that you mounted by hand, didn’t do squat about resolv.conf, and did a partial upgrade!

Of course, you can just do pacman -S linux, no need to check for database updates...

Last edited by GaKu999 (2020-12-02 10:05:33)


My reposSome snippets

Heisenberg might have been here.

Offline

#6 2020-12-02 10:06:19

millus
Member
Registered: 2019-07-21
Posts: 193

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

Hi, I'm not sure what you want to say. So you basically complain that I only restored the linux kernel in the chroot environment and didn't completely update all packages while in there?
And what is the thing about resolv.conf? I'm not an expert so I don't know what that is, can you elaborate a bit maybe, thanks.

Last edited by millus (2020-12-02 10:06:37)

Offline

#7 2020-12-02 10:15:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

With "what did you do here" I didn't mean to say you did something incorrect inherently but which kind of configuration you set up. Because if you have a basic error in which partitions have to be mounted or not you will run into this issue every time the kernel update happens. If this was a one off thing then there's indeed not much else. Going by your fix description you are actually mounting the partition to /boot. So what you need to ensure is that that /boot partition is also listed in your /etc/fstab so that it is generally present when the kernel updates.

What Gaku refers to is that you are doing some unnecessarily verbose steps when arch-chroot is a thing, it really isn't that big of a deal nor an inherent issue. What is potentially a problem is that by doing an -Sy without an -u you've updated your package database into a potential partial state. This is no problem as long as your next interaction with pacman is an -Syu but can lead to undesired side effects if you were to -S a package  other than linux: https://gist.github.com/vodik/5660494

Last edited by V1del (2020-12-02 10:15:56)

Offline

#8 2020-12-02 10:31:00

millus
Member
Registered: 2019-07-21
Posts: 193

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

V1del, thanks. I now ran another Syu right away after rebooting and everything seemed fine, no further updates (not too surprising, since in fact I just did one two hours ago, which was the reason for rebooting, which then lead to this problem).
Cool about existance of arch-chroot, I didn't remember there was this.
Here is my /etc/fstab (with UUIDs anonymized tongue) :

#/dev/nvme0n1p4
UUID=xxxxxxxx / ext4 rw,relatime 0 1
#/dev/nvme0n1p2
UUID=xxxxxxxx /boot ext4 rw,relatime 0 2
#/dev/nvme0n1p1
UUID=xxxxxxxx /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2

The nvme0n1p3 is a swap partition but I haven't enabled swapping.
I hope it looks pretty normal, so that I can expect that this probably won't happen again - then again now I know how to fix it, so it's no problem.

Last edited by millus (2020-12-02 10:35:00)

Offline

#9 2020-12-02 17:14:48

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

I'm glad you were able to get it working. smile

FYI there is nothing dangerous about posting an "/etc/fstab" file or UUIDs. They are only useful on the computer they are used on. If someone has access to that then you have bigger problems. wink

I deleted my swap partition a few years ago and I don't miss it. I never used it! Besides, if I need swap some day, it's just as easy to create a "swap file" instead of a new partition.

...oh wow, I just noticed you're using "/efi" instead of "/boot/efi" like me. Apparently your method is now preferred. Sounds like a potential Christmas break project for me. big_smile

https://wiki.archlinux.org/index.php/EF … unt_points

EDIT: I just noticed my EFI partition is actually mounted to "/boot". Yikes. tongue
EDIT: ...which is normal according to the wiki link above, because I use "systemd-boot".

Last edited by drcouzelis (2020-12-02 17:35:22)

Offline

#10 2020-12-02 18:02:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

drcouzelis wrote:

Apparently your method is now preferred.

Preferred by whom?  And more importantly for what reason?  Using /efi does seem to be "in vogue" according to some documentation, but that is mostly at the whim of the documentation author.  And even if that is accurate, that it is becoming "popular" that does not mean it is better in any way.  If there are any technical benefits of this mount point, I've not seen them elaborated.  It is infact a bit more restrictive, but it is noted in documentation that with some popular boot managers/loaders it is now "possible" to use /efi.  But the fact that some modern bootloaders allow for it should not be sufficient justification to recommend it.

I can anticipate some claims about the benefits of not having the kernel (and initramfs) on the ESP.  But if that is to hold water, one would have to know why that is actually a benefit for their use case.  For some particular encryption schemes this mount point may protect against specific threats ... threats that may not even be relevant to a majority of users.  But even this logic would only favor not having the ESP at /boot, it would not at all argue against /boot/efi, or /boot/dontlookhere/efi, or /boot/unicorn-farts, or just not mounting it at all!  It's just arbitrary.

Last edited by Trilby (2020-12-02 18:05:56)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2020-12-02 18:31:35

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

Trilby wrote:

or /boot/dontlookhere/efi

Holy crap you made me LOL at work. lol

That is good insight. Yeah, I was just quoting the Arch Wiki. I do get nervous because, since Arch Linux just works and I never need to re-install it, I worry that I might be missing a change that was implemented in the installation procedure or something, or a better way of doing things. But I guess if my computer just keeps working then it doesn't really matter. tongue

...but I guess if I didn't like tinkering with my installation then I probably wouldn't be using Arch Linux... wink

Offline

#12 2020-12-03 11:46:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [FIXED] Help, after pacman -Syu Archlinux doesn't boot anymore!

In line with what trilby mentions this really just boils down to somewhat of a misunderstanding of what the ESP is ultimately needed and used for. There's one basic principle, the ESP is irrelevant to the running system. It's a partition for the EFI firmware to find executables to load, before an actual operating system takes over once the system is up you can do whatever you want with it.

The "recommendations" are for user convenience. If you are going to use EFISTUB or systemd-boot it makes sense to simply have it mounted to /boot as that is the simplest way to ensure new kernel images actually land there (as that's the default path where mkinitcpio will generate images) and will be used on the next start up. If you use a method that can boot the initramfs from a linux or other partition the only reason you'd ever have to mount it is if you wanted to update that other method.

Last edited by V1del (2020-12-03 11:47:11)

Offline

Board footer

Powered by FluxBB