You are not logged in.

#1 2017-06-09 11:31:00

Darkyere
Member
Registered: 2017-06-09
Posts: 4

LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

ArchLinux LVM2 on LUKS on MDADM RAID0

----

Im gonna say sorry to start with because this post is going to be a bit long.

I have tried to make Arch Linux boot from an Encrypted MDADM RAID0 with LVM2.
In the order mdadm > Encrypt > LVM2

But it never asks for my password instead it says

:: running early hook [udev]
starting version 232
:: running early hook [lvm2]
:: running early hook [uidev]
triggering uevents...
:: running early hook [encrypt]
Waiting 10 seconds for device /dev/dm-6 ...
Waiting 10 seconds for device /dev/dm-6 ...
ERROR: device ´/dev/dm-6´ not found. skipping fsck
:: mounting ´/dev/dm-6´ on real root
mount: you must specify the filesystem type
you are now being dropped to an emergency shell
sh: can´t acces tty: job control turned off

Its really weird, it seems like it runs the hook lvm2 before encrypt and never runs mdadm_udev
I have had this problem since i first tried it on a real machine and several times after starting from January 2017
And know im trying it in Virtualbox with the same result.

----

To start with i would like to say that i followed the guide on

https://wiki.archlinux.org/index.php/installation_guide

The installation guide works for an non raid unencrypted lvm2 without any problems

---

# I have created the mdadm RAID0 with the command

mdadm --create -v /dev/md2 --level-stripe --raid-devices=2 /dev/sda10 /dev/sdb7

# Then encrypted it 

cryptsetup -v --cipher serpent-xts-plain64 --key-size 512 --hash sha512 --iter-time 15000 --use-random luksFormat /dev/md2

----

# blkid looks like 

/dev/sda5: UUID="ea4f70b6-9888-4956-aa83-b8fad997fadc" TYPE="ext4" PARTUUID="4bedd403-05"
/dev/sda6: UUID="9d462996-01a5-e945-37e2-4217f0c1f331" UUID_SUB="90bf8946-a325-537c-b32f-3125edb56a4d" LABEL="mint:0" TYPE="linux_raid_member" PARTUUID="4bedd403-06"
/dev/sda7: UUID="f2dbd32d-fef2-42c7-a15d-8b1a385d6ba6" TYPE="ext4" PARTUUID="4bedd403-07"
/dev/sda8: UUID="0cf85e58-1e86-24da-0ce9-9ac6b089cf36" UUID_SUB="29e5f9e4-abb2-2871-0244-344bcae3836d" LABEL="darkyere-VirtualBox:1" TYPE="linux_raid_member" PARTUUID="4bedd403-08"
/dev/sda9: UUID="136cdcce-acd3-43ea-84c3-f4a029ec0961" TYPE="ext4" PARTUUID="4bedd403-09"
/dev/sda10: UUID="23770f5f-860c-1d5c-163f-7c2ad043a8da" UUID_SUB="65551972-5348-a987-277f-7455acfa46c5" LABEL="archiso:2" TYPE="linux_raid_member" PARTUUID="4bedd403-0a"
/dev/sda12: UUID="cab0b59f-5fb5-367d-1389-9ccb86105ae6" UUID_SUB="4150784c-370f-0667-128a-96b53c56dafd" LABEL="archiso:3" TYPE="linux_raid_member" PARTUUID="4bedd403-0c"
/dev/sdb3: UUID="766FEFC750E01767" TYPE="ntfs" PARTUUID="7686007d-03"
/dev/sdb5: UUID="9d462996-01a5-e945-37e2-4217f0c1f331" UUID_SUB="65470089-f572-86da-6068-8037a43263ec" LABEL="mint:0" TYPE="linux_raid_member" PARTUUID="7686007d-05"
/dev/sdb6: UUID="0cf85e58-1e86-24da-0ce9-9ac6b089cf36" UUID_SUB="0f7b4bfa-d19b-addd-e2de-195067c6ab16" LABEL="darkyere-VirtualBox:1" TYPE="linux_raid_member" PARTUUID="7686007d-06"
/dev/sdb7: UUID="23770f5f-860c-1d5c-163f-7c2ad043a8da" UUID_SUB="ce341f43-fdec-bba3-ef9c-197f6da42763" LABEL="archiso:2" TYPE="linux_raid_member" PARTUUID="7686007d-07"
/dev/sdb8: UUID="cab0b59f-5fb5-367d-1389-9ccb86105ae6" UUID_SUB="9c34e1ee-a761-19dd-469b-202e2c6e717a" LABEL="archiso:3" TYPE="linux_raid_member" PARTUUID="7686007d-08"
/dev/sr0: UUID="2017-06-01-15-31-02-00" LABEL="ARCH_201706" TYPE="iso9660" PTUUID="58ea47c6" PTTYPE="dos"
/dev/md3: UUID="8e7e6c06-b7fb-41ad-9831-a4e85d42912d" TYPE="crypto_LUKS"
/dev/md2: UUID="9122e1b7-3da7-4fb8-a087-473dc7d48ca6" TYPE="crypto_LUKS"
/dev/md0: UUID="8e35dd52-a251-41e9-a907-bed64cbf617a" TYPE="crypto_LUKS"
/dev/md1: UUID="eb9670bd-9bb5-406f-9910-4f18f92c5106" TYPE="crypto_LUKS"
/dev/sda1: PARTUUID="4bedd403-01"
/dev/sda2: PARTUUID="4bedd403-02"
/dev/sda3: PARTUUID="4bedd403-03"
/dev/sda11: PARTUUID="4bedd403-0b"
/dev/sdb1: PARTUUID="7686007d-01"
/dev/sdb2: PARTUUID="7686007d-02"
/dev/mapper/ArchCrypt: UUID="10f2AV-DE3U-mSaa-98Gn-U4Lg-JVtc-l3cx50" TYPE="LVM2_member"
/dev/mapper/ArchLinux-lvroot: UUID="206aa576-99f9-4bad-a763-ad01bd4a0da5" TYPE="ext4"
/dev/mapper/ArchLinux-lvhome: UUID="d9a34e16-4813-4584-9473-cdfe9c7431b2" TYPE="ext4"
/dev/mapper/ArchLinux-lvswap: UUID="d3232c3e-2b70-4fbe-8f51-1fac00beb6c4" TYPE="swap"

