You are not logged in.

#1 2012-04-12 11:47:52

John0000
Member
Registered: 2012-04-12
Posts: 40

[SOLVED] Luks with /arch/setup installation , fails at boot

Hi all,
So I tried to install arch on virtualbox with encrypted partitions (root /, /home/ and swap), but it fails at boot.
/dev/sda1 is /boot
/dev/sda2 is swap
/dev/sda3 is /
/dev/sda4 is /home
The root partition seems to be loading fine because it asks for my password, then the boot sequence goes on, until the /home/ (apparently) :

:: Bringing up loopback interface
:: Unlocking encrypted volumes: chome..Usage: cryptsetup [-?vyrq] (...all the options...can't copy paste with virtualbox)
/sbin/cryptsetup: Unknown action
                                  failed                                                    [FAIL]
/dev/mapper/croot: clean, 27576/457856 files, 166316/1830898 blocks
fsck.ext4: No such file or directory while trying to open /dev/mapper/chome
Possibly non-existent device?
/dev/sda1: clean,29/24096 files, 20790/96356 blocks
                                                                                              [FAIL]

It seems that it tries to open /dev/mapper/chome but it's not mounted yet
In my /etc/crypttab, I added the lines :

chome /dev/sda4 none luks
cswap /dev/sda2 none luks

/etc/fstab (I didn't change anything, /arch/setup configured it that way) :

/dev/mapper/chome /home ext4 defaults 0 1
/dev/mapper/croot / ext4 defaults 0 1
/dev/mapper/cswap swap swap defaults 0 0
/dev/sda1 /boot ext2 defaults 0 1

And grub :

title Arch Linux
root (hd0,0)
kernel /vmlinuz-linux root=/dev/mapper/croot cryptdevice=/dev/sda3:croot ro
initrd /initramfs-linux.img

What I wanted to do was to have swap,root and home encrypted partitions mounted at boot, but maybe it is not possible?
I tried a lot of configurations for /etc/fstab and /etc/crypttab according to what I could find on the net but nothing worked. I read the whole tutorial https://wiki.archlinux.org/index.php/Sy … _with_LUKS but there is no config for fstab or crypttab or grub when installing with /arch/setup
Thanks for any help !

Last edited by John0000 (2012-04-12 12:50:18)

Offline

#2 2012-04-12 12:20:14

klz
Member
Registered: 2011-02-14
Posts: 23

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

are you sure the "none" 's should be there in your crypttab ?
and " luks"  is your password?

i have:
# NAME   SOURCE DEVICE   PASSWORD   OPTIONS
home        /dev/sda4              /path_to_keyfile


My  /boot/grub/menu.lst is a bit different too.
in mine i first declare the cryptdevice=, and after that call the root=. You have root= first and then cryptdevice=... try swapping them around.

for example:
kernel /kernel-3.3.1-rev1 cryptdevice=/dev/sda3:root root=/dev/mapper/root

Last edited by klz (2012-04-12 12:35:18)

Offline

#3 2012-04-12 12:34:12

John0000
Member
Registered: 2012-04-12
Posts: 40

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

No i'm not sure of anything, I tried by putting the password in plaintext instead of the 'none' but there is the same error at boot

Offline

#4 2012-04-12 12:38:44

klz
Member
Registered: 2011-02-14
Posts: 23

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

i dont have "luks" at the end of the line either..

are you able to unlock your chome and cswap from the commandline with:
cryptsetup luksOpen /dev/sda4 chome
cryptsetup luksOpen /dev/sda2 cswap

als try swapping root and cryptdevice in menu.lst around

Offline

#5 2012-04-12 12:49:24

John0000
Member
Registered: 2012-04-12
Posts: 40

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

Ok it worked !! I switched as you said and I had to add 'ro' at the end of the line otherwise it wouldn't work (this 'ro' was automatically generated first,I don't know what it means)
And in the /etc/crypttab, I put

chome /dev/sda4 mypass
cswap /dev/sda2 myotherpass

But then I find it rather strange that you put passwords in plaintext in a file anyone could read in 5sec on my comp while I go grab a coffee at work. Why is there no file with my plaintext password for the root partition, and can't I do the same for/home/ and swap?

Anyway, thanks for the help !

Offline

#6 2012-04-12 13:05:46

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

John0000 wrote:

But then I find it rather strange that you put passwords in plaintext in a file anyone could read in 5sec on my comp while I go grab a coffee at work.

You can always put ASK there and just type them in manually during boot.


#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#7 2012-04-12 13:09:52

klz
Member
Registered: 2011-02-14
Posts: 23

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

Indeed you have a point, putting password in plaintext isn't very safe.
There is a good alternative though: https://wiki.archlinux.org/index.php/Sy … _a_Keyfile

the reason why you don't have a passphrase for root in a file somewhere is that you provide this passphrase during boot-time.
Somewhere during boot you get the option to unlock you root device by typing in a passphrase... right?

ro means that the volume is mounted read only http://linux.die.net/man/8/mount

Offline

#8 2012-04-12 13:39:41

John0000
Member
Registered: 2012-04-12
Posts: 40

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

Working perfectly with 'ASK' instead of the password, thanks for the tip !
@klz : Do you then think having a keyfile instead of a homemade password to enter at each boot is safer ? If I understood correclty the wiki, whatever the keyfile, it will be stored somewhere on a usb stick, so if someone manages to steal it...

Offline

#9 2012-04-12 13:44:40

klz
Member
Registered: 2011-02-14
Posts: 23

Re: [SOLVED] Luks with /arch/setup installation , fails at boot

you can store to keyfiles on your encrypted root partition, this way they are secure and only available after the root gets unlocked.
Saves you the hassle of typing 3 passphrases at boot, only one passphrase is needed wink

and use a long passphrase! not just one word.

Offline

Board footer

Powered by FluxBB