LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-28-2011, 08:37 PM   #1
vttay03
LQ Newbie
 
Registered: Dec 2009
Location: USA
Distribution: Slackware64 14.0
Posts: 29

Rep: Reputation: 3
Booting Generic Kernel


So I'm aware this is a pretty popular topic so please don't bite too hard

I use Grub as my boot manager and as you can see below, there are two entries for Slackware:

Code:
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd2,msdos1)'
	search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
	linux /boot/vmlinuz-generic-2.6.37.6 root=/dev/sdc1
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd2,msdos1)'
	search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
	linux /boot/vmlinuz-huge-2.6.37.6 root=/dev/sdc1
}
I have no issues booting the huge kernel. However, I'd like to boot the generic kernel. I started searching online and came across some things I thought would take care of it. I then read the "README.initrd" file on the SlackDVD and thought it'd be a simple process. So I did the following...

From within "usr/share/mkinitrd" I ran "mkinitrd_command_generator.sh". The output is listed below:

Code:
mkinitrd -c -k 2.6.37.6 -f ext4 -r /dev/sdc1 -m usb-storage:ehci-hcd:usbhid:xhci-hcd:jbd2:mbcache:ext4 -u -o /boot/initrd.gz
Afterwards I did a "cd /boot" and ran that command. However, every time I boot I get the following message:

Quote:
Kernel panic - not syncing: VFS: unable to mount root fs on unknown block
Any ideas? Like I said, I'm able to boot the huge kernel just fine...and yes, /dev/sdc1 is my root filesystem.
 
Old 06-28-2011, 08:46 PM   #2
vttay03
LQ Newbie
 
Registered: Dec 2009
Location: USA
Distribution: Slackware64 14.0
Posts: 29

Original Poster
Rep: Reputation: 3
I forgot to add the output when I run the "mkinitrd" command, it's posted below (appears to go alright):

Code:
sudo mkinitrd -c -k 2.6.37.6 -f ext4 -r /dev/sdc1 -m usb-storage:ehci-hcd:usbhid:xhci-hcd:jbd2:mbcache:ext4 -u -o /boot/initrd.gz                                                                  
Password:                                                                       
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/storage/usb-storage.ko added.      
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/ehci-hcd.ko added.            
OK: /lib/modules/2.6.37.6/kernel/drivers/hid/hid.ko added.                      
OK: /lib/modules/2.6.37.6/kernel/drivers/hid/usbhid/usbhid.ko added.            
OK: /lib/modules/2.6.37.6/kernel/drivers/usb/host/xhci-hcd.ko added.            
OK: /lib/modules/2.6.37.6/kernel/fs/jbd2/jbd2.ko added.                         
OK: /lib/modules/2.6.37.6/kernel/fs/mbcache.ko added.                           
OK: /lib/modules/2.6.37.6/kernel/fs/jbd2/jbd2.ko added.                         
OK: /lib/modules/2.6.37.6/kernel/fs/mbcache.ko added.                           
OK: /lib/modules/2.6.37.6/kernel/fs/ext4/ext4.ko added.                         
15644 blocks                                                                    
/boot/initrd.gz created.                                                        
Be sure to run lilo again if you use it.
 
Old 06-28-2011, 08:53 PM   #3
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
[deleted]

Last edited by Diantre; 07-07-2011 at 05:07 AM. Reason: OP not using lilo... oops.
 
Old 06-28-2011, 08:57 PM   #4
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
And do you need to tell grub where to find the initrd.gz?
 
Old 06-28-2011, 08:58 PM   #5
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by vttay03 View Post
So I'm aware this is a pretty popular topic so please don't bite too hard

I use Grub as my boot manager and as you can see below, there are two entries for Slackware:

Code:
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd2,msdos1)'
	search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
	linux /boot/vmlinuz-generic-2.6.37.6 root=/dev/sdc1
}
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd2,msdos1)'
	search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
	linux /boot/vmlinuz-huge-2.6.37.6 root=/dev/sdc1
}
You didn't add the initrd to your menuentry.

Code:
menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sdc1)" {
	insmod part_msdos
	insmod ext2
	set root='(hd2,msdos1)'
	search --no-floppy --fs-uuid --set 949bee22-eca8-4a80-9975-2aa43ad851e9
	linux /boot/vmlinuz-generic-2.6.37.6 root=/dev/sdc1
        initrd /boot/initrd.gz
}
 
Old 06-28-2011, 09:23 PM   #6
vttay03
LQ Newbie
 
Registered: Dec 2009
Location: USA
Distribution: Slackware64 14.0
Posts: 29

Original Poster
Rep: Reputation: 3
But since the "huge" kernel works and that menu entry appears identical to the "generic" one, this shouldn't be an issue should it? I ran 'update-grub' afterwards to update the "grub.cfg" file. I'm using GRUB2 so it's full of that automated crap and doesn't like you to edit the "grub.cfg" file directly.
 
