Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
11-20-2013, 06:04 AM
|
#1
|
Member
Registered: Jun 2008
Posts: 399
Rep:
|
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.
|
|
|
11-20-2013, 06:09 AM
|
#2
|
LQ Veteran
Registered: May 2008
Posts: 7,115
|
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.
|
|
|
11-20-2013, 06:41 AM
|
#3
|
Member
Registered: Jun 2008
Posts: 399
Original Poster
Rep:
|
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
|
|
|
11-20-2013, 07:21 AM
|
#4
|
LQ Veteran
Registered: May 2008
Posts: 7,115
|
I think your problem will likely be missing modules. "-m ext4" for a start.
|
|
|
11-20-2013, 09:23 AM
|
#5
|
Member
Registered: Jun 2008
Posts: 399
Original Poster
Rep:
|
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.
|
|
|
11-20-2013, 09:33 AM
|
#6
|
LQ Veteran
Registered: May 2008
Posts: 7,115
|
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).
|
|
|
11-20-2013, 09:45 AM
|
#7
|
Member
Registered: Jun 2008
Posts: 399
Original Poster
Rep:
|
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?
|
|
|
11-20-2013, 10:00 AM
|
#8
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,302
Rep: 
|
I suggest you try to run /usr/share/mkinitrd/mkinitrd_command_generator.sh
|
|
|
11-20-2013, 10:12 AM
|
#9
|
LQ Veteran
Registered: May 2008
Posts: 7,115
|
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.
|
|
|
11-20-2013, 10:28 AM
|
#10
|
Member
Registered: Jun 2008
Posts: 399
Original Poster
Rep:
|
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"
|
|
|
11-20-2013, 10:39 AM
|
#11
|
Member
Registered: Jun 2008
Posts: 399
Original Poster
Rep:
|
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.
|
|
|
11-20-2013, 10:43 AM
|
#12
|
LQ Veteran
Registered: May 2008
Posts: 7,115
|
Are you still adding the -L like I said above?
|
|
|
11-20-2013, 10:58 AM
|
#13
|
Member
Registered: Jun 2008
Posts: 399
Original Poster
Rep:
|
With "-L" I get "No inittab file found". Without "-L" I get the "dmsetup" errors.
|
|
|
11-20-2013, 11:07 AM
|
#14
|
LQ Veteran
Registered: May 2008
Posts: 7,115
|
So, what is the mkinitrd command you are using now?
|
|
|
11-20-2013, 11:22 AM
|
#15
|
Member
Registered: Jun 2008
Posts: 399
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 07:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|