You are not logged in.

#1 2011-02-23 21:36:25

ladanz
Member
Registered: 2009-08-08
Posts: 13

LUKS cryptsetup/ booting from encrypted device fails after update

Hi,

i got an error like:

ERROR: Failed to open encryption mapping: The device /dev/sda2 is not a LUKS volume and the crypto= parameter was not specified.
No volume groups found
Waitin 10 seconds for device /dev/mapper/cryptpool-cryptroot ...
ERROR: Unable to determine major/minor number of root device '/dev/mapper/cryptpool-cryptroot'.
You are beeing dropped to a recovery shell
Type 'exit' to try and continue booting
/bin/sh can't access tty; job control turned off
[ramfs /]#

And when i run cryptsetup on the shell(?) after that, i get:

cryptsetup: error while loading shared libraries: libuuid.so.1: cannot open shared object file: No such file or directory

I'm running x86_64 and i was doing "yaourt -Syu --aur" this morning, and i did shutdown and this evening it wont boot.

Please help me, at least with advice how to rescue the data from crypt volume...

Thanks in advance!

Offline

#2 2011-02-24 15:32:53

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 414

Re: LUKS cryptsetup/ booting from encrypted device fails after update

I think you use grub2 and a grub-mkconfig command was executed. Anyway, in your grub.cfg you should modify the menuentry:

linux    /vmlinuz26 root=/dev/mapper/your-encrypted-device cryptdevice=/dev/sdaX:your-encrypted-device ro  quiet

sdaX is your root parttition (X representing the number, e.g. sda1)
your-encrypted-device: the name of your mapped device, e.g. topsecret or something smile

Also, you can use sysrescd http://www.sysresccd.org/Main_Page to get your data. Boot from the cd:

cryptsetup luksOpen /dev/sda1 topsecret 
#then enter password
mkdir /mnt/ts
mount /dev/mapper/topsecret /mnt/ts

Now your crypted partition is unlocked and mounted to /mnt/ts and you can backup it with rsync (at least I suggest rsync)

Offline

#3 2011-02-24 17:14:07

ladanz
Member
Registered: 2009-08-08
Posts: 13

Re: LUKS cryptsetup/ booting from encrypted device fails after update

siriusb wrote:

I think you use grub2 and a grub-mkconfig command was executed. Anyway, in your grub.cfg you should modify the menuentry:

linux    /vmlinuz26 root=/dev/mapper/your-encrypted-device cryptdevice=/dev/sdaX:your-encrypted-device ro  quiet

sdaX is your root parttition (X representing the number, e.g. sda1)
your-encrypted-device: the name of your mapped device, e.g. topsecret or something smile
...

Yeah that might be true, my current grubentry is:

kernel /vmlinuz26 root=/dev/mapper/cryptpool-cryptroot cryptdevice=/dev/sda2:cryptpool ro quiet

i tried to replace sda2 with sda1 but it didnt make the trick
also i tried /dev/sda2:cryptpool-cryptroot like u suggested, but it didnt work either...

any more suggestions?

isn't that bad???:

ladanz wrote:

And when i run cryptsetup on the shell(?) after that, i get:

cryptsetup: error while loading shared libraries: libuuid.so.1: cannot open shared object file: No such file or directory

Offline

#4 2011-02-24 18:20:55

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 414

Re: LUKS cryptsetup/ booting from encrypted device fails after update

It seems to me that you use grub and not grub2, is that right?
Pls read the following pages:
https://wiki.archlinux.org/index.php/Grub
https://wiki.archlinux.org/index.php/LUKS

Both in root section and cryptdevice section in the menuentry you must use the same mapped device name: cryptpool-cryptroot.

Maybe you have more than one HDD and their order has changed or your root partition is not sda2. Also, you should check that your root (hdX,Y) line is correct.

Offline

#5 2011-02-24 21:05:02

ladanz
Member
Registered: 2009-08-08
Posts: 13

