An initrd allows to use the smaller generic kernel instead of the huge kernel
This page is about initrd with the lilo boot loader. For EFI systems refer to Install Initrd on an UEFI boot system
Doc source: slackware/README.initrd
It seems better to generally use mkinitrd_command_generator.sh to create an initrd. See below at KVM. The rest of this section is obsolete.
On a locally available (with phsical access to keyboard and display) machine with ext4 on /
the following should suffice:
cp -a /boot /boot.bak cd /boot mkinitrd -c -k 3.14.18-smp -m ext4 # use your kernel version here!
Now Edit lilo.conf :
image = /boot/vmlinuz -> image = /boot/vmlinuz-generic-smp add initrd = /boot/initrd.gz
There is no need to update symlinks in /boot
if you made sure, your lilo.conf point to the right generic kernel verion
An finally run lilo
According to linuxquestions the virtio kernel modules are necessary for KVM in the initrd.gz. A simple call like described in README.initrd, eg mkinitrd -c -k 3.10.17 -m ext4
will not include the virtio modules (tested) ⇒ Use /usr/share/mkinitrd/mkinitrd_command_generator.sh
. In http://docs.slackware.com/howtos:slackware_admin:systemupgrade mkinitrd_command_generator.sh is mentioned as well
Check if you made a copy of /boot
and generate the command which generates an initrd:
cd /boot # just to have everything togehter in /boot /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.14 > generated_mkinitrd_command-4.4.14
Important: Append the kernel version number to the name of the initrd output file in generated_mkinitrd_command-4.4.14
in order to not overwrite the existing initrd for the old proved kernel!
Now generate the initrd:
chmod +x generated_mkinitrd_command-4.4.14 ./generated_mkinitrd_command-4.4.14
Fix lilo.conf and reinstall lilo:
cd /etc cp lilo.conf lilo.conf.bak
The output of
/usr/share/mkinitrd/mkinitrd_command_generator.sh -l /boot/vmlinuz-generic-4.4.14
may be included in lilo.conf, to create a section for the new kernel (before the old kernel)
There is no need to update symlinks in /boot
if you made sure, your lilo.conf point to the right kernel version. Finally run lilo:
lilo
To use the recommended generic instead of the huge kernel you have to build an initrd. This section is based on slackware-13.1/README.initrd
Make a copy of /boot
dir to be on the save side: cp -a /boot /boot.org
Create the initial ramdisk filesystem /boot/initrd.gz
with
mkinitrd -c -k 2.6.33.4-smp -m ext3 -f ext3 -r /dev/sda2
In this example we have an ext3
root „/
“ partition on /dev/sda2
(see ls -al /dev/root
) for a kernel of version 2.6.33.4-smp
(See uname -r
).
Or
mkinitrd -c -k 2.6.33.4-smp -m reiserfs
for Reiserfs, or
mkinitrd -c -k 2.6.33.4-smp -m ext4 -f ext4 -r /dev/sda2
for ext4 on /dev/sda2
It is not necessary to change the symlinks in /boot
Add a new image-section at the beginning of the image sections to /etc/lilo.config
:
image = /boot/vmlinuz-generic-smp-2.6.33.4-smp initrd = /boot/initrd.gz root= /dev/sda2 label = LinuxGeneric read-only
Run lilo
and restart.
slackpkg
), a new initrd.gz
must be created. And if initrd.gz
is modified, lilo
must be started again!