LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-24-2020, 06:58 AM   #1
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Rep: Reputation: Disabled
Slackware on lvm+luks - unavailable for unlocking


Hey, folks.
I've just installed Slackware according to this notes. My setup is elilo + full disk encryption (lvm on luks). What I did:
1. Created two partitions: 512M ESP Fat32 (/dev/sdb1) and 250G raw for LUKS (/dev/sdb2).
2. Created and opened luks.
3. Created physical, group and logical volumes (root, swap, home).
4. Installed Slackware and elilo with new efi record.
5. Without rebooting after installation was finished I chrooted and used
Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -a '-o /boot/efi/EFI/Slackware/initrd.gz | tail -1 | sh
to create initrd.gz.
6. Checked if /boot/vmlinuz-generic-5.4.41 and /boot/efi/EFI/Slackware/vmlinuz are the same.
7. Just in case copied /boot/efi/EFI/Slackware/initrd.gz to /boot/initrd.gz

So my final config setup looks like this
Code:
cat /boot/efi/EFI/Slackware/elilo.conf
chooser=simple
delay=1
timeout=1
#
image=vmlinuz
        label=vmlinuz
        initrd=initrd.gz
        read-only
        append="root=/dev/mapper/luksvg-root vga=normal ro"

ls -l /boot/efi/EFI/Slackware
elilo.conf  elilo.efi  initrd.gz  vmlinuz
Seems like everything is OK, but when I try to boot into installation
1. initrd.gz loads from /boot (not from /boot/efi/EFI/Slackware).
2. All modules loads without a problem (I see insmod /lib/modules/5.4.41/... on display).
3. Error
Code:
LUKS device /dev/sdb2 unavailable for unlocking!
...
No /sbin/init found on rootdev...
As far as I can tell this error caused by inability to decrypt /dev/sdb2 which is partition with luks+lvm.

My questions are:
1. Why loads /boot/initrd.gz when in elilo.conf I have initrd.gz not in /boot, but in elilo dir (/boot/efi/EFI/Slackware)?
2. Since initrd.gz in /boot and in /boot/efi/EFI/Slackware are the same and they have been created by mkinitrd_command_generator, why the problem with decryption appears?
3. How to fix it?
 
Old 05-24-2020, 07:07 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Is your LUKS device still called /dev/sdb2 when you are booting that computer?
If it is, did you perform a full installation of Slackware or did you skip packages?
To try whether cryptsetup in your initrd works, reboot, and then after getting the error message you will be dropped to a shell prompt. Type "cryptsetup" to see if that command is working at all, or whether it is missing any libraries.
 
