LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Choosing a kernel for Slackware 12 and is an initrd needed? (https://www.linuxquestions.org/questions/slackware-14/choosing-a-kernel-for-slackware-12-and-is-an-initrd-needed-610584/)

Lufbery 01-02-2008 08:26 AM

Choosing a kernel for Slackware 12 and is an initrd needed?
 
Hi all,

I finally got around to installing the new hard drive in my laptop and installing Slackware 12 on it. So far, I've got just two questions.

First, did I change kernels correctly? -- I've read here, and in the readmes the recommendation to use the generic SMP kernel for day-to-day operations. I did a full installation and the default kernel is the huge smp kernel. So, I went to the boot directory and changed the System.map, bzImage, and config symbolic links to link to the corresponding generic SMP files. The laptop boots correctly and everything seems to work, but is there anything else I need to do?

Second, why would I need to make an initrd? The ANNOUNCE.12_0 file states:

Quote:

There are two kinds of kernels in Slackware -- the huge kernels, which contain support for just about every driver in the Linux kernel. These are primarily intended to be used for installation, but there's no real reason that you couldn't continue to run them after you have installed. The other type of kernel is the generic kernel, in which nearly every driver is built as a module. To use a generic kernel you'll need to build an initrd to load your filesystem module and possibly your drive controller or other drivers needed at boot time, configure LILO to load the initrd at boot, and reinstall LILO.
But I'm using the generic kernel and haven't made an initrd yet. Why is it necessary? Aren't modules loaded with rc.M?

Thanks,

-Drew

kilgoretrout 01-02-2008 10:13 AM

Quote:

But I'm using the generic kernel and haven't made an initrd yet. Why is it necessary? Aren't modules loaded with rc.M?
You can't load modules from rc.M until you can mount the root filesystem and read what's in rc.M and /lib/modules. That's what initrd is for. It allows you to load the basic modules for mounting the root filesystem at boot time, like the module for the filesystem you are using for root and the hard drive controller for the hard drive containing your root filesystem. It's basically to get around the catch-22 of you need the modules stored in root to mount root.

Lufbery 01-02-2008 10:20 AM

So if I can boot without the initrd, then I can assume that the root file system is mounting just fine without it?

I've got my hard drive in four partitions with one formatted as swap and the other three as JFS. I think the JFS support is in the kernel, so I shouldn't need the initrd if I'm understanding things correctly.

Of course, I could be confused...

-Drew

Alien_Hominid 01-02-2008 10:25 AM

No, you don't need initrd if you have fs support in the kernel.

kilgoretrout 01-02-2008 06:45 PM

Quote:

I think the JFS support is in the kernel, so I shouldn't need the initrd if I'm understanding things correctly.
If you are using the generic kernel and everything is booting OK, then obviously everything you need to mount your root filesystem is compiled directly into that kernel as opposed to being compiled as loadable modules. It really just depends on how the slackware developers compiled that kernel. If you get a kernel panic, then you need an initrd with JFS support and possibly other modules.

arubin 01-04-2008 03:57 AM

What file system are you running? Have you redone lilo? I would be very suspicious that you are actually still running the huge kernel. I am pretty sure that Pat's generic kernel will not run ext3 without an initrd.

Nylex 01-04-2008 04:14 AM

Quote:

Originally Posted by arubin (Post 3010803)
I am pretty sure that Pat's generic kernel will not run ext3 without an initrd.

This is indeed the case. Lufbery is using JFS, which also requires an initrd when using the generic kernel (since it is built as a module), so I'm having the same suspicions as you about he/she still running the huge kernel.

Lufbery 01-04-2008 07:18 AM

Hi folks,

I'm a guy, by the way.

As Nylex said, I'm using JFS, and I'm pretty sure I'm using the generic SMP kernel. But, I'm not sure.

So, I changed the links for
Code:

System.map, bzImage, and config
to point to the generic SMP kernel. I reran the Lilo configuration, but I'm not sure I did it properly. I think I need to do a little more reading on Lilo.

Otherwise, I'll need to make the initrd. Do I do that first and then switch Lilo to it?

Regards,

-Drew

Nylex 01-04-2008 07:23 AM

Are you sure you don't mean "vmlinuz" when you said "bzImage"? This is my LILO config (the important bit) for my system running the generic SMP kernel:

Code:

image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
  initrd = /boot/initrd.gz
  root = /dev/hda1
  label = Linux
  read-only

Note that I did not change the /boot/vmlinuz symlink to point to /boot/vmlinuz-generic-smp-2.6.21.5-smp, hence why my image line is not just "image = /boot/vmlinuz". Edit: I also manually edited my config file.

Show us what yours looks like.

arubin 01-04-2008 07:28 AM

I guess that there is a command which tells you what kernel you are running; I don't know what it is :-)

You need to be careful not to burn your bridges. When you try a different kernel it makes sense to leave the option of booting the old kernel. So rather than change symlinks I prefer to add a new option in lilo.conf to give the choice of the old and new kernel. If all goes well you can delete the old option.

Lufbery 01-04-2008 07:33 AM

Nylex,

You're right, I meant vmlinuz.

Arubin,

That's great advice! I'll be back to post my lilo.conf tomorrow. I really like the idea of leaving the option to boot to the huge kernel.

Regards, and thanks for the help.

-Drew

kilgoretrout 01-04-2008 03:34 PM

If you want to know what kernel you are running then open a console and run:

$ uname -a

And I agree with the others; I specifically remember having to make an initrd when using reiserfs for my root partition and the 2.6 kernel in slack 11. I had to include both reiserfs and the module for my sata controller in that initrd. Given this specific warning:

Quote:

The other type of kernel is the generic kernel, in which nearly every driver is built as a module. To use a generic kernel you'll need to build an initrd to load your filesystem module and possibly your drive controller or other drivers needed at boot time, configure LILO to load the initrd at boot, and reinstall LILO.
it doesn't look like much has changed.

Nylex 01-04-2008 03:42 PM

I don't think "uname -a" helps much (which is probably why it hasn't been suggested before). For example, on my system, with the generic SMP kernel, I get