----

# My fstab looks like 

#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/mapper/ArchLinux-lvroot
UUID=206aa576-99f9-4bad-a763-ad01bd4a0da5       /               ext4            rw,relatime,stripe=256,data=ordered     0 1

# /dev/mapper/ArchLinux-lvhome
UUID=d9a34e16-4813-4584-9473-cdfe9c7431b2       /home           ext4            rw,relatime,stripe=256,data=ordered     0 2

# /dev/sda9
UUID=136cdcce-acd3-43ea-84c3-f4a029ec0961       /boot           ext4            rw,relatime,data=ordered                0 2

# /dev/mapper/ArchLinux-lvswap
UUID=d3232c3e-2b70-4fbe-8f51-1fac00beb6c4       none            swap            defaults                                0 0                                  0     0

----

# My /etc/mdadm.conf is create with

mdadm --examine --scan > /etc/mdadm.conf

# And looks like

ARRAY /dev/md/0  metadata=1.2 UUID=9d462996:01a5e945:37e24217:f0c1f331 name=mint:0
ARRAY /dev/md/1  metadata=1.2 UUID=0cf85e58:1e8624da:0ce99ac6:b089cf36 name=darkyere-VirtualBox:1
ARRAY /dev/md/2  metadata=1.2 UUID=23770f5f:860c1d5c:163f7c2a:d043a8da name=archiso:2
ARRAY /dev/md/3  metadata=1.2 UUID=cab0b59f:5fb5367d:13899ccb:86105ae6 name=archiso:3

----

# My crypttab is created with this command and works with Debian/Ubuntu/Mint/OpenSUSE so one should think it would work with Arch as well

echo "ArchCrypt UUID=`sudo blkid -s UUID -o value /dev/md2` none luks" > /etc/crypttab

# And looks like

ArchCrypt UUID=9122e1b7-3da7-4fb8-a087-473dc7d48ca6 none luks

# Which fits with blkid

/dev/md2: UUID="9122e1b7-3da7-4fb8-a087-473dc7d48ca6" TYPE="crypto_LUKS"

----

# In /etc/mkinitcpio.conf i have changed modules and hooks to the following

MODULES="raid0 dm-crypt dm-mod serpent_generic xts sha512_generic"

HOOKS="base udev autodetect modconf block mdadm_udev encrypt lvm2 filesystems keyboard fsck"

# And ran

mkinitcpio -p linux

----

# lsblk looks like this

