LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-15-2016, 03:08 PM   #1
l0rddarkf0rce
Member
 
Registered: Nov 2004
Location: Virginia, US
Distribution: Slackware 14.1 multilib
Posts: 149

Rep: Reputation: 33
LUKS encrypted HD and kernel updates


I have a laptop that has the whole disk encrypted (work requirement) and therefore makes upgrading the kernel a major pain in the a**. I am not using LVM I have everything in just one partition (just to make it easier). The only unencrypted partition is /boot which needs to be like that. So my question is if I want to install the newest kernel (right now I have the stock 14.1 kernel) what would the process be to get this done? The reason that I ask is because I am certain that if I just run

# slackpkg upgrade-all

my old kernel will go bye-bye and therefore the initrd file will no longer be valid and the system will not boot. I am sure I can boot it from CD/chroot and go from there, but i want to safe myself the headache if I can.

TIA for any help/pointers.

Last edited by l0rddarkf0rce; 05-15-2016 at 03:18 PM.
 
Old 05-15-2016, 04:13 PM   #2
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,160
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
After you upgrade the packages, you'll need to create a new initrd valid for your new kernel.

If you upgrade using "slackpkg upgrade-all", just don't run lilo when prompted by the script.

To create a new initrd file (after the slackpkg command), run the following command:

Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh --run /boot/vmlinuz-generic-4.4.10
Replace the last argument by the correct kernel file if kernel is upgraded after this post.

The above command will display the appropriate "mkinitrd" command that you need to run to create a new initrd file consistent with your upgraded system (you should see a "-C" option as you're using an encrypted filesystem).
If you are using a non-english keyboard, you will need to add a "-l fr" option to the "mkinitrd" command (replace fr by your own keyboard layout).

Run the "mkinitrd" command.

Then run:
Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh --lilo /boot/vmlinuz-generic-4.4.10
to display the section that you have to copy into your /etc/lilo.conf.

After editing /etc/lilo.conf (don't forget to remove any invalid entry like the entry for the previous version of the kernel), run lilo and you should have a functioning kernel upon reboot.

Last edited by gegechris99; 05-15-2016 at 04:15 PM. Reason: typo
 
Old 05-16-2016, 12:11 AM   #3
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by l0rddarkf0rce View Post
I am certain that if I just run

# slackpkg upgrade-all

my old kernel will go bye-bye
You can also copy your current kernel file (vmlinuz) and initrd under /boot with new names as backups (do this before starting the upgrade of course!), then add the relevant lines back to lilo.conf after the upgrade. If something with the new initrd goes wrong, you can safely boot with the old kernel. Due to the removal of hte /lib/modules/linux-[old kernel] directory, if you boot with the old kernel your system may not be fully functional. To save your old modules you can copy the directory /lib/modules/linux-[old kernel] somewhere else then rename it back before rebooting after the upgrade.

Last edited by Ilgar; 05-16-2016 at 12:15 AM.
 
  


Reply



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
Trying to mount a LUKS encrypted SD card - johanna Linux - Desktop 7 06-27-2015 04:41 AM
[SOLVED] 14.1: Problems with luks encrypted / partition l0rddarkf0rce Slackware 4 11-17-2013 04:15 AM
[SOLVED] Initrd for kernel 3.8.11 and encrypted luks root partition in current Phorize Slackware 8 06-15-2013 09:04 AM
[SOLVED] Kernel update on LUKS and LVM encrypted Slackware, mount fails KMBS Slackware 15 02-08-2010 01:23 PM
Recover encrypted LUKS partition itinlopez Linux - General 3 11-30-2008 02:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:03 PM.

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
Open Source Consulting | Domain Registration