Linux rigel 2.6.21.5-smp #1 SMP Tue Jun 19 14:52:25 CDT 2007 i686 Mobile Intel(R) Celeron(R) CPU 2.20GHz GenuineIntel GNU/Linux,

which doesn't tell me whether I'm using the huge or the generic kernel, only that it's SMP. I'm not sure what the output would be like for the huge kernel!

adriv 01-04-2008 04:27 PM

uname -v ?

Alien_Hominid 01-05-2008 01:56 AM

http://www.linuxquestions.org/questi...e-name-608673/

rworkman 01-05-2008 02:03 AM

Here's what I do (this is on -current, but the idea is the same):
Code:

image = /boot/vmlinuz-generic-smp-2.6.23.12-smp
  initrd = /boot/initrd.gz
  root = /dev/hda1
  label = genericsmp.s
  read-only

image = /boot/vmlinuz-huge-smp-2.6.23.12-smp
  root = /dev/hda1
  label = hugesmp.s
  read-only

image = /boot/vmlinuz-generic-2.6.23.12
  initrd = /boot/initrd.gz
  root = /dev/hda1
  label = generic.s
  read-only

image = /boot/vmlinuz-huge-2.6.23.12
  root = /dev/hda1
  label = huge.s
  read-only

Note that there's really no reason to leave the non-smp kernels available for most people; I only do that for testing purposes.

Also notice that I use the same initrd.gz file for both the smp and non-smp generic kernels; if you don't pass the -c switch to the second run of mkinitrd, it will add the non-smp modules to the existing initrd tree and recreate it. In other words, you can have support for as many different generic kernels as you'd like in one initrd.

Lufbery 01-06-2008 10:08 AM

Hi all,

Thanks for the advice folks. First of all, my vmlinuz was pointing to the generic SMP kernel, and it was booting. So, the JFS file system must be compiled in the kernel. There's no other explanation that I can find.

However, I did create an initrd and point it to the generic SMP kernel. So now I'm doing it correctly, even if it was accidentally working before. :)

Regards,

-Drew

Nylex 01-06-2008 10:19 AM

That's strange:

nick@rigel:/boot$ grep JFS config-generic-smp-2.6.21.5-smp
CONFIG_JFS_FS=m
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
# CONFIG_JFS_DEBUG is not set
# CONFIG_JFS_STATISTICS is not set

Oh well, at least it works.

Alien_Hominid 01-06-2008 11:24 AM

It's impossible.

Lufbery 01-06-2008 04:52 PM

Quote:

Originally Posted by Nylex (Post 3013311)
That's strange:

nick@rigel:/boot$ grep JFS config-generic-smp-2.6.21.5-smp
CONFIG_JFS_FS=m
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
# CONFIG_JFS_DEBUG is not set
# CONFIG_JFS_STATISTICS is not set

Oh well, at least it works.

Yeah, I got the same results (no surprise). I guess the only explanation was that I had vmlinuz point to a huge kernel even though I though otherwise. *shrug*

In any event, I've got an initrd now and LILO points to the generic SMP kernel after loading the initrd.

Thanks for your help folks.

Regards,

-Drew

techyranger 01-09-2008 01:35 PM

Lufbery, I never saw where you posted your lilo.conf? Would it make sense to see your ftsab file also. I think that will tell us what your root file systems is formated as, ext3 or JFS.

On the topic of the generic vs huge kernels, I'm curious if anyone get's a peformance boost from the generic kernel? I know loading only the needed modules saves memory, but does it really matter in this case?

Lufbery 01-10-2008 07:14 AM

Quote:

Originally Posted by techyranger (Post 3016965)
Lufbery, I never saw where you posted your lilo.conf? Would it make sense to see your ftsab file also. I think that will tell us what your root file systems is formated as, ext3 or JFS.

You're right. I haven't posted them because the lilo.conf changed after I got the advice here. :)

I can post both. I partitioned and formatted my hard drive with GParted prior to installing Slackware and I chose JFS then.

Regards,

-Drew

Lufbery 01-12-2008 11:02 PM

Hi all,

As requested, and for the record, here's the relevant portions of my /etc/lilo.conf:

Code:

image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
  initrd=/boot/initrd.gz
  root = /dev/hda1
  label = Slack12GenSMP
  read-only  # Partitions should be mounted read-only for checking

image = /boot/vmlinuz
  root = /dev/hda1
  label = Slack12HugeSMP
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

And here is my /etc/fstab:

Code:

/dev/hda2        swap            swap        defaults        0  0
/dev/hda1        /                jfs        defaults        1  1
/dev/hda3        /home            jfs        defaults        1  2
#/dev/cdrom      /mnt/cdrom      auto        noauto,owner,ro  0  0
/dev/fd0        /mnt/floppy      auto        noauto,owner    0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0

Regards,

-Drew

syg00 01-12-2008 11:40 PM

Quote:

Originally Posted by Lufbery (Post 3017711)
I haven't posted them because the lilo.conf changed after I got the advice here. :)

Which is, of course, irrelevant if you didn't also (re-)run the lilo command ... :rolleyes:

Drakeo 01-13-2008 12:49 AM

Quote:

Originally Posted by Lufbery (Post 3008513)
Hi all,

I finally got around to installing the new hard drive in my laptop and installing Slackware 12 on it. So far, I've got just two questions.

First, did I change kernels correctly? -- I've read here, and in the readmes the recommendation to use the generic SMP kernel for day-to-day operations. I did a full installation and the default kernel is the huge smp kernel. So, I went to the boot directory and changed the System.map, bzImage, and config symbolic links to link to the corresponding generic SMP files. The laptop boots correctly and everything seems to work, but is there anything else I need to do?

Second, why would I need to make an initrd? The ANNOUNCE.12_0 file states:



But I'm using the generic kernel and haven't made an initrd yet. Why is it necessary? Aren't modules loaded with rc.M?

Thanks,

-Drew

unless you have deleted it in the boot directory is a text file telling you how to make an initrd image.
http://slackware.osuosl.org/slackwar.../README.initrd

Lufbery 01-13-2008 07:25 AM

Quote:

Originally Posted by syg00 (Post 3020684)
Which is, of course, irrelevant if you didn't also (re-)run the lilo command ... :rolleyes:

Yeah. I did that, I just didn't mention in the post that I did that.

Thanks for the help, guys. Things are running ver well now.

Regards,

-Drew

techyranger 01-22-2008 07:52 PM

Looks good, man. Thanks for posting.


All times are GMT -5. The time now is 07:40 AM.