LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-04-2011, 01:34 PM   #1
Ubunoob001
Member
 
Registered: Feb 2010
Location: New Orleans, LA
Distribution: Mint 16 RC, Elementary OS Luna, Crunchbang
Posts: 166

Rep: Reputation: 17
Smile setting up initrd / generic kernel in Grub2...can't load generic


So I am trying to figure out how to load the generic kernel in Grub2.

1. I have run the /usr/hare/mkinitrd/mkinitrd_command_generator.sh and ran the output:
Code:
 /usr/share/mkinitrd/mkinitrd_command_generator.sh
#
# mkinitrd_command_generator.sh revision 1.40
#
# This script will now make a recommendation about the command to use
# in case you require an initrd image to boot a kernel that does not
# have support for your storage or root filesystem built in
# (such as the Slackware 'generic' kernels').
# A suitable 'mkinitrd' command will be:

mkinitrd -c -k 2.6.33.4-smp -f ext4 -r /dev/sda5 -m jbd2:mbcache:ext4 -o /boot/initrd.gz
root@laptop1:/home/user1# mkinitrd -c -k 2.6.33.4-smp -f ext4 -r /dev/sda5 -m jbd2:mbcache:ext4 -o /boot/initrd.gz
OK: /lib/modules/2.6.33.4-smp/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/2.6.33.4-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/2.6.33.4-smp/kernel/fs/ext4/ext4.ko added.
6697 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
now following this, from Kubuntu, I ran update-grub. The part of grub.cfg that contains the Slackware listings show this:
Code:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-2.6.33.4 root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-huge-2.6.33.4 root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-huge-smp-2.6.33.4-smp root=/dev/sda5
}
### END /etc/grub.d/30_os-prober ###
Since nothing had changed from before (note have been only able to load the huge kernels, generics kernel panic), I then added a custom entry to etc/grub.d/40_custom (as ubuntu asks for) rather than editing the grub.cfg file. My addition is:
Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
        intird /boot/initrd.gz
}
which then makes the updated grub.cfg file
Code:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-2.6.33.4 root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-huge-2.6.33.4 root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-huge-smp-2.6.33.4-smp root=/dev/sda5
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
        intird /boot/initrd.gz
}
### END /etc/grub.d/40_custom ###
can someone please point me in the right direction as to why this will not load. Many thanks from a newbie.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-04-2011, 01:44 PM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
could you tell me if Ubuntu is on the sda drive also. I have had some problems with install on sdb1 and slackware on sda1 and ubuntu thinking slackware is sdb1 and ubuntu is sda1.
Quote:
insmod ext2
and you see grub may not be loading ext4 but when you load the vmlinuz huge it has the ext4 module. but the generic kernel will not have it.so when it goes to look for the initrd.img it will be unable to mount the ext4 fs . you will be unable to sync or file system.
No root device.
Quote:
The next time you get to the Grub2 menu, type "c" to get to the Grub prompt. Type "lsmod" and it will show which modules are loaded. You will find ext2 listed as one of the loaded modules.

Hint: If too many modules are loaded, they may scroll off the page. To see them all, type "set pager=1" and you will be able to scroll through the list using the ENTER key.

Try to load ext4 with "insmod ext4". On my computer, I get a "error: file not found" since the ext4 module doesn't exist.
How to enter 'Edit Mode'.this link here
Press your 'e' key from your GRUB Menu to switch into 'Edit Mode'.
Use your 'Esc' key to return to the GRUB menu.

why does grub see it but vmlinuz generic doesn't? Because when the small system grub2 rleases to the kernel the ext4 module is gone.
now the kernel starts to run but can't load the ext4 because it is on a file system that it cant see.
As you may know grub2 is for ubuntu.
there is a couple other reasons but I need more input on your kernel panic code.

Last edited by Drakeo; 01-04-2011 at 02:08 PM.
 
Old 01-04-2011, 02:03 PM   #3
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Like you, I get a kernel panic in Slackware if I boot using the top menu entry (the "generic" kernel), but boot fine if I use the "huge" kernel. This is (as far as I know / can guess) not a problem with Grub2, it's to do with Slackware configuration - especially considering the huge kernel boots, and the only difference between the menu entries is the "linux /boot..." line. If you wanted to track down the source of the error, then you'd have to look at the difference between the huge and the generic kernels.