Old 06-28-2011, 09:45 PM   #7
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
The huge kernel does not need an initrd, the generic one does.

By the way, why did you go out of your way to install grub2, when grub is on the install disc?

Last edited by andrewthomas; 06-28-2011 at 10:03 PM.
 
Old 06-29-2011, 06:03 AM   #8
vttay03
LQ Newbie
 
Registered: Dec 2009
Location: USA
Distribution: Slackware64 14.0
Posts: 29

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by andrewthomas View Post
The huge kernel does not need an initrd, the generic one does.

By the way, why did you go out of your way to install grub2, when grub is on the install disc?
Got ya...

I've got grub2 on another hard drive that I've been using to boot whatever OS I need. I didn't install any bootloader for Slackware figuring I'd just use grub2 to boot it (since Slackware is on my third hard drive). However, I'm really sort of fed up with the fact grub2 wants you to run the "update-grub" script in order to generate the *.cfg file. I'm glad you told me that grub was on the install disk. I'm going to plan on either installing it or lilo later tonight in order to test out what you've said above. I know there's a file for custom entries on grub2 but then you just end up with whatever "update-grub" discovered plus what you've entered...what can I say, I don't like clutter
 
Old 06-29-2011, 08:03 AM   #9
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
If you have grub2 on a different drive on the same machine, then you really don't need to install any bootloader.

What I do is to make a menu.lst file in /boot/grub with entries that are symlinks.

Then, when I update a kernel, I just update the symlinks myself and no update-grub is necessary to be able to boot.

You can even have an entry for vmlinuz-old and initrd-old.gz to be able to boot your previous kernel.

Here is what I use for my /boot/grub/menu.lst

Code:
title S64 3.0-git-latest
root (hd0,13)
kernel /boot/vmlinuz-git root=/dev/sda14 ro

title S64 3.0-git-previous
root (hd0,13)
kernel /boot/vmlinuz-git-old root=/dev/sda14 ro

title S64-huge latest
root (hd0,13)
kernel /boot/vmlinuz root=/dev/sda14 ro
Just make sure to add your initrd line to the generic entry
 
Old 06-29-2011, 08:43 AM   #10
vttay03
LQ Newbie
 
Registered: Dec 2009
Location: USA
Distribution: Slackware64 14.0
Posts: 29

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by andrewthomas View Post
If you have grub2 on a different drive on the same machine, then you really don't need to install any bootloader.

What I do is to make a menu.lst file in /boot/grub with entries that are symlinks.

Then, when I update a kernel, I just update the symlinks myself and no update-grub is necessary to be able to boot.

You can even have an entry for vmlinuz-old and initrd-old.gz to be able to boot your previous kernel.

Here is what I use for my /boot/grub/menu.lst

Code:
title S64 3.0-git-latest
root (hd0,13)
kernel /boot/vmlinuz-git root=/dev/sda14 ro

title S64 3.0-git-previous
root (hd0,13)
kernel /boot/vmlinuz-git-old root=/dev/sda14 ro

title S64-huge latest
root (hd0,13)
kernel /boot/vmlinuz root=/dev/sda14 ro
Just make sure to add your initrd line to the generic entry
Understood, that way you don't need to update your menu.lst file, only the symlinks. I've tracked down why Grub2 won't detect the "initrd.gz" file. It wants it to be named something like "initrd.img" instead. I also realized I can turn off the "os_prober" feature of Grub2 so it'll stop telling me what my menu entries should be. That way, I can just maintain my own file, similar to what you've stated above. I'll wait to claim victory until I can give it a try later tonight...
 
Old 06-29-2011, 07:52 PM   #11
vttay03
LQ Newbie
 
Registered: Dec 2009
Location: USA
Distribution: Slackware64 14.0
Posts: 29

Original Poster
Rep: Reputation: 3
Everything works! Thanks for your help...I ended up adding a "40_custom" file to Grub2 with the additional line "initrd /boot/initrd.gz" as you indicated above.
 
Old 06-29-2011, 08:28 PM   #12
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
You're welcome.

Glad to be of help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] setting up initrd / generic kernel in Grub2...can't load generic Ubunoob001 Slackware 12 03-20-2015 07:32 AM
[SOLVED] Slackware 64 crashes after booting generic kernel (64 bit) sombragris Slackware 14 05-04-2011 08:18 AM
How to compile debian kernel source into a generic kernel? linus72 Debian 3 04-29-2010 08:50 PM
[SOLVED] Problem booting generic kernel and another problem with fluxbox - libpng warning Switch7 Slackware 17 11-14-2009 03:36 AM
slack 12, switch to generic kernel from huge kernel, using grub? jaguarrh Slackware 8 09-19-2007 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration