7 Aug 10:36
Massive Failure
From: Clayton Shepard <cws@...>
Subject: Massive Failure
Newsgroups: gmane.linux.kernel.device-mapper.dm-crypt
Date: 2008-08-07 08:37:51 GMT
Subject: Massive Failure
Newsgroups: gmane.linux.kernel.device-mapper.dm-crypt
Date: 2008-08-07 08:37:51 GMT
Due to a combination of hardware failure, ignorance, and stupidity I have managed to really make a mess of a 7 drive mdadm (raid5) -> lvm -> luks -> ext3 setup. So here is the basic setup: 1. sudo badblocks -c 16384 -s -w -t random -v /dev/sd (on all 7 drives) 2. sudo mdadm --create --verbose /dev/md0 --level=5 --chunk=256 --force --raid-devices=7 /dev/sd[a,b,c,d,e,f,g] 3. pvcreate /dev/md0 4. vgcreate lg /dev/md0 -s 256M 5. lvcreate -l22356 -nlv lg 6. cryptsetup --verify-passphrase --verbose --hash=sha256 --cipher=aes-cbc-essiv:sha256 --key-size=128 luksFormat /dev/lg/lv 7. cryptsetup luksOpen /dev/lg/lv encrypted 8. mkfs.ext3 -j -m 3 -O dir_index,filetype,sparse_super,large_file /dev/mapper/encrypted So long story short, the hardrives were swapped around and one point which cause blkid.tab to go crazy and remap the drives to different letters. All but one of the mdadm superblocks were erased, but I believe the array was clean before this happened. By using basically the same command first used to create the array mdadm detected that it was already a raid array and recreated it - unfortunately it thought that the last drive (sdh at this time) was dirty, and thus began rebuilding it. Unfortunately commands 3-7 were also reissued, which initially made me believe that the luks header was destroyed (according to this thread: http://osdir.com/ml/linux.kernel.device-mapper.dm-crypt/2005-12/msg00045.html). After some time with dd and a hex editor I have found three luks headers on the drives - two of which are the new header; however it is my hope that the other one is the original luks header.(Continue reading)
RSS Feed