LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-30-2008, 01:53 AM   #1
titaniumdecoy
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Rep: Reputation: 0
Adding a kernel to grub


I have compiled a kernel from source and am trying to boot with it. (I am using Ubuntu 8.10.) I added a new entry to my grub file by copying a working entry. A snippet of my /boot/grub/menu.lst file is show below.

Code:
# DEFAULT WORKING ENTRY
title		Ubuntu 8.10, kernel 2.6.27-9-generic
uuid		778cb529-8914-451a-97ee-fb2d8ae404ae
kernel		/boot/vmlinuz-2.6.27-9-generic root=UUID=778cb529-8914-451a-97ee-fb2d8ae404ae ro quiet splash 
initrd		/boot/initrd.img-2.6.27-9-generic
quiet

# CUSTOM ADDED ENTRY
title		Custom Kernel
uuid		778cb529-8914-451a-97ee-fb2d8ae404ae
kernel		/boot/bzImage root=UUID=778cb529-8914-451a-97ee-fb2d8ae404ae
ro quiet splash 
initrd		/boot/initramfs
quiet
bzImage is my compiled kernel. I created the initramfs file via the command mkinitramfs -o initramfs `uname -r`.

When I select the custom kernel from the grub boot menu, it outputs a bunch of text and eventually outputs the following:

Code:
WARNING: Couldn't open directory /lib/modules/2.6.28: No such file or directory
FATAL: Could not open /lib/modules/2.6.28/modules.dep.temp for writing: No such file or directory
...
Begin: Waiting for root file system... ... 
...
Done.
Gave up waiting for root device.  Common problems:
...
ALERT! /dev/disk/by-uuid/778cb529-8914-451a-97ee-fb2d8ae404ae does not exist.  Dropping to a shell!

BusyBox v1.10.2. (Ubuntu 1:1.10.2-1ubuntu6) built-in shell (ash)
...

(initramfs) _
My guess is that either:
1) I configured the grub file incorrectly
2) The initramfs file was not properly created

Please help! Thanks in advance.

Last edited by titaniumdecoy; 12-30-2008 at 01:55 AM.
 