Old 05-24-2020, 07:24 AM   #3
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
Thanks for reply.
In emergency shell (let's call it this way) I executed
Code:
ls /dev
and did't found /dev/sdb. The only block device I found is /dev/sda which is my hdd (media storage) with no distributions installed.
No, I did not perform a full installation. I skipped kernel sources, KDE and XFCE packages.
Cryptsetup works in emergency shell.
 
Old 05-24-2020, 07:34 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Is that /dev/sdb an external USB drive? If so, it may be too slow to be recognized in time as a storage device.
The mkinitrd command has a "wait" parameter, for instance adding "-w 10" will cause the init process to wait 10 seconds which could be sufficient for the USB subsystem to recognize your disk. Like so:

Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -r -a '-w 10 -o /boot/efi/EFI/Slackware/initrd.gz' | sh
 
Old 05-24-2020, 07:47 AM   #5
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
It's external sata ssd, that is connected via usb3. I've just tried to make initrd with your command, but it doesn't take any effect, except +10 seconds to boot time. I've tried 30 seconds as well - still no result.

If it matters, I've installed arch with lvm+luks on this devices exactly in the same manner. That time I didn't experience any problems.

Last edited by keeneadt; 05-24-2020 at 07:50 AM.
 
Old 05-24-2020, 08:02 AM   #6
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
Btw, even with -w 30 I don't see sdb device in /dev. It looks working (led is flashing). In UEFI I can see this disk. Actually, last time initrd.gz was loaded from a proper location - /boot/efi/EFI/Slackware, therefore sdb was recognized on boot.
 
Old 05-24-2020, 08:47 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
There's also the possibility that your initrd does not have the modules to support USB storage. That would explain why you never see the device nodes appear.
 
1 members found this post helpful.
Old 05-24-2020, 08:52 AM   #8
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
Hmm... I unpluged ssd from box and connected it to m/b sata. It was identified as sdb, however, I still get this error when I try to boot.
 
Old 05-24-2020, 09:43 AM   #9
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
Does anybody have experience with installing Slackware on lvm+luks? Does it work?
 
Old 05-24-2020, 11:10 AM   #10
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
Two more unsuccessful attempts to install Slackware on lvm+luks. This time I've tried to install on sata ssd and m2 ssd. Both times I get exactly the same error but with different partitions. Looks like notes I mentioned doesn't cover some necessary step or Slackware (at least current) doesn't support working from encrypted device.
 
Old 05-24-2020, 11:28 AM   #11
z80
Member
 
Registered: Jul 2019
Location: Europe
Distribution: Slackware64-current
Posts: 136

Rep: Reputation: 99
Luks and LVM works fine here.
However, I use lilo and a manually created initrd.

My mkinitrd command looks like this:
Code:
mkinitrd -c -k 5.4.42 -f ext2,ext4 -r /dev/cryptvg/root -C /dev/sda2 -L -d de
/etc/lilo.conf looks like this:
Code:
append=" vt.default_utf8=0"
boot = /dev/sda
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
prompt
timeout = 100
change-rules
  reset
vga=normal

image = /boot/vmlinuz
  initrd = /boot/initrd.gz
  root = /dev/cryptvg/root
  label = Linux
  read-only

image = /boot/vmlinuz-rescue
  initrd = /boot/initrd-rescue.gz
  root = /dev/cryptvg/root
  label = Rescue
  append = " single"
  read-only
 
1 members found this post helpful.
Old 05-24-2020, 11:35 AM   #12
khronosschoty
Member
 
Registered: Jul 2008
Distribution: Slackware
Posts: 648
Blog Entries: 2

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Quote:
Originally Posted by keeneadt View Post
Does anybody have experience with installing Slackware on lvm+luks? Does it work?
I've been using luks+lvm for years now (with Slackware64-current and Slackware64-14.2 and in one case Slackware-14.2).
 
1 members found this post helpful.
Old 05-24-2020, 11:46 AM   #13
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
Don't know what to say. Could be an issue of current iso I used. Will try with another one later.
 
Old 05-24-2020, 12:32 PM   #14
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
The error you get is generated when "cryptsetup isLuks /dev/sdb2" returns false. I.e. your disk partition is not recognized as a LUKS volume.
Did you do something out of the ordinary when formatting /dev/sdb2 as a LUKS volume?

Edit - well if your /dev/sdb is not visible at all, my remark is irrelevant.

Last edited by Alien Bob; 05-24-2020 at 12:33 PM.
 
Old 05-24-2020, 12:40 PM   #15
keeneadt
Member
 
Registered: Feb 2020
Distribution: Slackware
Posts: 56

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
Did you do something out of the ordinary when formatting /dev/sda2 as a LUKS volume?
It's /dev/sdb in my case. No, nothing out of what is written in the notes.
Code:
boot
> root

cfdisk /dev/sdb
gpt
/dev/sdb1 ESP 512M
/dev/sdb2 Linux filesystem 250G

cryptsetup -s 512 -y luksFormat /dev/sdb2
cryptsetup open /dev/sdb2 luksslack0

pvcreate /dev/mapper/luksslack0
vgcreate luksvg0 /dev/mapper/luksslack0
lvcreate -L 8G -n swap luksvg0
lvcreate -L 40G -n root luksvg0
lvcreate -l 100%FREE -n home luksvg0

mkswap /dev/luksvg0/swap

setup
The rest I've already described.
 
  


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] Unlocking several LUKS volume groups at boot with one passphrase kestralis Slackware 6 02-06-2020 03:58 AM
[SOLVED] LUKS device unavailable for unloacking chandru.in Slackware - Installation 2 09-05-2016 01:31 PM
nonblocking pool message while unlocking luks on current. dmcrtr Slackware 5 09-03-2015 07:03 AM
Unlocking LUKS with keyfile on USB slaka Linux - Software 1 05-16-2014 03:04 PM
LUKS on RAID or RAID on LUKS? retch Linux - Server 3 05-05-2010 01:57 PM

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

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