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 06-25-2008, 03:37 PM   #1
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477

Rep: Reputation: 51
Choosing between kernels at boot using grub


Hello Everyone,

I have been reading a number of threads about changing kernels with Slack 12.1. When I first installed, I chose the huge-smp kernel because I suppose I misread the instructions and thought I needed that with a dual core processor. But, in the CHANGES_AND_HINTS it indicates that I should have used the generic-smp kernel.

The huge kernel has been working fine for me and I have the fglrx drivers installed. However, boot times are a little sluggish and overall speed while I am running the OS seems slightly less than I remember Slack being in the past. I was just curious to find out if I would get any noticable performance boost with the generic kernel. But, there are two caveats:

1. I want to continue to be able to boot the system as it is, and

2. I am using grub, not lilo.

Is it possible to be able to boot two kernels, choosing between them at boot?

Thanks for any replies.

Bob
 
Old 06-25-2008, 03:54 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
Yes, you can have multiple kernels on a system and choose which to boot using GRUB.

GRUB should be controlled by /boot/grub/grub.conf or /boot/grub/menu.lst (I don't know which way Slack does it.) In it, there will be entries for each kernel, comprised of four lines...

title ...
root ...
kernel ...
initrd ...

Somewhere above those, there will be a "default=" line to tell the system which to boot if you don't make a choice.
 
Old 06-25-2008, 03:59 PM   #3
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 492
Blog Entries: 1

Rep: Reputation: 55
Bob.
I am doing exactly what you want. I have installed the huge-smp & generic-smp kernels. My /boot/grub/menu.lst file:
Quote:
# GRUB configuration file
# Global settings
default 0
timeout 5
color cyan/blue white/blue
# End Global settings
# Linux boot stanzas begin
title Slackware-12.1 Generic Desktop
root (hd0,0)
kernel /generic root=/dev/sda2 ro 4
initrd /initrd.gz
#
title Slackware-12.1 Generic Command Line
root (hd0,0)
kernel /generic root=/dev/sda2 ro
initrd /initrd.gz
#
title Slackware-12.1 Huge Command Line
root (hd0,0)
kernel /huge root=/dev/sda2 ro
initrd /initrd.gz
 
Old 06-25-2008, 04:08 PM   #4
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,297

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Quote:
Originally Posted by BobNutfield
The huge kernel has been working fine for me and I have the fglrx drivers installed. However, boot times are a little sluggish and overall speed while I am running the OS seems slightly less than I remember Slack being in the past. I was just curious to find out if I would get any noticable performance boost with the generic kernel.
You *may* notice a *slight* speed increase, but it won't be much, if anything. At least, that's my experience. Bootup time may decrease slightly since fewer modules are loaded, and RAM use *may* (but almost certainly won't) decrease since fewer modules are loaded, but I don't think you'll notice much of a difference in running speed. However, I would still recommend using the generic-smp kernel over the huge-smp kernel. I personally have two options -- I can either boot the generic-smp kernel (default) or the huge-smp kernel (I must manually select that at the LILO prompt). You can use the same setup for GRUB (though the syntax of the kernel stanza in menu.lst will be different than lilo.conf).

You must create an initrd (initial ramdisk) to use the generic kernel since the filesystems and some hard drive controllers are compiled as modules instead of built into the kernel. See /boot/README.initrd for more information. For a nice script that usually outputs the correct mkinitrd command to use (to generate the initrd), see here. The mkinitrd command will create a /boot/initrd.gz file and a /boot/initrd-tree directory. Then, add a stanza for your generic-smp kernel (while leaving your huge-smp kernel stanza alone to make sure you can still boot using that). My LILO kernel stanzas are shown below (Note: they WILL have to be adapted to menu.lst style. I'm not proficient with that so I won't try to create the correct syntax, since I may screw it up).
Code:
image = /boot/vmlinuz-generic-smp-2.6.24.5-smp
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = Generic
  read-only  # Partitions should be mounted read-only for checking

image = /boot/vmlinuz-huge-smp-2.6.24.5-smp
  root = /dev/sda1
  label = Huge
  read-only
You should be able to copy your old kernel stanza and just change the location of the kernel to match the generic-smp one, and add the initrd part. A quick google search found this page. Although it's for Ubuntu, it has a menu.lst stanza that shows the syntax of adding an initrd. Note that by default Slackware's initrd will be located at /boot/initrd.gz, as shown in my LILO stanzas. Beyond that, you should probably just copy your existing stanza to the letter.
 
Old 06-25-2008, 04:12 PM   #5
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477

Original Poster
Rep: Reputation: 51
Thank you for your response...

I know how to put the correct entries in Grub, but I was not sure how to set up two different kernels because, as I understand it, Slackware uses a symlink from vmlinuz to the huge-smp kernel, so I guess my question is more about the system configuration files and whether I could point grub directly to the kernel I wanted to boot without dealing with the system configuration files (knowing that I need an initrd with the generic kernel, which I have already made.). So, my question is, if I alter Grub (which is not a Slackware file, but Slack boots from it) to look like something like this:

Slack Generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.24.5-generic-smp root=/dev/sda3
initrd /boot/initrd.gz

Slack Huge
root (hd0,2)
kernel /boot/vmlinuz-2.6.24.5-huge-smp root=/dev/sda3


There is a system map and system config file for each kernel. The ATI drivers are installed on the currently running huge kernel, but since I have never tried the generic kernel, I am assuming I would have to download a new driver file for that kernel as well. My desire is NOT to mess up what I already have because it is working nicely.

Bob
 
Old 06-25-2008, 04:18 PM   #6
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by TSquaredF View Post
Bob.
I am doing exactly what you want. I have installed the huge-smp & generic-smp kernels. My /boot/grub/menu.lst file:
Thank, TSquaredF. That is exactly what I wanted to know. Since there is a system map and config file, I guess I just need to point grub to the correct kernel, but I am still wondering about the ATI drivers, will need to install a new one for the generic kernel>

Bob
 
Old 06-25-2008, 04:23 PM   #7
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477

Original Poster
Rep: Reputation: 51
T3slider,

Thanks. The whole point was to decrease boot time and boot performance, but if I am going to little or none of either, I am not going to mess with the system and risk it. Slack is the best performing distro I have now, and if can't improve on that I might as well just leave it alone.

Thanks again.


Bob
 
Old 06-25-2008, 10:48 PM   #8
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 492
Blog Entries: 1

Rep: Reputation: 55
Quote:
Originally Posted by BobNutfield View Post
Thank, TSquaredF. That is exactly what I wanted to know. Since there is a system map and config file, I guess I just need to point grub to the correct kernel, but I am still wondering about the ATI drivers, will need to install a new one for the generic kernel>

Bob
I don't worry about linking config or System.map. I make two links, "huge" & "generic" to the appropriate kernel. I'm using copies of the same kernels in my laptop, desktop & server machines. I have the same partition layout on the laptop & the desktop, so use the same menu.lst for both of them. Keep it all in a seperate boot partition & backups are almost automatic. I built the ATI driver for my laptop with scripts from SBo under the huge kernel & it works with the generic kernel as well.
Regards,
Bill
 
  


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
Choosing Grub or Lilo Thanatos DamnSmallLinux 3 10-23-2005 09:32 PM
GRUB boot with 2 kernels installed philnk Linux - Software 2 07-07-2005 08:47 PM
GRUB dual boot with two diff kernels fails at boot mosquito_dk Linux - Software 3 09-06-2004 10:18 AM
New Kernels No XP in Grub short101 Debian 8 08-29-2004 04:03 AM
Grub with two Kernels gr33ndata Linux - Software 3 09-24-2003 05:23 PM


All times are GMT -5. The time now is 09:28 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration