/dev/md2 is not a valid LUKS device
Hello,
I am trying to install a server with 4 3.0 TB disks in RAID, following the howto from tjworld.net/wiki/Linux/Ubuntu/HardyRAID5EncryptedLVM.
The basic steps I follow are:
1. Boot on the latest Debian live DVD
Code:
# apt-get install initramfs-tools mdadm cryptsetup lvm2
# modprobe md
# modprobe linear
# modprobe multipath
# modprobe dm-crypt
# modprobe raid0
# modprobe raid1
# modprobe raid5
# modprobe raid6
# modprobe raid10
# fdisk /dev/sda (I actually use "Disk Utility" as fdisk presents some issues with large partitions. 4 partitions: 10GB, bootable, type fd, 130GB, type fd, 1900GB, type fd, Remaining space, type fd)
# sfdisk -d /dev/sda | sfdisk --force /dev/sdb
# sfdisk -d /dev/sda | sfdisk --force /dev/sdc
# sfdisk -d /dev/sda | sfdisk --force /dev/sdd
# mdadm --create /dev/md0 --level=1 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
# mdadm --create /dev/md1 --level=1 --raid-devices=4 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
# mdadm --create /dev/md2 --level=5 --raid-devices=4 /dev/sda3 /dev/sdb3 /dev/sdc3 /dev/sdd3
# mdadm --create /dev/md3 --level=5 --raid-devices=4 /dev/sda4 /dev/sdb4 /dev/sdc4 /dev/sdd4
# mke2fs -t ext4 /dev/md0
# mke2fs -t swap /dev/md1
# mke2fs -t ext4 /dev/md2
# mke2fs -t ext4 /dev/md3
# KEYFILE="/media/PENDRIVE/key.png"
# cryptsetup --hash sha512 --key-size 256 --cipher aes-cbc-essiv:sha256 luksFormat /dev/md2 $KEYFILE
WARNING!
========
This will overwrite data on /dev/md2 irrevocably.
Are you sure? (Type uppercase yes): YES
# cryptsetup --hash sha512 --key-size 256 --cipher aes-cbc-essiv:sha256 luksFormat /dev/md3 $KEYFILE
WARNING!
========
This will overwrite data on /dev/md3 irrevocably.
Are you sure? (Type uppercase yes): YES
# cryptsetup --key-file $KEYFILE luksOpen /dev/md2 md2encrypted
Device /dev/md2 is not a valid LUKS device.
# cryptsetup --key-file $KEYFILE luksOpen /dev/md3 md3encrypted
Device /dev/md3 is not a valid LUKS device.
Why are they not valid LUKS devices and how should I proceed to correct that?
Thank you in advance