NAME                      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda                         8:0    0  250G  0 disk  
├─sda1                      8:1    0  500M  0 part  
├─sda2                      8:2    0  500M  0 part  
├─sda3                      8:3    0  500M  0 part  
├─sda4                      8:4    0    1K  0 part  
├─sda5                      8:5    0    1G  0 part  
├─sda6                      8:6    0   50G  0 part  
│ └─md0                     9:0    0  100G  0 raid0  
├─sda7                      8:7    0    1G  0 part  
├─sda8                      8:8    0   50G  0 part  
│ └─md1                     9:1    0  100G  0 raid0 
├─sda9                      8:9    0    1G  0 part  /boot
├─sda10                     8:10   0   50G  0 part  
│ └─md2                  9:126  0  100G  0 raid0 
│   └─ArchCrypt           252:4    0  100G  0 crypt 
│     ├─ArchLinux-lvroot  252:5    0   25G  0 lvm  / 
│     ├─ArchLinux-lvhome  252:6    0   67G  0 lvm  /home
│     └─ArchLinux-lvswap  252:7    0    8G  0 lvm  [SWAP]
├─sda11                     8:11   0    1G  0 part  
└─sda12                     8:12   0   50G  0 part  
  └─md3                  9:127  0  100G  0 raid0 
sdb                         8:16   0  250G  0 disk  
├─sdb1                      8:17   0  500M  0 part  
├─sdb2                      8:18   0  500M  0 part  
├─sdb3                      8:19   0  500M  0 part 
├─sdb4                      8:20   0    1K  0 part  
├─sdb5                      8:21   0   50G  0 part  
│ └─md0                     9:0    0  100G  0 raid0 
├─sdb6                      8:22   0   50G  0 part  
│ └─md1                     9:1    0  100G  0 raid0 
├─sdb7                      8:23   0   50G  0 part  
│ └─md2                  9:126  0  100G  0 raid0 
│   └─ArchCrypt           252:4    0  100G  0 crypt 
│     ├─ArchLinux-lvroot  252:5    0   25G  0 lvm   /
│     ├─ArchLinux-lvhome  252:6    0   67G  0 lvm   /home
│     └─ArchLinux-lvswap  252:7    0    8G  0 lvm   [SWAP]
└─sdb8                      8:24   0   50G  0 part  
  └─md3                 9:127  0  100G  0 raid0 
sr0                        11:0    1  488M  0 rom

----

I hope someone out there knows what to do cause i am lost.
I started following the guides from Arch homepage itself and the homepage

http://dnmx.ch/blog/2015/11/arch-linux- … mdadm-conf

pretty much does as ive done and other sites agree.

So i just cant understand why it wont work.

Thank you for reading and best regards,
Darkyere

Last edited by Darkyere (2017-06-10 21:22:28)

Offline

#2 2017-06-09 19:52:06

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-06-10 01:05:47

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

This looks suspicious: "ERROR: device ´/dev/dm-6´ not found.". What does you kernel parameters line look like?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#4 2017-06-10 08:07:17

Darkyere
Member
Registered: 2017-06-09
Posts: 4

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

Do you mean my kernel parameters in GRUB2 or something else ?

Offline

#5 2017-06-10 11:37:00

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

Yes, your kernel parameters in GRUB2. The whole line taken from your grub.cfg.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#6 2017-06-10 13:54:16

Darkyere
Member
Registered: 2017-06-09
Posts: 4

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

menuentry 'Arch (on /dev/mapper/ArchLinux-lvroot)' --class arch --class gnu-linux --class gnu --$
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos9'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos9 --hint-efi=hd0,msdos9 -$
        else
          search --no-floppy --fs-uuid --set=root 136cdcce-acd3-43ea-84c3-f4a029ec0961
        fi
        linux /vmlinuz-linux root=/dev/dm-6
        initrd /initramfs-linux.img
}

Offline

#7 2017-06-10 18:08:13

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

You want to use uuids and you want to read this wiki page: https://wiki.archlinux.org/index.php/Dm … ire_system


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#8 2017-06-10 19:33:14

Darkyere
Member
Registered: 2017-06-09
Posts: 4

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

Thank you for that page after a bit of trial and error it came through for me.
My kernel parameter now looks like

linux /vmlinuz-linux cryptdevice=UUID=9122e1b7-3da7-4fb8-a087-473dc7d48ca6:ArchCrypt root=UUID=206aa576-99f9-4bad-a763-ad01bd4a0da5

which is based on blkid info

/dev/md2: UUID="9122e1b7-3da7-4fb8-a087-473dc7d48ca6" TYPE="crypto_LUKS"

/dev/mapper/ArchLinux-lvroot: UUID="206aa576-99f9-4bad-a763-ad01bd4a0da5" TYPE="ext4"

I highly appreciated the help i didnt find this info on guides on the net and during my search i for some reason did not find the the page you posted.

It was the last part i needed to understand this.

Thank you and best regards,
Darkyere

Offline

#9 2017-06-10 21:01:08

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: LVM2 on LUKS on MDADM RAID0 wont boot [Solved]

If your problem is solved then edit your first post and add [SOLVED] to the title https://wiki.archlinux.org/index.php/Co … ow_to_post


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB