-   Slackware (
-   -   Updating the kernel on an encrypted lvm install (

BoydRice 07-04-2013 03:23 PM

Updating the kernel on an encrypted lvm install
Hi there,

I am running Slackware64 14 with encrypted lvm. The kernel I am using is 3.2.29 and it looks like the kernel was updated to 3.2.45. Since I want my system to stay somewhat up to date on patches I figured I should upgrade the kernel, but I am unsure of the process to make sure my encrypted lvm will boot afterwards. Could someone point me to a guide for such a scenario?

Alien Bob 07-04-2013 03:46 PM

Install the new kernel-generic plus the kernel-modules packages (and kernel-headers and kernel-sources if you ever want to compile something that needs kernel sources/headers) using installpkg (do not use upgradepkg - you will want to keep your working configuration until you are sure that you can boot the new kernel).

After installing the kernel and its modules, run

which will output a working "mkinitrd" commandline for your current kernel. Use that commandline but change the kernel version to the value for the new kernel (change the '-k 3.2.29' parameter to '-k 3.2.45'). This will create the initrd file you need for your LUKS encrypted LVM (but it will by default overwrite an existing /boot/initrd.gz file which is not want you want probably).

Then you add a new definition to /etc/lilo.conf for the new kernel & initrd and run lilo to make it stick.

An example of how this is most easily done for the 3.2.45 kernel of Slackware64 without overwriting any existing initrd file (run the three commands as root... and yes, that "$( xxxxxx)" is a real full commandline, which will execute the mkinitrd command immediately instead of merely showing it as an on-screen example):

$( /usr/share/mkinitrd/ -k 3.2.45 -a "-o /boot/initrd_3.2.45.gz" )
/usr/share/mkinitrd/ -k 3.2.45 -a "-o /boot/initrd_3.2.45.gz" -l /boot/vmlinuz-generic-3.2.45  >> /etc/lilo.conf

This will (1) create the initrd, (2) update /etc/lilo with a definition for the new kernel, labeling it "3.2.45" and (3) will run lilo so that you can test a reboot. The working kernel will still boot by default (so you are guaranteed to keep a working system) and there will be a new, non-default, label in the LILO boot screen, called "3.2.45". Pick that label and check that you can indeed boot into your new kernel. Then, change /etc/lilo.conf to make the new kernel boot by default and run lilo again.


BoydRice 07-05-2013 07:25 PM

Thank you for the very detailed response!

All times are GMT -5. The time now is 01:39 PM.