Kernel panic when booting from USB drive

You have a problem with Salix? Post here and we'll do what we can to help.
fyrstormer
Posts: 11
Joined: 29. Jul 2022, 19:03

Kernel panic when booting from USB drive

Post by fyrstormer »

I used the latest Salix 15 LiveCD (very nice by the way) to install Salix onto a USB drive, and the installation went fine, but when I actually boot from the USB drive I get the following kernel panic:

VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
[a list of a bunch of RAM devices, but no actual disks]
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

The last time this happened to me was with a different distro, and the fix was to chroot into the broken install, edit FSTAB to use UUIDs instead of device paths, and run update-grub to propagate the changes into the bootloader. However, that hasn't worked here. The kernel is version 5.15, so it should be capable of booting from a USB drive. Do I need to do something special to make Salix bootable from a USB drive?
fyrstormer
Posts: 11
Joined: 29. Jul 2022, 19:03

Re: Kernel panic when booting from USB drive

Post by fyrstormer »

...to clarify, when I say I installed Salix onto a USB drive, I really mean I installed it, I didn't use the "copy LiveCD to USB stick" option.
fyrstormer
Posts: 11
Joined: 29. Jul 2022, 19:03

Re: Kernel panic when booting from USB drive

Post by fyrstormer »

Any ideas?
djemos
Salix Warrior
Posts: 1433
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: Kernel panic when booting from USB drive

Post by djemos »

When you did the installation what was your usb where install the system? /dev/sdc1?
Need more details.
Did you create a gpt partition table and an efi partition or create a msdos partition table without efi?
mount the usb where you installed salix.
then cat /etc/fstab
Did you use grub or elilo when installing to usb?
cat /boot/grub/grub.cfg
In the laptop or desktop you used to do the installation what disks you have? nvme, sda1, do you have a second insternal disk?
If you have an nvme internal disk then your usb will be /dev/sda2
If you have a sda1 hard disk then it will be /dev/sdb2 /dev/sdb1 it will be the efi partition. Since try to find salix on /dev/sda2
fyrstormer
Posts: 11
Joined: 29. Jul 2022, 19:03

Re: Kernel panic when booting from USB drive

Post by fyrstormer »

GPT partition table, GRUB bootloader installed with --removable flag, fstab is configured to use UUIDs instead of /dev paths, grub.cfg contains the correct location for the root partition. This configuration works for several other distros I have installed on identical USB thumbdrives and still work correctly to this day. No idea why Salix doesn't like it.

When the kernel panic occurs, as I mentioned in my initial post, a list of /dev paths are shown onscreen and the ones corresponding to the USB thumbdrive don't show up in the list at all. (I tested with the internal SSD removed so there would be no confusion.) All it shows is a bunch of ramdisk devices. Maybe the kernel is missing a module needed to boot from a USB device? Diagnosing and fixing that is something I don't know how to do yet; I would need instructions to follow.
djemos
Salix Warrior
Posts: 1433
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: Kernel panic when booting from USB drive

Post by djemos »

fyrstormer wrote: 4. Apr 2023, 07:04 GPT partition table, GRUB bootloader installed with --removable flag,
Did you use SLI to install to usb ?
There is no --removable flag on build-slackware-live.sh script which used by SLI to do the installation. Did you set the flag on esp partition boot,esp?
The initrd used to boot from usb is created from SLI at installation. If you create the initrd by your own then kernel-panic occurs.
All modules need to boot from usb are included.
Did you install grub by hand?
The last time this happened to me was with a different distro, and the fix was to chroot into the broken install, edit FSTAB to use UUIDs instead of device paths, and run update-grub to propagate the changes into the bootloader. However, that hasn't worked here. The kernel is version 5.15, so it should be capable of booting from a USB drive. Do I need to do something special to make Salix bootable from a USB drive?
No no no. If you chroot and change things then you cannot boot from usb. Do not do this. Just use SLI to do the installation. Do not run update-grub, you broke everything. Can run update-grub in an installation to internal hard disk. For usb after a kernel update the install-update-kernel-ext-usb script is used while we run from usb. It is a critical situation. Otherwise usb will not be portable.
fyrstormer
Posts: 11
Joined: 29. Jul 2022, 19:03

Re: Kernel panic when booting from USB drive

Post by fyrstormer »

I used the installer built into the Live ISO to install onto a USB thumbdrive. The thumbdrive never booted correctly. The initrd doesn't detect any USB storage devices during bootup. Are you saying I need to use a different method to install onto a USB thumbdrive? I know there's a tool to copy the Live ISO onto a thumbdrive, but I'm not trying to do that -- I'm trying to put a full installation of Salix onto a thumbdrive.
djemos
Salix Warrior
Posts: 1433
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: Kernel panic when booting from USB drive

Post by djemos »

To make it clear. In salix live installer there are two areas. On the left to install "copy live system to USB" button (frugal installation) on a usb. And to the right to install (real installation) on an internal hard disk or external ssd disk or USB stick, the button says "install live system". This is the button to click to do a real installation on usb. Before this have to prepare the partitions from gparted click on "partitions" button.
If you did the installation using "install live system" button then i do not know what is wrong. I have made a lot of installations on USB without problem.
Image
miredia
Posts: 39
Joined: 6. Oct 2022, 10:20

Re: Kernel panic when booting from USB drive

Post by miredia »

fyrstormer wrote: 10. Apr 2023, 09:32 I used the installer built into the Live ISO to install onto a USB thumbdrive. The thumbdrive never booted correctly. The initrd doesn't detect any USB storage devices during bootup. Are you saying I need to use a different method to install onto a USB thumbdrive? I know there's a tool to copy the Live ISO onto a thumbdrive, but I'm not trying to do that -- I'm trying to put a full installation of Salix onto a thumbdrive.
You have to prepare an USB disk which is at least 32GB in size. In GParted create the first partition as FAT32, at least 512MB (c. 489 MiB), apply then choose "manage flags" and choose "ESP" from the checkboxes. Then if you want you could set the rest of the disk as "ext4" partition but it's not recommended. Set all but 4GiB as the "root" partition formatted as "ext4", and that other portion as "swap". If you do this correctly and the disk is plugged in, when you run SLI it will detect that disk straight away and the "install location" should say "/dev/sdc2" if you have an internal hard disk (not SSD not "nvme") and you're using another external USB disk to boot into Salix. It should say "/dev/sdb2" if you do have an SSD as internal "hard" disk.

Make sure "Install GRUB" is ticked. Leave everything else on top as it is. Then fill out the other details requested and make sure "full installation" is chosen, then press the large "Install live system" button.
djemos
Salix Warrior
Posts: 1433
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: Kernel panic when booting from USB drive

Post by djemos »

Steps to install are well explained in details starting from page 6 of salix_live_startup_guide.
Some notes: In laptops having a nvme disk the bootable usb is detected as /dev/sda while the second used to install the system into is detected as /dev/sdb
In laptops with a ssd disk and without nvme disk the bootable usb is detected as /dev/sdb and the second used to install the system is detected as /dev/sdc
In desktops pc having an internal ssd and also a second internal disk the bootable usb is detected as /dev/sdc while the second used to install the system into is detected as /dev/sdd
Post Reply