LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Newer Kernels and the Need for Initrd (https://www.linuxquestions.org/questions/slackware-14/newer-kernels-and-the-need-for-initrd-872720/)

vtel57 04-03-2011 11:49 AM

Newer Kernels and the Need for Initrd
 
I'm sure this has been discussed time and again, but a search is not getting me any definitive answers to my question.

I've always booted Slackware with an initrd until recently. With my new installation of Slack Current (13.37), I didn't bother to create an initrd because of the constantly updating/transient nature of the current branch at the moment.

My question is this: when 13.37 does go final in a few days, should I go back to my normal practice of booting with an initrd?

Also, I think I understand how the initial ramdisk works, but is it really needed with the more modern kernels?

Thanks in advance...

~Eric

piratesmack 04-03-2011 12:11 PM

Slackware (32-Bit) comes with 4 kernels:
kernel-huge
kernel-huge-smp (supports multi cpu)
kernel-generic
kernel-generic-smp (supports multi cpu)

Slackware64 comes with 2:
kernel-huge
kernel-generic

(Note: these are both 'smp' kernels even though they don't have 'smp' in the name)

Slackware's 'huge' kernels don't require an initrd, but they aren't recommended for daily use.

It is recommended to switch to one of the 'generic' kernels, which do require an initrd, after installing/booting Slackware for the first time.

colorpurple21859 04-03-2011 01:02 PM

One other note /boot/vmlinuz usually linked to the huge kernel

H_TeXMeX_H 04-03-2011 01:32 PM

Initrd is needed when you build things that are necessary to boot as modules, and thus are stored separately from the kernel on the HDD. For example filesystem support. The bootloader knows where the kernel is on the disk, and so can load it without needing anything. However, it doesn't know where the modules are and cannot access them without some modules, like filesystem support, IDE or SATA support, etc (catch22). So, you just make an initrd, which is an image containing these modules that is loaded with the kernel into RAM. piratesmack is correct, in that the huge kernels have everything built-in and thus don't need an initrd. However, if you make a custom kernel, like I do, I build in the things that are needed and leave the rest as modules, which is obviously the best thing to do. No bloated kernel, no initrd.

volkerdi 04-03-2011 01:51 PM

Even with everything built into the kernel, an initrd is still needed for things like / on LVM, luks, or RAID.

Darth Vader 04-03-2011 02:37 PM

For those who (for religious reasons) can not use initrd, they still can use a ROOTFS embedded in the kernel, an initrd which is included in bzImage, at build time.

After all, all options can be set in the initrd command line ... ;)

hf2046 04-03-2011 02:52 PM

Might want to give /boot/README.initrd a look-see. Should answer a lot of your questions definitively on when you need to make an initial ramdisk...

mRgOBLIN 04-03-2011 03:35 PM

Quote:

Originally Posted by colorpurple21859 (Post 4312534)
One other note /boot/vmlinuz usually linked to the huge kernel

That's to do with the install order.
Those links are created by whichever kernel package was last installed.

Gerard Lally 04-03-2011 03:37 PM

Quote:

Originally Posted by hf2046 (Post 4312623)
Might want to give /boot/README.initrd a look-see. Should answer a lot of your questions definitively on when you need to make an initial ramdisk...

If I compile a custom kernel and append something to the name, like 2.6.38.2-server, do I need to use this name in the mkinitrd command:

Code:

mkinitrd -c -k 2.6.38.2-server -m ext4 -f ext4 -r /dev/sda1
or just this:

Code:

mkinitrd -c -k 2.6.38.2 -m ext4 -f ext4 -r /dev/sda1
?

piratesmack 04-03-2011 03:39 PM

Use '2.6.38.2-server'

The same name as the /lib/modules/<kernel version> folder

But if you build ext4 support into your custom kernel by setting 'CONFIG_EXT4_FS=y' (not 'm'), then you don't even need an initrd (unless you use LVM, LUKS, or RAID like said above)

Gerard Lally 04-03-2011 03:45 PM

Quote:

Originally Posted by piratesmack (Post 4312653)
Use '2.6.38.2-server'

The same name as the /lib/modules/<kernel version> folder

Thank you.

lumak 04-03-2011 07:36 PM

If you use the /etc/mkinitrd.conf file. It's easy to create a new one by changing the kernel version in the file then running
mkinitrd -F

Set it up once with all your modules and partitions then you don't have to remember all the command line switches.

kingbeowulf 04-03-2011 07:59 PM

For me, there are good reasons to use an initrd instead of using the huge kernel. I don't always run Slackware on "modern" hardware but I still want to be able to run a "modern" kernel.
  1. Size: The generic kernel takes up < 1/2 the RAM, and I can shrink that further with configuration customizations, as needed, not only for my main multi gigabyte, multi CPU box, but also for my PIII laptops with 256-512MB of RAM
  2. Speed: initrd/generic boots faster. YMMV
  3. control: I only load what I need, which gives speed, RAM and HD savings, stability, and security.

vtel57 04-03-2011 09:30 PM

Thanks all. Thanks very much. Those were some great answers. I'll probably go back to booting with the initrd after reading all these replies. I appreciate the time y'all took to answer my queries. :)

Regards,

~Eric

vtel57 04-04-2011 01:18 PM

Just a quick update... I'm back to booting with the initrd on all my systems. :)


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