LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-20-2013, 06:04 AM   #1
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Rep: Reputation: 70
Slackware 14.1 with luks crypt and initrd - what are the latest correct commands?


I've been using Slackware with dm-crypt encrypted root partition for years - and every time I have to set it up again I go around in circles until it finally works - as it never works the first time. I'm just in the process of setting up a new Lenovo e130 laptop. I'm using "legacy" BIOS - so I'm using Lilo. I have created my initrd using the following command:

Code:
mkinitrd -c -k 3.10.17 -f ext4 -r lukssda4 -C /dev/sda4
I have also tried to use the full path for the encrypted partition, which used to work with earlier versions of Slackware:

Code:
mkinitrd -c -k 3.10.17 -f ext4 -r /dev/mapper/lukssda4 -C /dev/sda4
/dev/sda4 is my encrypted root partition, /dev/sda1 is my non-encrypted boot partition. When trying to boot, I go past inputting the luks password, and I get:

Code:
[ 13.673843] bio: create slab <bio-2> at 2
udevd[218]: failed to execute '/sbin/dmsetup' '/sbin/dmsetup udevflags 5140436': No such file or directory
I've been using the following guide normally:

ftp://ftp.slackware.com/pub/slackwar...ADME_CRYPT.TXT

but adjusting for new style crypt partition names (lukssda4).

I have also tried removing the "root=" line in lilo.conf as per this post:

http://www.linuxquestions.org/questi...em-4175429866/

Code:
image = /boot/vmlinuz
initrd = /boot/initrd.gz
label = slack_14.1
read-only
I'm a bit puzzled that a piece of software can be so fickle and I can never reproduce successful results without trying again and again. The fact that there are a myriad help files on configuring dm-crypt on Slackware, some of them using cryptroot, some of them using lukssdx, others using "root=" in lilo.conf, while other don't - doesn't help really.

Edit: I have looked in my /boot/initrd-tree/sbin and there is a dmsetup file there. Why is the boot process still complaining that it can't find it, I wonder?

Last edited by xj25vm; 11-20-2013 at 06:29 AM.
 
Old 11-20-2013, 06:09 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,115

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
We've had several of these over the last week or so. Short answer: cryptsetup/udev now needs /sbin/dmsetup but the mkinitrd doesn't include it by default. To workaround the bug, just add the '-L' option to mkinitrd.

P.S.
As for the '-r' option, I'd recommend avoiding the old-style single word options and use either "-r /dev/mapper/lukssda4", or just "-r /dev/sda4" which will do the luksname mapping for you automatically.

Last edited by GazL; 11-20-2013 at 06:13 AM.
 
Old 11-20-2013, 06:41 AM   #3
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Original Poster
Rep: Reputation: 70
Thanks GazL. I've used the "-L" option for mkinitrd and now I seem to have moved further - but just by one step:

Code:
Unlocking LUKS encrypted device '/dev/sda4' as luks mapped device 'lukssda4':
Enter passphrase for /dev/sda4:
[   15.323580] bio: create slab <bio-2> at 2
[   15.880398] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
/boot/initrd.gz: exiting
INIT: version 2.88 booting
INIT: No inittab file found

Enter runlevel:

Edit: I've been poring over the /boot/initrd-tree/init file, and the only place I can see the root partition being mounted is the following:

Code:
# Switch to real root partition:
/sbin/udevadm settle --timeout=10
echo 0x0100 > /proc/sys/kernel/real-root-dev
mount -o ro -t $ROOTFS $ROOTDEV /mnt
I'm not quite sure I understand why the root file system gets mounted under "/mnt", instead of "/" ?

Last edited by xj25vm; 11-20-2013 at 07:10 AM. Reason: Add extra info
 
Old 11-20-2013, 07:21 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,115

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
I think your problem will likely be missing modules. "-m ext4" for a start.
 
Old 11-20-2013, 09:23 AM   #5
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Original Poster
Rep: Reputation: 70
Tried that as well. In that case, I get few extra error messages during boot, before being prompted for the luks passphrase:

Code:
/boot/initrd.gz: Loading kernel modules from initrd image:
insmod /lib/modules/3.10.17/kernel/fs/mbcache.ko
[    4.942725]mbache: exports duplicate symbol mb_cache_create (owned by kernel)
... and the same for jbd2.ko and ext4 modules. All three get added to initrd by mkinitrd when I use "-m ext4". If I remember correctly the errors above mean the module already exists in the kernel.
 
Old 11-20-2013, 09:33 AM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,115

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
Best not to use 'huge' kernel with an initrd. Give the generic one a shot. (You may need to add modules for your keyboard if it's a usb one).
 
Old 11-20-2013, 09:45 AM   #7
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Original Poster
Rep: Reputation: 70
Quote:
Best not to use 'huge' kernel with an initrd.
Any particular reason? Has initrd any size limitations? Wouldn't the huge kernel be better - as it has all the modules to hand? I have always used the huge kernel in the past with initrd and luks on Slackware (actually huge-smp - but I see that doesn't exist any more).

At least does anybody have any idea what is happening there? Any way of troubleshooting this, instead of just randomly trying variations of commands? Could I add maybe some commands to the init file, in the initrd to generate some verbose output?
 
Old 11-20-2013, 10:00 AM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,302

Rep: Reputation: Disabled
I suggest you try to run /usr/share/mkinitrd/mkinitrd_command_generator.sh
 
Old 11-20-2013, 10:12 AM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,115

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
All I can say is that I've seen problems in the past when trying to use 'huge' and an initrd/modules that mysteriously went away when the generic kernel was used.

Normally when you build a kernel you build an associated set of modules to go along with it. Now, I'm not entirely sure how Pat does it but he seems to share the same set of modules for both the generic and huge kernels, and I've always been a little suspicious of that approach. Maybe my suspicions are unfounded; my knowledge on the subject doesn't go nearly deep enough to say one way or the other, but it just feels like something best avoided.
 
Old 11-20-2013, 10:28 AM   #10
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Original Poster
Rep: Reputation: 70
Thanks Didier. I have just tried the mkinitrd_command_generator.sh - and I still end up with the following error during the boot, just after inputting my luks passphrase:

Code:
"failed to execute /sbin/dmsetup udevcomplete 5137915: No such file or directory"
 
Old 11-20-2013, 10:39 AM   #11
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Original Poster
Rep: Reputation: 70
Thanks GazL. I've just tried the generic kernel - and I get the same dmsetup errors. At least with the generic kernel I don't get those module errors - which would suggest that those modules were indeed included with the huge kernel. I will have to take /boot/initrd-tree/init script apart and run a bit at a time on every boot to try and get some more of a clue as to where things fall apart. So far it seems to be related to udev, but all the binaries are present in initrd, so not sure why it is still a show stopper.
 
Old 11-20-2013, 10:43 AM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,115

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
Are you still adding the -L like I said above?
 
Old 11-20-2013, 10:58 AM   #13
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Original Poster
Rep: Reputation: 70
With "-L" I get "No inittab file found". Without "-L" I get the "dmsetup" errors.
 
Old 11-20-2013, 11:07 AM   #14
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,115

Rep: Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268Reputation: 5268
So, what is the mkinitrd command you are using now?
 
Old 11-20-2013, 11:22 AM   #15
xj25vm
Member
 
Registered: Jun 2008
Posts: 399

Original Poster
Rep: Reputation: 70
Code:
mkinitrd -c -k 3.10.17 -f ext4 -r /dev/mapper/lukssda4 -C /dev/sda4 -m mbcache:jbd2:ext4 -L -o /boot/initrd.gz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Different between Device Mapper and DM-Crypt and Cryptsetup , LUKS saeedsssss Linux - Software 1 10-01-2012 03:57 AM
The performance of plain dm-crypt versus LUKS TwinReverb Linux - General 1 12-05-2011 04:38 AM
How do I dual boot Windows XP and Slackware 13.1 with dm-crypt luks with lilo? gluesniffmonkey Slackware 5 06-06-2010 07:01 PM
Public key crypto with LUKS/dm-crypt? keschrich Linux - Security 0 10-31-2006 04:01 PM
System encryption with dm-crypt and luks? Zmyrgel Slackware 9 09-02-2006 11:40 AM

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

All times are GMT -5. The time now is 07:45 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