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 11-13-2013, 12:02 PM   #1
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 204

Rep: Reputation: 44
Upgrading 14.0 to 14.1 with encrypted disks (LUKS+LVM)


I have the LUKS+LVM setup as described in README_CRYPT.TXT.
I upgraded 14.0 to 14.1 following Pat's UPGRADE.TXT

I did build the initrd and ran lilo after that. However something must have gone wrong because when it boots it goes into a kernel panic. (Good thing I did this on the trial laptop...)

Is there any special instruction on how to upgrade when you have this setup? (ie LVM volume with /root and swap in encrypted /dev/sda2, /boot on unencrypted /dev/sda1)

I was able to manually enter the system by booting the installation disk then mounting the partition, VGs and the mapped drives. I chrooted into it and tried rebuilding initrd, however that did not work (I forgot the error message, this was done at work), even though I had the unencrypted boot partition mounted in /boot.

Anyway, this laptop is test so I am not too worried about recovering it as I can install the system from scratch there. But I don't want to touch the production machine before I know the upgrade will work!
 
Old 11-13-2013, 01:29 PM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Could be this issue I raised during the RC's. Might not be, but it's worth a look.

http://www.linuxquestions.org/questi...ml#post5049275
 
1 members found this post helpful.
Old 11-13-2013, 03:05 PM   #3
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 204

Original Poster
Rep: Reputation: 44
Oh, I see. I am indeed using old style cryptroot stuff. I will try to use "-r lukssda2" with mkinitrd tomorrow. Will post here what I find.
 
Old 11-13-2013, 03:49 PM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Actually, thinking about it, if you're encrypting the LVM PV rather than the LVM LV then you shouldn't be hitting this issue. It's a problem that affects people who have an encrypted root partition, not an encrypted LVM PV, which sounds like what you have.

It might help if you give us a little more info about what you have in lilo.conf, and what mkinitrd command you used.

Last edited by GazL; 11-13-2013 at 04:00 PM.
 
Old 11-14-2013, 09:14 AM   #5
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 204

Original Poster
Rep: Reputation: 44
I can no longer remember the details of the initial mkinird command I used and it is not in .bash_history.

So rather than diagnosing what went wrong, I am just trying to fix this system. Here is what I am doing.

I boot off the slackware installation and then mount the drives under /mnt :
Code:
cryptsetup luksOpen /dev/sda2 cryptvg
vgscan --mknodes
vgchange -ay
mount /dev/mapper/cryptvg-root /mnt
mount /dev/sda1 /mnt/boot
chroot /mnt
Now I make the initrd:
Code:
mkinitrd -c -k 3.10.17 -f ext4 -r /dev/cryptvg/root -m ext4:ehci_hcd:ehci_pci:uhci_hcd:hid_generic:usbhid -u -l en-gb -L -o /boot/initrd.gz
at this point I get:
Code:
cat: /proc/partitions: No such file or directory
OK: /lib/modules/3.10.17/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.10.17/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/3.10.17/kernel/fs/ext4/ext4.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/usb/host/ehci-hcd.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/usb/host/ehci-hcd.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/usb/host/ehci-pci.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/usb/host/uhci-pci.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/hid/hid.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/hid/hid-generic.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/hid/hid.ko added.
OK: /lib/modules/3.10.17/kernel/drivers/hid/usbhid/usbhid.ko added.
cat: /proc/partitions: No such file or directory
26585 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
lilo.conf contents:
Code:
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
append=" vt.default_utf8=0"
prompt
timeout = 50
vga = normal
image = /boot/vmlinuz-generic-3-10-17
initrd = /boot/initrd.gz
root = /dev/cryptvg/root
label = Slackware
read-only
I created /dev/cryptvg/root to fool lilo (since that volume is mounted outside this chroot), and then ran lilo.
exited chroot, removed volume, luksClose and rebooted.

No kernel panic this time, however it fails to mount /dev/cryptvg/root:
Code:
mount: mounting /dev/cryptvg/root on /mnt failed: No such file or directory
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
Note that I never got the prompt to enter the encryption password.
I guess I have to go back and use /dev/mapper/luksnnnn in lilo.conf for root ?
Any obvious flaws above?

thanks

Last edited by metageek; 11-14-2013 at 09:18 AM.
 
Old 11-14-2013, 09:24 AM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Ok, a few things:

You're missing -C /dev/sda2 on your mkinitrd.

I also believe that it should be -l uk rather than -l en-gb (but that one is from memory, so it's best to double check that.)

Also, before you chroot:
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev

Last edited by GazL; 11-14-2013 at 09:26 AM.
 
1 members found this post helpful.
Old 11-14-2013, 09:39 AM   #7
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 204

Original Poster
Rep: Reputation: 44
I said:
Quote:
Originally Posted by metageek View Post
exited chroot, removed volume, luksClose and rebooted.
yes I did vgremove on the volumes, so I can't try to sort this out anymore (should first learn LVM2 properly!)

But if you still have comments about this I would appreciate. I need to upgrade another laptop with the same configuration and I would like to do it successfully.

thanks
 
Old 11-14-2013, 09:43 AM   #8
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 204

Original Poster
Rep: Reputation: 44
Oh well, it was indeed missing the "-C /dev/sda2" that was likely the problem this time.
Yes it is uk instead of en-gb ...

I cannot mark this solved, but I may go ahead and try the other laptop. I will need to do a full backup since I am not confident it will go without trouble.

thanks
 
Old 11-15-2013, 02:36 AM   #9
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 204

Original Poster
Rep: Reputation: 44
I am now pretty sure that my initial problem was the same as described in this thread

Kernel 3.10.7 breaks dm-crypt/Luks root volume

So I am now marking this as solved.

Thanks for the help @GazL
 
  


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
Mounting encrypted LVM - Device /dev/.../lv_home is not a valid LUKS device. recarv Linux - Hardware 3 02-15-2011 02:38 PM
13.1 install LIBATA switch, LUKS, LVM, initrd, and lots of disks Z038 Slackware - Installation 1 07-05-2010 04:28 PM
Encrypted root with LUKS on LVM and RAID-1: How? gargamel SUSE / openSUSE 5 03-20-2010 04:30 PM
[SOLVED] Kernel update on LUKS and LVM encrypted Slackware, mount fails KMBS Slackware 15 02-08-2010 01:23 PM
Slackware 12.2 + RAID-1 + LVM + LUKS encrypted root gargamel Slackware 35 12-17-2009 11:25 AM

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

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