LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (https://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   Slackware Kernel Panic (https://www.linuxquestions.org/questions/slackware-installation-40/slackware-kernel-panic-4175548341/)

soborbon 07-18-2015 11:33 PM

Slackware Kernel Panic
 
I recently installed Slackware 14.1 on a USB hard disk. The root directory is in the first primary partition, /dev/sdb1. I installed only the base system, Part A. I configured LILO to boot from the root directory on /dev/sdb1. Slackware started to boot, meaning that LILO found vmlinuz and loaded initrd. After a few screens full of messages, a kernel panic dump filled the screen.

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block (8.17)

When installing Slackware, I mounted the root filesystem to /mnt with no problem at all, and viewed the directories under the root. So I could do a mount myself, but the kernel couldn't do the same mount during the boot process. That doesn't make sense.

How could the kernel not mount the root fs, when it already loaded vmlinuz and initrd from a sub-directory on the root fs? /boot/vmlinuz is located on the root fs.

What could possibly be wrong with the installation? I installed only the base system, nothing fancy, and I followed the installation steps in setup to the letter.

Then I turned to VirtualBox to see if I could be more successful. But VirtualBox wouldn't even boot a kernel on the first Slackware iso disk. I tried booting hugesmp.s and huge.s. Both failed. The VirtualBox problem is less important at this moment than the above problem of booting from a USB hard disk.

astrogeek 07-19-2015 01:06 AM

Welcome to LQ!

Quote:

Originally Posted by soborbon (Post 5393366)
I recently installed Slackware 14.1 on a USB hard disk. The root directory is in the first primary partition, /dev/sdb1. I installed only the base system, Part A. I configured LILO to boot from the root directory on /dev/sdb1. Slackware started to boot, meaning that LILO found vmlinuz and loaded initrd. After a few screens full of messages, a kernel panic dump filled the screen.

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block (8.17)
...
How could the kernel not mount the root fs, when it already loaded vmlinuz and initrd from a sub-directory on the root fs? /boot/vmlinuz is located on the root fs.

What could possibly be wrong with the installation? I installed only the base system, nothing fancy, and I followed the installation steps in setup to the letter.

It is most likely due to the disk receiving a different /dev/sdx path assignment during boot than during installation. The device assignments are created by the kernel and are not always the same in different boot contexts.

The kernel is not loaded "from a sub-directory on the root fs" because there is no filesystem available before the kernel loads (hence the term boot!). The kernel is loaded as an absolute offset location on the disk stored in the boot loader by lilo. So the kernel loads, the device paths are assigned and then mounted, at which point the kernel panics because it cannot find the root partition.

The easy way to resolve this would be to change the root device specifications in lilo.conf and /etc/fstab to use the device UUID instead of /dev/sdb1. To do that...

Quote:

1. Boot into the Slackware installation disk
2. Mount the root partition of the drive
3. chroot into the mounted partition
4. Get the root device UUID by ls -l /dev/disk/by-uuid/...
5. Edit /etc/lilo.conf and change root = /dev/sdb1 to root = "UUID_FROM_STEP_4" (quoted as shown)
6. Edit /etc/lilo.conf change boot = /dev/sdb(1) to boot = /dev/disk/by-id (of device)
7. Edit /etc/fstab and change /dev/sdb1 / ... to UUID=UUID_FROM_STEP_4 / ... (unquoted as shown)
Run lilo and reboot...

It is not clear from your post whether lilo is installing the boot loader to the MBR or the root partition, so be sure to use the same actual device for the boot = ... parameter.

Didier Spaier 07-19-2015 01:27 AM

Hi, welcome to this forum.

Maybe in /etc/fstab you told to mount /dev/sdb1 as / (your root partition) but as this is a removable device its name can change after reboot. Name it with UUID instead. "blkid" or "lsblk -o name,size,fstype,uuid" will tell you the UUID of this partition, then see instead of /dev/sdb1 in /etc/fstab write for instance UUID=<the UUID for /dev/sdb1>

Also, USB disks needs some time to spin and before during that time the data are not yet accessible, so it's not bad to append a "rootdelay=15" for instance in the stanza for this system in /etc/lilo.conf.

PS: I typed too slow...

PPS you can convert automatically /dev/sdX to "UUID=" also in /etc/lilo.conf. Just run lilo-uuid-diskid as root, see "man lilo-uuid-diskid".

TracyTiger 07-19-2015 02:35 AM

Man Page
 
Quote:

Originally Posted by Didier Spaier (Post 5393374)
Just run lilo-uuid-diskid as root, see "man lilo-uuid-diskid".

Thanks for suggesting this command. This command was new to me and I wanted to read about it so I tried "man lilo-uuid-diskid" but the man page couldn't be found in Slackware64 14.0. Still couldn't find the man page after executing makewhatis.

The command "/usr/sbin/lilo-uuid-diskid --help" suggested the following ...

Code:

perldoc -F /usr/sbin/lilo-uuid-diskid
... which yields a well formatted man page.

Just FYI.

Didier Spaier 07-19-2015 04:17 AM

@TracyTiger: the perloc commands works also in Slackware version 14.1. I just see slight ordering and formatting differences, and the man page has a "COPYRIGHT and LICENCE" paragraph and the author's email address.

Just in case (as you probably already know that) I remind that the lilo version shipped in Slackware version 14.0 can't handle big kernels, so if you want to use it to add a stanza for 14.1 or incoming 14.2 you should first upgrade lilo.


All times are GMT -5. The time now is 03:29 AM.