[SOLVED] UEFI laptop won't reboot after attempted kernel upgrade (-current)
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
UEFI laptop won't reboot after attempted kernel upgrade (-current)
I've messed up a kernel upgrade on current. Feels like a rite of passage for all Slackware users! Any help would be appreciated.
Background (from memory): I got a new laptop in December, so a recent kernel was required, so I decided to go for Slackware-current rather than 14.2.
I got AlienBOB's current iso, and put it on a USB stick. This was from about December 10th, kernel version 5.4.82. (I still have this stick to boot from).
All installed fine. I wiped the Windows10 partition. Partitions sda1: efi, sda2: swap, sda3: Slackware root. I used the huge kernel and didn't bother making an initrd (put off to later).
Skip forward to January. I've been putting off upgrading until the new kernel 5.10.x seemed stable. I have a snapshot of the Slackware packages from Dec 17 (kernel 5.4.84), so since I'm not used to UEFI, I decide to upgrade to that as a test before jumping to kernel 5.10.x.
I upgrade all using upgradepkg --install-new. I removepkg three packages listed as "removed" in the changelog. I run eliloconfig [select all the defaults]. I don't make a new initrd, since I'm using the huge kernel.
Reboot and ... it fails, complaining about the lack of 5.4.84 modules. Uh-oh. Maybe I needed that initrd.
So I reboot from the install iso to try to repair things, and after a bit of experimentation I do the following.
Chroot:
Code:
mount /dev/sda3 /mnt
chroot /mnt /bin/bash
Mount things:
Code:
mount -t proc none /proc
mount -t sysfs none /sys
mount /boot/efi
Generate an initrd:
Code:
cd /boot
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 5.4.84 -i
# copy + run the output of mkinitrd_command_generator.sh:
mkinitrd -c -k 5.4.84 -f ext4 -r /dev/sda3 -m usb-storage:xhci-hcd:jbd2:mbcache:crc32c_intel:crc32c_generic:ext4 -l uk -u -o /boot/initrd.gz
No errors, so I run eliloconfig and choose all the defaults.
Checking /boot/efi/EFI/Slackware/ I see that indeed the generic kernel has been copied there, along with the initrd. Although /boot/vmlinuz points to vmlinuz-huge-5.4.84.
Trying to reboot, "shutdown now" doesn't work (no /dev/initctl) "poweroff" doesn't work (can't determine runlevel). So I hold down the power key until it powers down. Remove install usb. Reboot.
I get a Windows10 style screen (blue background, font that looks like Windows) that says:
Quote:
Recovery
Your PC/Device needs to be repaired
A required device isn't connected or can't be accessed.
Error code: 0xc0000225
You'll need to use recovery tools. If you don't have any installation media (like a disc
or USB device), contact your PC administrator or PC/Device manufacturer.
Press Enter to try again
Press F1 to enter Recovery Settings
Press F8 for Start-up Settings
Press Esc for UEFI Firmware Settings
This is where I'm stuck. I hope the hard power-down didn't corrupt the UEFI partition.
Last edited by semiprime; 01-20-2021 at 08:52 AM.
Reason: Formatting
This doesn't happen for the files under /boot/efi/EFI/Microsoft/.
Running eliloconfig seems makes the files readable again (the file command works), but if I umount and mount /boot/efi I get the input/output errors again.
(Thing I learned: how to reboot after chroot - exit then reboot as normal.)
Last edited by semiprime; 01-20-2021 at 08:58 AM.
Reason: Missed dir in a path
I'm not saying this is best practice or anything, but when there's a kernel update all I do is copy the vmlinuz-huge-5.x.x from /boot to /boot/efi/EFI/Slackware/ named as just vmlinuz.
I commented out the initrd since I'm using kernel-huge. root path obviously may differ for others.
Is this best practice? I don't know. Running liloconfig on an MBR system after kernel upgrade works perfectly for me, it always reboots with the upgraded kernel and works great.. never once had to do anything else. Running eliloconfig on an EFI system after kernel upgrade does not work out for me, it always results in a mounting error followed by a kernel panic.
Apart from the need to reinstall nvidia drivers after kernel upgrades this is what largely prevents me from updating my kernel more than once every couple of months.
I'm not sure if any of this is helpful, laptops can be weird with all their partitions the manufacturer try to hide on it for recovery purposes and whatnot. When I got my Dell Inspiron i7559 I actually replaced the spinning drive it shipped with for an SSD, so I haven't had to deal with that.
Last edited by ReFracture; 01-20-2021 at 08:53 AM.
I certainly hope I've learned someting that will make my next kernel update a little smoother! I just have to work out how to get my laptop booting again. Preferably without doing a full reinstall.
fsck from util-linux 2.36.1
CP437: Invalid argument
fsck.fat 4.1 (2017-01-24)
Seek to 272629248: Invalid argument
Is there any error output in dmesg command after you mount sda1?
Code:
# on booted media installer system
mkdir /bla
mount /dev/sda1 /bla
dmesg
If sda1 can be mounted, I would be tempted to save any file from it to an external media drive and reformat /dev/sda1 in vfat format, then copy the saved files to it
After my initial attempt to upgrade the kernel, /lib/modules contained just a 5.4.84 directory, as expected. I think it was their absence in any sort of initrd that was the problem.
Now, after my clumsy hacking around:
Code:
ls /lib/modules
5.4.84/
ls /boot/initrd-tree/lib/modules/
5.4.84/
So that should be fine. I think I've caused a different problem while trying to fix the initial problem.
On another thought, maybe the laptop firmware was reset to a default config when abruptly powered off, like enabling secure boot etc
I would review EFI bios settings just in case (press F2 or delete key while powering up the laptop, don't know how you access the settings in your laptop, oh maybe it's the ESC key?)
But it seems there is an issue with /dev/sda1 partition
Is there any error output in dmesg command after you mount sda1?
Code:
$ mount /dev/sda1 /mnt
$ dmseg | grep sda1
sda: sda1 sda2 sda3
FAT-fs (sda1): Volume was not properly unmounted/ Some data may be corrupt. Please run fsck.
That seems to confirm that me now knowing how to reboot after chroot and hitting the power button has corrupted the uefi partition. So my fault, and hopefully not a hardware problem.
Prompted by this, I thought if I ran eliloconfig, then copied the files from EFI/Slackware (now readable - presumably cached after being written) then deleted EFI/Slackware and copied them back, I might get the filesystem into a consistent state.
I renamed EFI/Slackware to EFI/Slackware-corrupt. unmounted and renounted. I could now read the files in EFI/Slackware-corrupt! So I renamed the directory back to EFI/Slackware, and it remained readable over a umount/mount. fsck still gave errors but it seemed "better".
Cautiously, I did clean powerdown. And the laptop rebooted into kernel 5.4.84.
I have a corrupt filesystem on my uefi partition, but it's better. I'll think about what to do about that - maybe a full reinstall when a 15.0 release candidate arrives and I can then reformat /dev/sda1 to prevent it causing trouble later.
I'll mark this as "Solved" -- thanks keefaz!
My only question now is: why did running eliloconfig try to use the generic kernel?
I do have the same message about volume not properly unmounted on my system although it always has been shutdown properly, it's a bit that can be cleared with fsck, but I never bothered with it
I do have the same message about volume not properly unmounted on my system although it always has been shutdown properly, it's a bit that can be cleared with fsck, but I never bothered with it
Reviewing the script, it copies /boot/vmlinuz in /boot/efi/EFI/Slackware and it tests if there is /boot/initrd.gz file, if yes it copies it as well and add the initrd configuration in elilo.conf, so if you want to use eliloconfig with huge, make sure /boot/vmlinuz points to it and delete /boot/initrd.gz
Reviewing the script, it copies /boot/vmlinuz in /boot/efi/EFI/Slackware and it tests if there is /boot/initrd.gz file, if yes it copies it as well and add the initrd configuration in elilo.conf, so if you want to use eliloconfig with huge, make sure /boot/vmlinuz points to it and delete /boot/initrd.gz
That's a bit odd - in my first post I observed:
Quote:
Originally Posted by semiprime
Checking /boot/efi/EFI/Slackware/ I see that indeed the generic kernel has been copied there, along with the initrd. Although /boot/vmlinuz points to vmlinuz-huge-5.4.84.
Maybe I was mistaken. The evidence of what happened has been overwritten a few times now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.