LinuxQuestions.org
Help answer threads with 0 replies.
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 12-08-2013, 10:44 AM   #1
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Rep: Reputation: 20
Can't get encrypted root partition to boot using grub2


I just tried a reinstall of Slackware 14.1 x64, encrypting my root partition along the way. I'm using grub2 as my bootloader as I'm dual-booting with Windows and I know it works. I tried following the Arch Linux guide to using grub2, doing the grub-install to the EFI partition and adding in thte extra lines for an encrypted root. However, when I boot, it complains that it can't find mapper/cryptroot and fails to boot.

Any pointers in the right direction would be appreciated. And if someone could let me know what kernel parameters to enter for my USB boot disk to boot into the encrypted system, that'd be great... I think I need to know that to fix it.

Thanks.
 
Old 12-08-2013, 01:10 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
What mkinitrd command did you use to create the initrd?
 
Old 12-09-2013, 06:06 AM   #3
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Richard Cranium View Post
What mkinitrd command did you use to create the initrd?
D'oh! I never made one because I am using the huge kernel... I'll have to get back to you on this one.
 
Old 12-09-2013, 06:36 AM   #4
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
The huge kernel will provide you with device drivers but you need extra software for the decryption of your disk, and that software is loaded from initrd.
 
Old 12-22-2013, 10:26 AM   #5
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
Sorry it took so long to reply, I got really busy right after.

So I used AlienBob's mkinitrd_generator script and got an initrd.gz good to go. I've run into a different problem now. When I boot, it would appear that the password for the encrypted hard drive is requested before the keyboard is detected (I see the request for the password and then immediately after I see all the messsages popping up for my USB hardware being detected). After this, no matter what I type on the keyboard and press enter, I get the following messages:

[CODE]udevd[282]: failed to execute '/sbin/dmsetup' '/sbin/dmsetup udevflags 5148928': No such file or directory
udevd[283]: failed to execute '/sbin/dmsetup' '/sbin/dmsetup udevcomplete 5148928': No such file or directory[\CODE]

and everything just stops. I did a quick Google search and came up with this thread from last year with similar problems that resulted in not using the root= line in lilo.conf. I'm not sure as to where I would implement that fix within grub2 with EFI, though, so I need some help.
 
