Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
12-09-2013, 09:44 AM
|
#1
|
Member
Registered: Aug 2004
Distribution: Slackware 13.37, 14.1
Posts: 75
Rep:
|
Kernel panic when trying to use initrd
Hi guys,
I've been having trouble getting Slackware to boot with an initrd. The kernel panics when it is unable to mount the initrd. See screenshot here: https://www.dropbox.com/s/v8ktk5yh0mtkfge/IMG_3804.JPG (Directly following that output was a stack trace from the kernel.)
I have lilo installed on the mbr of /dev/sda, and Slackware installed to /dev/sdb3.
I generated my initrd with:
mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sdb3 -m usbhid:hid_generic:uhci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
(command generated from /usr/share/mkinitrd/mkinitrd_command_generator.sh)
Is this a limitation of lilo? (Being installed on the mbr of the first drive, while the rootfs and initrd are on a different physical drive?)
Below is my lilo.conf, and output from a lilo run:
Code:
# lilo.conf
boot = /dev/sda
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
append=" vt.default_utf8=1"
prompt
timeout = 300
vga = ask
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sdb3
label = Linux
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-smp-3.10.17-smp
root = /dev/sdb3
initrd = /boot/initrd.gz
label = LinuxInitRd
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
# Windows bootable partition config begins
other = /dev/sda1
label = Windows
table = /dev/sda
# Windows bootable partition config ends
Code:
# /sbin/lilo
Warning: LBA32 addressing assumed
Warning: The boot sector and map file are on different disks.
Added Linux *
Added LinuxInitRd +
Added Windows
2 warnings were issued.
|
|
|
12-09-2013, 09:50 AM
|
#2
|
Senior Member
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,356
Rep:
|
I have booted roots on sdb from lilo on sda in the past.
I don't know anything about mkinitrd commands but yours looke very complicated. Can't you just use the form suggested in the README in /boot?
|
|
|
12-09-2013, 10:04 AM
|
#3
|
Member
Registered: Aug 2004
Distribution: Slackware 13.37, 14.1
Posts: 75
Original Poster
Rep:
|
Hi arubin,
Thanks for your reply. I am able to successfully boot with the default ("huge") kernel in the same root, but I think lilo is having a hard time finding my initrd (a guess based on the output in the screenshot above.)
The differences between my mkinitrd command and the simple one listed in /boot/README.initrd are:
I have modules loaded for keyboard support in my initrd (usbhid:hid_generic:uhci-hcd)
I pass the -u option, indicating that the initrd should include udev
I explicitly name the output file /boot/initrd.gz with the -o option
I'm going to try again without the -u option and see if that makes any difference. Thanks again for your reply!
|
|
|
12-09-2013, 10:11 AM
|
#4
|
Member
Registered: Aug 2004
Distribution: Slackware 13.37, 14.1
Posts: 75
Original Poster
Rep:
|
Sadly, removing the -u option had no effect on the behavior.
|
|
|
12-09-2013, 10:11 AM
|
#5
|
Senior Member
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,356
Rep:
|
Years ago I would get frustrated with initrd problems and ended up compilng kernels which included ext3. I have never had to add keyboard support to initrd.
I suspect that most of my problems were due to minor errors in the mkinitrd command. The best solution to that was copy and pasting from the README.
|
|
|
12-09-2013, 10:23 AM
|
#6
|
Member
Registered: May 2004
Distribution: Slackware
Posts: 215
Rep:
|
I'm not in front of my Linux machine, but are you sure the argument to -k with mkinitrd should be "3.10.17-smp"? If I recall, I'm pretty sure I've just used "-k 3.10.17."
Dave
Edit: After inspecting the Slackware file tree, I realize this may be a 32-bit Slack vs. 64-bit Slack thing. My (recent) experience is with 64-bit. You should probably ignore the above.
Last edited by xflow7; 12-09-2013 at 10:26 AM.
|
|
|
12-09-2013, 11:12 AM
|
#7
|
Member
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528
|
Remove "root =" in lilo.conf
In general you should not use the "root =" line in lilo.conf when using mkinitrd. It causes problems. You've already said which partition to use as root with the -r option in mkinitrd.
You may want to try commenting out that line in lilo.conf and re-running lilo to see if that helps.
|
|
|
12-09-2013, 02:44 PM
|
#8
|
Member
Registered: Aug 2004
Distribution: Slackware 13.37, 14.1
Posts: 75
Original Poster
Rep:
|
Thanks Tracy Tiger; I initially had no "root = " line in my lilo.conf, and the result of that is here:
https://www.dropbox.com/s/znx34y5ogb9u21r/IMG_3800.JPG
I was (apparently?) able to boot the generic kernel with an initrd from grub, but I don't know how to confirm which kernel is running... 'uname -a' doesn't seem to specify "generic" vs "huge"
I'd still like to use lilo if possible; I don't have any idea how grub works; it seems huge at glance.
|
|
|
12-09-2013, 04:48 PM
|
#9
|
Member
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528
|
My lilo.conf files include "lba32" which it appears lilo defaults to anyway.
My lilo.conf files also include change-rules and reset just before the vga = line. I don't know if these are important or not, I've just always included them.
You also have a comment after the read-only line. I'm not sure if comments work other than consuming an entire line beginning with # in column 1.
Make sure that the file system included in initrd.gz (ext4) is actually the file system used on the partitions.
If I was in your position I would check that the vmlinuz images and initrd.gz files are actually the correct ones in the right locations. Perhaps go back to the original kernel image files and lilo with the huge kernel and delete the initrd tree and initd.gz file. In other words start over from the point of a successful build with using the huge kernel. Then carefully consider and verify each step in the process.
Others more experienced than I may recognize the error and give you a more direct path to solve your problem.
EDIT: Make sure that you aren't manually typing in boot parameters that conflict with your lilo and initrd setup.
Last edited by TracyTiger; 12-09-2013 at 05:00 PM.
Reason: Boot Parameter Conflict
|
|
|
12-09-2013, 05:19 PM
|
#10
|
Senior Member
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,356
Rep:
|
Quote:
I don't know how to confirm which kernel is running
|
dmesg | grep vmlinuz
Quote:
root@Lavankossot:/home/alan# dmesg | grep vmlinuz
[ 0.000000] Command line: vmlinuz-generic-3.10.17 root=/dev/sda1 ro initrd=\EFI\refind\initrd.gz
[ 0.000000] Kernel command line: vmlinuz-generic-3.10.17 root=/dev/sda1 ro initrd=\EFI\refind\initrd.gz
|
|
|
|
12-09-2013, 05:34 PM
|
#11
|
Member
Registered: Jul 2009
Location: NYC
Distribution: Slackware64-multilib 15.0, SARPI, artix
Posts: 414
Rep:
|
I've been using Linux on and off since 2005ish or 06 or something, I don't remember, anyway... I have never ever successfully created an initrd.gz and have always had to run a static kernel, until I read this post:
https://www.linuxquestions.org/quest...8/#post5077679
Maybe it will at least give you a pointer or two.
|
|
|
12-09-2013, 05:36 PM
|
#12
|
Member
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528
|
Two additional points to add to arubin's excellent method of noting which kernel file is running....
If you're like me and don't use "vmlinuz" in the file name you can grep for "ommand" in the dmesg output.
If you don't have root access to run dmesg you can check the command line as a regular user.
Code:
cat /proc/cmdline
BOOT_IMAGE=Linux-Generic ro vt.default_utf8=0
EDIT: The output only gives the LABEL of the lilo image used not the actual file name. It can still be helpful but can be misleading if the lilo.conf file has changed and lilo/reboot not completed. (Slack64 14.0)
Last edited by TracyTiger; 12-09-2013 at 05:49 PM.
Reason: Label not file name
|
|
|
12-09-2013, 06:22 PM
|
#13
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Quote:
Originally Posted by thegoofeedude
Thanks Tracy Tiger; I initially had no "root = " line in my lilo.conf, and the result of that is here:
https://www.dropbox.com/s/znx34y5ogb9u21r/IMG_3800.JPG
I was (apparently?) able to boot the generic kernel with an initrd from grub, but I don't know how to confirm which kernel is running... 'uname -a' doesn't seem to specify "generic" vs "huge"
I'd still like to use lilo if possible; I don't have any idea how grub works; it seems huge at glance.
|
Grub has the advantage that you can interactively select/change your boot setup during boot.
Which grub stanza did you select when you booted via grub? Is this grub or grub2 (the formats of the configuration files are different between the two.)
|
|
|
12-09-2013, 08:39 PM
|
#14
|
Member
Registered: Oct 2007
Distribution: FreeBSD, Slackware
Posts: 48
Rep:
|
Hi,
I had slackware on external hardware but the module names generated by the script look different. I had
"usb-storage:ehci-hcd:ehci-pci:mbcache:jbd2:ext4". When you are logged in with huge kernel, you can try like
Code:
mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sdb3 -m usb-storage:ehci-hcd:ehci-pci:mbcache:jbd2:ext4 -u -w 10 -o /boot/initrd.gz
"-w 10" is useful for external hdd.
I'm not sure, but may be initrd line should come before root line i.e., after image line in you lilo.conf? Like
Code:
image = /boot/vmlinuz-generic-smp-3.10.17-smp
initrd = /boot/initrd.gz
root = /dev/sdb3
label = LinuxInitRd
read-only
As always reminded, don't forget to run lilo after editing lilo.conf.
Last edited by saivinoba; 12-09-2013 at 10:37 PM.
Reason: to correct typo
|
|
|
12-09-2013, 09:55 PM
|
#15
|
LQ Guru
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 5,063
|
Curiousity
Greetings
Since even now that I have very modern hardware (on this box anyway) and I have never had to use an initrd, I can't help but wonder why anyone would want to add what seems to me unnecessary complexity. So would you at some point say what it is you hope to gain through this extra step(s)? I'm not trying to dissuade you from doing so, just wondering why anyone would.
|
|
|
All times are GMT -5. The time now is 12:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|