Re: LUKS cryptsetup/ booting from encrypted device fails after update

siriusb wrote:

It seems to me that you use grub and not grub2, is that right?

Yeah you may be right.

siriusb wrote:

Maybe you have more than one HDD and their order has changed or your root partition is not sda2. Also, you should check that your root (hdX,Y) line is correct.

Its even more complicated.
I just mounted the devices using a debian on a stick and it turns out i followed some tutorial(propably from archwiki) so that i got the following setup:
/dev/sda1 -> boot
/dev/sda2 -> LUKS encrypted [LVM Volume group containing [root], [home], [swap]]

I guess i have to find that tutorial again to make it work again.

Here my current menu.lst

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/mapper/cryptpool-cryptroot cryptdevice=/dev/sda2:cryptpool ro quiet
initrd /kernel26.img

Could you help me find a solution regarding my setup?

Offline

#6 2011-02-24 21:11:02

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: LUKS cryptsetup/ booting from encrypted device fails after update

This may or may not be related---the details you're reporting don't sound the same as mine. But the timing of having a LUKS issue during the boot sequence just after a recent update is common to both of us. That suggests there may be some underlying connection.

Offline

#7 2011-02-25 08:23:49

ladanz
Member
Registered: 2009-08-08
Posts: 13

Re: LUKS cryptsetup/ booting from encrypted device fails after update

Yeah, i investigated a little further and it seems, that this is the bad point:

ERROR: Failed to open encryption mapping: The device /dev/sda2 is not a LUKS volume and the crypto= parameter was not specified.
No volume groups found

But i confirmed that it is a valid LUKS volume by opening it with the debian-on-a-stick. And after beeing dropped to the recovery shell(at booting) cryptsetup failes too:

ladanz wrote:

    And when i run cryptsetup on the shell(?) after that, i get:

cryptsetup: error while loading shared libraries: libuuid.so.1: cannot open shared object file: No such file or directory

i confirmed by grubentry by searching for the tutorial: http://www.pindarsign.de/webblog/?p=767

i confirmed the configuration of the mentioned files, and it seamed my rc.local was lacking ""USELVM=YES", but altering that didn't change the problem.

Anyone got any more suggestions?
Should i try to reinstall some packages? which ones?

Thanks in advance!

Offline

#8 2011-02-25 10:17:49

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 414

Re: LUKS cryptsetup/ booting from encrypted device fails after update

Man, you use lvm and you don't know about it?!

I have never used LVM, so I can't really help, but I'd check my /etc/mkinitcpio.conf for lvm2 hook before filesystems. https://wiki.archlinux.org/index.php/Lvm

With all the information available to us now, your menuentry should work as is. And you change USELVM="no" to USELVM="yes" in /etc/rc.conf not in rc.local.

Offline

#9 2011-02-26 11:24:18

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: LUKS cryptsetup/ booting from encrypted device fails after update

ladanz wrote:

But i confirmed that it is a valid LUKS volume by opening it with the debian-on-a-stick. And after beeing dropped to the recovery shell(at booting) cryptsetup failes too:

Just because that drive is /dev/sda2 when you boot in your debian system, does not mean it is also /dev/sda2 when you boot in Arch. It may be /dev/sdb2, or /dev/sdc2, or something else. (I don't think it will be /dev/sda1, which you said you tried.)

Can you refer to the disk as /dev/disk/by-uuid/something, or /dev/disk/by-label/something.

Offline

#10 2011-03-01 19:46:33

ladanz
Member
Registered: 2009-08-08
Posts: 13

Re: LUKS cryptsetup/ booting from encrypted device fails after update

Thanks everyone, it's working again!

It seams while building the kernel some configurations were wrong, or the building failed somehow.

However i booted arch from cd image, decrypted LUKS device, mounted volume groups, chrooted to the old root and rebuilt the kernel and everything works again.

Thanks for your support!

Offline

Board footer

Powered by FluxBB