EDIT: No luck for me, at least, with Drakeo's suggestion, but that's the sort of thing I would expect it to be and the error I get is something like "Unable to mount root VFS filesystem on unknown block (0,18)"

Last edited by Snark1994; 01-04-2011 at 02:12 PM.
 
Old 01-04-2011, 06:55 PM   #4
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Quote:
Quote:
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
insmod ext2
set root='(hd0,5)' <--------------this is /dev/sda6
search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5 <------------this is not in sync
intird /boot/initrd.gz <--------------------this is not in sync
do you see that. point it to. this will cause your problem
like I said grub2 has problems with mapping drives and reading bios.
Examples of the difference between Linux and GRUB device names.
Quote:
Linux IDE: GRUB IDE: Linux SCSI: GRUB SCSI:
/dev/hda1 ..... (hd0,0)..... /dev/sda1..... (hd0,0)
/dev/hda2 ..... (hd0,1)..... /dev/sda2..... (hd0,1)
/dev/hda3 ..... (hd0,2)..... /dev/sda3..... (hd0,2)
/dev/hda4 ..... (hd0,3)..... /dev/sda4..... (hd0,3)
/dev/hdb1 ..... (hd1,0)..... /dev/sdb1 ..... (hd1,0)
/dev/hdb2 ..... (hd1,1)..... /dev/sdb2 ..... (hd1,1)
/dev/hdb3 ..... (hd1,2)..... /dev/sdb3 ..... (hd1,2)
/dev/hdb4 ..... (hd1,3)..... /dev/sdb4 ..... (hd1,3)
your best bet is to change root=/dev/sda6 for (hd0,5)

Last edited by Drakeo; 01-04-2011 at 07:06 PM.
 
Old 01-04-2011, 07:11 PM   #5
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Rep: Reputation: 142Reputation: 142
There is a typo in your custom menu entry
Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
        intird /boot/initrd.gz
}
"intird" should be "initrd"

Also, if you want "update-grub" to detect the initrd automatically, rename it to "initrd.gz-generic-smp-2.6.33.4-smp"

@Drakeo

It's slightly different in Grub2, the first drive is counted as 0, and the first partition is 1.

So
Code:
Linux:      Grub Legacy   Grub2
/dev/sda1...(hd0,0).......(hd0,1)
/dev/sda2...(hd0,1).......(hd0,2)
/dev/sda3...(hd0,2).......(hd0,3)
/dev/sda4...(hd0,3).......(hd0,4)
/dev/sda5...(hd0,4).......(hd0,5)

Last edited by piratesmack; 01-04-2011 at 07:42 PM.
 
2 members found this post helpful.
Old 01-04-2011, 09:49 PM   #6
Ubunoob001
Member
 
Registered: Feb 2010
Location: New Orleans, LA
Distribution: Mint 16 RC, Elementary OS Luna, Crunchbang
Posts: 166

Original Poster
Rep: Reputation: 17
Lightbulb

Quote:
Originally Posted by piratesmack View Post
There is a typo in your custom menu entry
Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
	insmod ext2
	set root='(hd0,5)'
	search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
	linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
        intird /boot/initrd.gz
}
"intird" should be "initrd"

Also, if you want "update-grub" to detect the initrd automatically, rename it to "initrd.gz-generic-smp-2.6.33.4-smp"


[/code]
Piratesmack, I feel silly for making such a trivial error in spelling, however this did, infact, make the custom menu entry, and thus the generic smp kernel bootable. On to trying to clean up grub and making grub recognize it without the need for a custom additional (5 now) entries for Slackware. Thanks!



Quote:
Also, if you want "update-grub" to detect the initrd automatically, rename it to "initrd.gz-generic-smp-2.6.33.4-smp"
in which config file are you referring to? Editing the main grub.cfg file so I dont have to have the custom boot option? Thanks again for helping a novice. I'm sure it should be taken with a grain of salt, but Ubuntu warns in bold "DO NOT EDIT THIS FILE, it is genated using templates from /etc/grub.d and settings from /etc/default/grub".

Can i Just ignore this and edit the non-working generic boot option to be the same as the current (spelling corrected) custom entry?


---------

also thanks to Drakeo

Last edited by Ubunoob001; 01-04-2011 at 09:56 PM.
 
