You are not logged in.

#1 2016-08-10 21:04:15

cra1g321
Member
Registered: 2011-01-24
Posts: 66

[Solved] Need help configuring GRUB on RAID1 encrypted LVM setup

** SOLVED **

Thanks to the awesome help by Namarrgon on the irc, it seems i wasn't doing the cryptdevice line in grub correctly,
i got it working by doing
GRUB_CMDLINE_LINUX="cryptdevice=/dev/md1:lvm root=/dev/mapper/MyVol-root"




Hey all, so i've got rid of my windows 10 drive, and in the middle of doing a RAID1 encrypted LVM arch install.
i've done an encrypted LVM install before but not with RAID.

The part i'm failing at is at how to configure grub.

Here is a what i've done so far for this install

# load uk keyboard
loadkeys uk

# enable wifi
ls /sys/class/net
wifi-menu -o wlps0s18f2u2

# Set time
timedatectl set-ntp true

# load modules
modprobe raid1
modprobe dm-mod

# Create partitions
cfdisk /dev/sda
create 500MB partition and set bootable flag
create partiton on remaining space
both are type (linux raid autodetect)

# Create raid arrays
mdadm --create /dev/md0 --level=1 --raid-devices=2 --metadata=1.0 /dev/sda1 /dev/sdb1
mdadm --create /dev/md1 --level=1 --raid-devices=2 --metadata=1.2 /dev/sdb1 /dev/sdb2

/dev/md0 for /boot
/dev/md1 for lvm

# Create boot FS
mkfs.ext4 /dev/md0

# Create LUKS 
cryptsetup luksFormat /dev/md1
cryptsetup open --type luks /dev/md1 lvm

# Create physical volume for lvm
pvcreate /dev/mapper/lvm

# Create volume group
vgcreate MyVol /dev/mapper/lvm

# Create logical volumes
lvcreate -L 50GB MyVol -n root
lvcreate -L 4GB MyVol -n swap
lvcreate -l 100%FREE MyVol -n home

# Create Filesytems
mkfs.ext4 /dev/mapper/MyVol-root
mkfs.ext4 /dev/mapper/MyVol-home
mkswap /dev/mapper/MyVol-swap

# Mount new filesystems
mount /dev/mapper/MyVol-root /mnt
mkdir /mnt/boot
mount /dev/md0 /mnt/boot
mkdir /mnt/home
mount /dev/mapper/MyVol-home /mnt/home

# Configure mirrors
nano /etc/pacman.d/mirrorlist

# Install base system
pacstrap -i /mnt base base-devel

# Generate fstab
genfstab -U /mnt >> /mnt/etc/fstab

# Chroot into install
arch-chroot /mnt /bin/bash

# Edit vconsole for correct keymap
nano /etc/vconsole.conf
	KEYMAP=uk

# Edit locales
nano /etc/locale.gen
locale-gen

# Configure timezone
tzselect
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime

# set computer clock to utc
hwclock --systohc --utc

# Update raid config
mdadm --examine --scan > /etc/mdadm.conf
mdadm --assemble --scan

# Configure mkinitcpio
nano /etc/mkinitcpio.conf
add the following after block in HOOKS
	keyboard keymap encrypt lvm2 mdadm_udev
mkinitcpio -p linux

# Install bootloader
pacman -S grub

This time i've stopped just after installing the grub package, so i can wait for a guru to help me big_smile

here is also my blkid and lsblk outputs to give a better idea of my setup

NAME               MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                  8:0    0   1.8T  0 disk  
|-sda1               8:1    0   477M  0 part  
| `-md0              9:0    0   477M  0 raid1 /boot
`-sda2               8:2    0   1.8T  0 part  
  `-md1              9:1    0   1.8T  0 raid1 
    `-lvm          253:0    0   1.8T  0 crypt 
      |-MyVol-root 253:1    0    50G  0 lvm   /
      |-MyVol-swap 253:2    0     4G  0 lvm   
      `-MyVol-home 253:3    0   1.8T  0 lvm   /home
sdb                  8:16   0   1.8T  0 disk  
|-sdb1               8:17   0   477M  0 part  
| `-md0              9:0    0   477M  0 raid1 /boot
`-sdb2               8:18   0   1.8T  0 part  
  `-md1              9:1    0   1.8T  0 raid1 
    `-lvm          253:0    0   1.8T  0 crypt 
      |-MyVol-root 253:1    0    50G  0 lvm   /
      |-MyVol-swap 253:2    0     4G  0 lvm   
      `-MyVol-home 253:3    0   1.8T  0 lvm   /home
sdc                  8:32   0 931.5G  0 disk  
`-sdc1               8:33   0 931.5G  0 part  
sdd                  8:48   1   7.5G  0 disk  
|-sdd1               8:49   1   749M  0 part  
`-sdd2               8:50   1    40M  0 part  
sr0                 11:0    1  1024M  0 rom   
loop0                7:0    0   325M  1 loop  
/dev/sdc1: UUID="8a83f57b-fec8-4a92-a155-e304825d680a" TYPE="xfs" PARTUUID="83cd0495-01"
/dev/sdb1: UUID="b32a68d4-439c-6335-5233-54d80419a671" UUID_SUB="13e5b095-bb29-67b7-f02e-0fa5aa3f60ed" LABEL="archiso:0" TYPE="linux_raid_member" PARTUUID="5bfaf1be-01"
/dev/sdb2: UUID="56f1eeda-be86-d6ec-4354-a25536adf571" UUID_SUB="524e0e2e-49a1-3ef4-72ba-fcf748b128a5" LABEL="archiso:1" TYPE="linux_raid_member" PARTUUID="5bfaf1be-02"
/dev/sda1: UUID="b32a68d4-439c-6335-5233-54d80419a671" UUID_SUB="bc3c601e-f4b9-b222-460e-a8077dacf924" LABEL="archiso:0" TYPE="linux_raid_member" PARTUUID="8e01905d-01"
/dev/sda2: UUID="56f1eeda-be86-d6ec-4354-a25536adf571" UUID_SUB="3fbe411a-c36d-36ee-290f-09a404f124ab" LABEL="archiso:1" TYPE="linux_raid_member" PARTUUID="8e01905d-02"
/dev/sdd1: UUID="2016-07-01-19-33-52-00" LABEL="ARCH_201607" TYPE="iso9660" PTUUID="4c840490" PTTYPE="dos" PARTUUID="4c840490-01"
/dev/sdd2: SEC_TYPE="msdos" LABEL="ARCHISO_EFI" UUID="5409-DBBC" TYPE="vfat" PARTUUID="4c840490-02"
/dev/loop0: TYPE="squashfs"
/dev/md1: UUID="6b95c5e2-a1eb-441b-aa93-89ba21a15852" TYPE="crypto_LUKS"
/dev/md0: UUID="aa750738-f5b1-4b4e-aaac-ae8a90b3fc9c" TYPE="ext4"
/dev/mapper/lvm: UUID="4JzBn5-tQu9-BjtK-xGBG-8obj-yCTr-V5sz1H" TYPE="LVM2_member"
/dev/mapper/MyVol-root: UUID="1874bf41-42a1-49db-ad15-f4a2058a8de3" TYPE="ext4"
/dev/mapper/MyVol-swap: UUID="16b8cfa9-3e3f-4f56-b144-7108c77ce103" TYPE="swap"
/dev/mapper/MyVol-home: UUID="e7110358-6aac-4fd5-9113-301e6ff7a99c" TYPE="ext4"

Last edited by cra1g321 (2016-08-10 21:49:55)

Offline

Board footer

Powered by FluxBB