[Solved] Kernel panic at USB installation.

You have a problem with Slackel? Post here and we'll do what we can to help.
Post Reply
Papasot
Posts: 231
Joined: 13 May 2016 22:32
Location: Patras, Greece

[Solved] Kernel panic at USB installation.

Post by Papasot »

I just tried to upgrade the kernel (a thing I usually avoid) on a USB installation of Slackel 64-bit. I used

Code: Select all

sudo install-upgrade-kernel-ext-usb upgrade huge
(the rest of the parameters were left to default, ext4 and /dev/sdb1, which are correct). Everything seemed ok. But after reboot, I get kernel panic:

Code: Select all

[    3.093730] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0)
No idea what went wrong here. Note that I upgraded the packages (including the script install-upgrade-kernel-ext-usb itself, before attempting to upgrade the kernel.
Last edited by Papasot on 10 Jan 2021 10:27, edited 2 times in total.
djemos
Site Admin
Posts: 676
Joined: 15 Apr 2016 06:03

Re: Kernel panic at USB installation.

Post by djemos »

I installed slackel64-7.4 openbox to a usb stick. I boot with it and update the system. Kernel is 5.10.6 in slacware repos.
Then i run sudo install-upgrade-kernel-ext-usb upgrade huge. Rebooted and boot to usb without problem using kernel-5.10.6 and initrd-5.10.6.gz

Now from a running slackel system plug in your usb and look what is in /boot folder of usb. Is there initrd-5.10.6 ?
Maybe kernel-headers or kernel-huge did not upgraded and initrd.gz did not created. Look in /var/log/packages/kernel* if there is any upgraded file e.g. kernel-headers-upgraded. If so this mean upgrade failed because of internet connection, some kernel package did not completely downloaded.

To fix it chroot to usb and run the sudo install-upgrade-kernel-ext-usb upgrade huge and check in /boot if initrd is created for new kernel.
Also check the messages in lxterminal while the above script is running. To see if something failed.
You know how to chroot from a previous post.
Papasot
Posts: 231
Joined: 13 May 2016 22:32
Location: Patras, Greece

Re: [Solved] Kernel panic at USB installation.

Post by Papasot »

For some reason, although kernel-huge, kernel-headers and kernel-modules were upgraded, initrd.gz did not. I fixed it as you said, using another Slackel system and chroot. It worked like a charm. Thank you Dimitri!
Aftermath: When upgrading the kernel, ALWAYS inspect /boot and /var/log/packages.
Papasot
Posts: 231
Joined: 13 May 2016 22:32
Location: Patras, Greece

Re: [Solved] Kernel panic at USB installation.

Post by Papasot »

UPDATE: Something must be wrong with install-upgrade-kernel-ext-usb. Today, I tried to upgrade kernel 5.10.6 to 5.10.7 using that script. It downloaded and installed the new kernel-huge, kernel-headers, and kernel-modules but then I saw this:

Code: Select all

Creating initrd-5.10.6.gz
So once again, the script installs the new kernel but does not create the correct initrd (in this case, initrd-5.10.7.gz). Instead, it recreates the initrd corresponding to the old kernel. Of course, that causes a kernel panic at reboot - which I solved with chroot from another Slackel installation, but that wouldn't be needed at all, if the correct initrd was created during the script execution.
djemos
Site Admin
Posts: 676
Joined: 15 Apr 2016 06:03

Re: [Solved] Kernel panic at USB installation.

Post by djemos »

You are right. It was a bug. First new kernel has to be installed or upgraded and then execute the line kv=`ls -l /boot/vmlinuz | cut -f2 -d'>' | sed s/^[^0-9]*//` to point the new kernel so the right initrd.gz will be created. I correct also install-upgrade-kernel script in case the user will install or upgrade generic kernel so the correct initrd.gz will be created.
Packages uploaded to slackel repos.
Thanks.
Post Reply