Old 01-04-2011, 11:22 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
See http://www.linuxquestions.org/questi...2/#post4211074
 
Old 01-05-2011, 10:24 AM   #8
Ubunoob001
Member
 
Registered: Feb 2010
Location: New Orleans, LA
Distribution: Mint 16 RC, Elementary OS Luna, Crunchbang
Posts: 166

Original Poster
Rep: Reputation: 17
Smile

Quote:
Originally Posted by Richard Cranium View Post
Okay thanks.
 
Old 01-05-2011, 11:37 PM   #9
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
guess I learn every day. thanks

Last edited by Drakeo; 01-05-2011 at 11:41 PM.
 
Old 03-18-2015, 01:09 AM   #10
nycace36
Member
 
Registered: Feb 2004
Location: SFBayArea, CA
Distribution: Debian-based, Slackware 10x+
Posts: 185

Rep: Reputation: 22
Very helpful for Grub2'ers!

Have been fairly annoyed over the years that most "solutions" to getting a /boot initrd working seem to automatically keep **ASSUMING** that the Slackware bootloader is LILO instead of grub2.

This false assumption continues to be problematic for those having Grub2 load other distros and then getting continually, almost blindingly, push-pushed within the Slackware help guides into install the generic Slackware kernel with an initrd (of course using LILO) for maximum efficiency. Encouragement as in http://docs.slackware.com/slackware:beginners_guide and http://docs.slackware.com/slackbook:booting

I think that the better solution is to go ahead and follow the 'mkinitrd' suggestions at http://docs.slackware.com/slackbook:booting and then halt before doing all that LILO junk the Slackware guides keep throwing at you. At that point, the previously mentioned steps for adding one or more file entry for /etc/grub.d/* are immensely helpful, followed by manually adding the ending generic kernel and initrd lines as
Code:
linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
initrd /boot/initrd.gz-generic-smp-2.6.33.4-smp
Then run "update-grub" to detect the initrd here automatically and form a good working /boot/grub/grub.cfg

My hearty
 
Old 03-18-2015, 06:50 AM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by nycace36 View Post
seem to automatically keep **ASSUMING** that the Slackware bootloader is LILO instead of grub2.
Quote:
Originally Posted by nycace36 View Post
This false assumption
Quote:
Originally Posted by nycace36 View Post
that LILO junk the Slackware guides keep throwing at you
There is a reason people do that. Slackware uses LILO by default. Of course the guides are going to mention how to use the default setup. Not everyone runs dual boot with other distros that use grub, and while there are some Slackers that prefer grub(2) over LILO, many do not and they like the fact that Slackware uses LILO.

All that being said, if you feel that a lot of users are running into the same issues as you, you're more than welcome to update the Slackware docs. The forum isn't always the easiest place for other users to find information like this, since the terms in a search engine would turn up a lot of unrelated results.
 
Old 03-20-2015, 02:39 AM   #12
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
And maybe don't bring a 3 year old thread to life the next time.
 
Old 03-20-2015, 07:32 AM   #13
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104
Quote:
Originally Posted by nycace36 View Post
I think that the better solution is to go ahead and follow the 'mkinitrd' suggestions at http://docs.slackware.com/slackbook:booting and then halt before doing all that LILO junk the Slackware guides keep throwing at you.
You know that that is a Wiki link, right?
Instead of spewing your angry words, get wise and request a Wiki account or join the mailing list, so that you can propose a modification to that page. Or if you do not want an account, use the "Discussion" page to write your suggestions.

Creating good documentation is not trivial, and it's very easy to stand at the sideline and point your finger. The Wiki team is always glad to get suggestions.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] initrd and generic kernel fails to boot with errors after using mkinitrd generator adamschock Slackware 8 06-26-2010 02:30 PM
Generic kernel + initrd not working rpedrica Slackware 12 06-22-2010 10:17 AM
what are initrd.img-2.6.28-11-generic and vmlinuz-2.6.28-11-generic? karuna-bdc Linux - Newbie 11 07-17-2009 05:00 AM
Generic SMP kernel with no initrd? songangel Slackware 8 03-26-2009 06:12 PM
GART TLB error generic level generic Clydesdale Linux - Hardware 0 08-13-2007 06:18 PM

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

All times are GMT -5. The time now is 10:16 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