Old 12-30-2008, 11:28 AM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
It seems like your ramfs was made without the "device mapper" support, that loads the module dm-mod.ko. You can solve by creating the ramfs file with the right options (I don't know the exact option as I use mkinitrd), or by compiling the device mapper into the kernel itself, not as a module
 
Old 12-30-2008, 11:45 AM   #3
titaniumdecoy
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks clvic, that is very helpful.

What options do you use for mkinitrd? And do you know what the name of the kernel option is? Thanks.

EDIT: I believe the config option is Device Drivers -> Multi-device support (RAID and LVM) ->
Device mapper support.

EDIT: Can someone tell me the options for mkinitrd to create an initrd with device mapper support?

Last edited by titaniumdecoy; 12-30-2008 at 12:58 PM.
 
Old 12-30-2008, 01:46 PM   #4
titaniumdecoy
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Original Poster
Rep: Reputation: 0
I recompiled the kernel with Device mapper support enabled (via the config option in my previous post) and I get a similar message.

Is there another option I need to use to enable device mapping? Or could someone enlighten me as to how to create an initramfs with support for device mapping? Thanks.

EDIT: I don't know if it's relevant but I always get this error before the others when I try to boot:
[ 1.6787027] alg: cipher: Test 1 failed on encryption for aes-asm

Last edited by titaniumdecoy; 12-30-2008 at 01:56 PM.
 
Old 12-30-2008, 02:02 PM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Since you're using Ubuntu, you should be using this methodology to compile and install a kernel:

http://www.howtoforge.com/kernel_compilation_ubuntu

dpkg -i will install it in menu.lst

Last edited by Quakeboy02; 12-30-2008 at 02:07 PM.
 
Old 12-30-2008, 02:10 PM   #6
titaniumdecoy
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Original Poster
Rep: Reputation: 0
@Quakeboy02: Thanks, I have spent so long on this method already though I want to give it another shot.

I gave up on using the UUID in grub. So now I have this in my /boot/grub/menu.lst file:

Code:
title		kernel 2.6.28
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.28 root=/dev/sda1
initrd		/boot/initrd.img-2.6.28
I am getting the same errors. Are my values correct (ie, the (hd0,0) and /dev/sda1)? The contents of my /etc/fstab file are below:

Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1
UUID=778cb529-8914-451a-97ee-fb2d8ae404ae /               ext3    relatime,errors=remount-ro 0       1
# /dev/sda5
UUID=31169659-b1a0-4192-91f4-7d65b4f74655 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
# Beginning of the block added by the VMware software
.host:/                 /mnt/hgfs               vmhgfs  defaults,ttl=5     0 0
# End of the block added by the VMware software
It really is this poorly formatted.
 
Old 12-30-2008, 02:41 PM   #7
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by titaniumdecoy View Post
@Quakeboy02: Thanks, I have spent so long on this method already though I want to give it another shot.
Suit yourself, but using the Ubuntu (Debian) method, there are very few steps that you have to take.

Quote:
I gave up on using the UUID in grub. So now I have this in my /boot/grub/menu.lst file:

Code:
title		kernel 2.6.28
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.28 root=/dev/sda1
initrd		/boot/initrd.img-2.6.28
Here are the entries in my menu.lst file for 2.6.28. I'm not sure if your issue is that "ro" is missing or not. I have no way of knowing if you added a suffix; in my case "-k8". What is the actual directory name in /lib/modules?
Code:
title           Debian GNU/Linux, kernel 2.6.28-k8
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.28-k8 root=/dev/sda1 ro
initrd          /boot/initrd.img-2.6.28-k8

title           Debian GNU/Linux, kernel 2.6.28-k8 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.28-k8 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.28-k8

Last edited by Quakeboy02; 12-30-2008 at 02:43 PM.
 
Old 12-31-2008, 01:00 AM   #8
titaniumdecoy
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Original Poster
Rep: Reputation: 0
I tried the method suggested by Quakeboy02. I wiped the system to make sure the old kernel was not in the way. I let the Ubuntu (Debian) package system take care of everything for me. In the end, I got the exact same error. I am using defconfig which includes device mapper support.

Any ideas? Thanks in advance.
 
Old 12-31-2008, 12:21 PM   #9
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Are you saying that you used "dpkg -i" to install the new kernel ".deb" file and got the same grub problem?
 
Old 12-31-2008, 01:35 PM   #10
titaniumdecoy
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Quakeboy02 View Post
Are you saying that you used "dpkg -i" to install the new kernel ".deb" file and got the same grub problem?
Yes, that is what I am saying.
 
Old 12-31-2008, 03:20 PM   #11
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by titaniumdecoy View Post
Yes, that is what I am saying.
OK, can I see the exact command that you used to compile your kernel, as well as the entire contents of your menu.lst file in a code block?
 
Old 01-01-2009, 03:12 AM   #12
titaniumdecoy
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Original Poster
Rep: Reputation: 0
I finally got it working. I changed the following values in my .config file although I'm not sure which was/were responsible for making it work:

Code:
CONFIG_FUSION=y
CONFIG_FUSION_SPI=y
CONFIG_SCSI=y
CONFIG_SCSI_NETLINK=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_ISCSI_ATTRS=y
CONFIG_SCSI_SAS_ATTRS=y
Thanks, Quakeboy02, for all your help.
 
Old 01-01-2009, 11:19 AM   #13
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Glad you got it working! I wish I knew exactly what was wrong. I saw one with similar issues not too long ago, and it was Ubuntu, as well. I suspect that it was the CONFIG_SCSI line that fixed it, but the problem most likely relates somehow to initrd, like you said in your first post. On Debian I am able to get away with CONFIG_SCSI=m.

Anyway, Happy New Year, and have fun!
 
Old 04-16-2010, 01:57 AM   #14
alcarola
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
Thanks, that solved my problem!

I'm almost sure the crucial one is CONFIG_BLK_DEV_SD=y. That was the case for me at least. You get a hint by looking för sd in dmesg.
 
  


Reply

Tags
grub, initramfs, kernel



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
Adding to Grub zchoyt Linux - Software 3 08-15-2005 10:34 PM
Adding to GRUB stolieman Linux - General 1 11-20-2004 12:42 AM
adding OS to Grub jturnbul Fedora 6 09-16-2004 08:29 PM
1st HDD = RH9.0 (grub) ... How do I modify grub when adding 2nd hard disk ? Onyx^ Linux - Software 1 09-05-2003 09:16 AM
Help adding XP to Grub? superdigg Linux - Newbie 1 01-09-2003 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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