Old 12-22-2013, 12:22 PM   #6
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
You said your root partition is encrypted. Then how were you able to run mkinitrd_generator.sh without successfully booting into your system? It should be run from within the installed system to work properly (perhaps you mounted the partition from the installation DVD and then chroot'ed into it?). Anyway, it still seems to me that initrd isn't working as expected. /sbin/dmsetup should already have been copied into initrd.gz. Make sure you use the -L and -C options when you run mknitrd.

Note: Normally if you don't use LVM then -L should not be needed, but I vaguely remember reading about a change of behaviour/bug? in this version of mkinitrd which requires -L even when there's encryption without LVM.

Another note: If you want initrd to wait for devices, use the option -w [seconds]. This is especially useful when you install into an external HD, for example. Udev may spit out some keyboard-related messages after the LUKS password prompt, but so far this didn't give me any trouble.

Yet another note: You may change your lilo options on-the-fly by pressing "Tab" at the boot menu (you should then write the menu item name plus the new options). IN case the root= options is the problem, you may experiment with various values without needing to re-run lilo.

Last edited by Ilgar; 12-22-2013 at 12:24 PM.
 
Old 12-22-2013, 12:27 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by spudgunner View Post
Sorry it took so long to reply, I got really busy right after.

So I used AlienBob's mkinitrd_generator script and got an initrd.gz good to go. I've run into a different problem now. When I boot, it would appear that the password for the encrypted hard drive is requested before the keyboard is detected (I see the request for the password and then immediately after I see all the messsages popping up for my USB hardware being detected). After this, no matter what I type on the keyboard and press enter, I get the following messages:

[CODE]udevd[282]: failed to execute '/sbin/dmsetup' '/sbin/dmsetup udevflags 5148928': No such file or directory
udevd[283]: failed to execute '/sbin/dmsetup' '/sbin/dmsetup udevcomplete 5148928': No such file or directory[\CODE]

and everything just stops. I did a quick Google search and came up with this thread from last year with similar problems that resulted in not using the root= line in lilo.conf. I'm not sure as to where I would implement that fix within grub2 with EFI, though, so I need some help.
The quickest way to test would be to edit the grub stanza as the system is coming up. Press "e" during boot and scroll down until you see a block that looks like...
Code:
        echo    Loading Linux 3.10.17 ...
        linux   /vmlinuz-generic-3.10.17 root=UUID=f15cdaf7-c299-4cc0-8a16-533808d59454 ro  
        echo    Loading initial ramdisk ...
        initrd  /initrd.gz
Use grub's interactive editing feature to delete the bolded part (your values will be different; you just delete everything starting from "root=" and ending at the next whitespace. Hit ctrl-x and grub will boot with your temporary change.

If it works, you can hand-edit /boot/grub/grub.cfg when the system comes up to match what you did interactively. Or just edit /etc/default/grub to set GRUB_DISABLE_LINUX_UUID=true (There's a comment in the file that describes what this does.) and regenerate your config file with
Code:
grub-mkconfig -o /boot/grub/grub.cfg
 
Old 12-23-2013, 08:01 AM   #8
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
@Ilgar:

I did a lot of reinstalls yesterday. I tried chroot-ing but things wouldn't work properly (which wasn't bad because it only takes like 10 min for me to setup Slackware and I was doing Christmas stuff during the waits). And now that you mention it, I do vaguely remember having to use the -w option on another computer to get things running properly, I'll try adding that in. I'll also try adding in the -L option, although I'm not using an LVM in this case.

@Richard Cranium:

What you've suggested seems reasonable, I'll give it a shot.
 
Old 12-23-2013, 10:07 PM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Your root partition isn't on top of software RAID is it?
 
Old 12-24-2013, 07:04 AM   #10
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Richard Cranium View Post
Your root partition isn't on top of software RAID is it?
Nope, no software RAID. I'm gonna be away for Christmas so I don't think I'm even going to get a chance to try to get this working again until next week.
 
Old 01-10-2014, 07:11 AM   #11
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
Good news everyone! Adding the -L option to mkinitrd worked for me!
 
Old 01-10-2014, 02:27 PM   #12
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
I'm glad that it worked. I think this (new) behaviour of mkinitrd deserves a mention in the relevant README files if it persists in the upcoming releases.
 
Old 01-10-2014, 08:55 PM   #13
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
I'm not convinced that you need the -L option unless you are using LVM.

The -C option with the list of partitions should do the trick instead. If it doesn't, that's a bug report.
 
Old 01-13-2014, 07:09 AM   #14
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Richard Cranium View Post
I'm not convinced that you need the -L option unless you are using LVM.

The -C option with the list of partitions should do the trick instead. If it doesn't, that's a bug report.
I was using the -C option and it wasn't working. Where would I file bug reports to?
 
Old 01-13-2014, 09:03 AM   #15
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
I'd send it to Pat ("Patrick Volkerding" <volkerdi@slackware.com> in case the e-mail link doesn't work). Speaking as a software weasel, please give him enough detail so that he could re-create your problem on a machine of his own. It's difficult to fix a problem that you can't re-create.
 
  


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
[SOLVED] Initrd for kernel 3.8.11 and encrypted luks root partition in current Phorize Slackware 8 06-15-2013 09:04 AM
install grub2 to root partition skippyV Debian 2 03-01-2013 05:07 PM
[SOLVED] Moving root partition when using grub2 eldiener Linux - Software 1 10-08-2012 03:32 AM
How to move Grub2 from mbr to root partition BillD Linux - Software 3 03-17-2011 06:07 AM
Setting up encrypted root partition yukon65 Slackware 3 07-18-2007 08:51 AM

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

All times are GMT -5. The time now is 02:15 AM.

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