From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c7tF7NHQc3nI for ; Mon, 18 Feb 2013 19:34:03 +0100 (CET) Received: from donkey.heisl.org (mail.heisl.org [86.59.94.243]) by mail.saout.de (Postfix) with ESMTP for ; Mon, 18 Feb 2013 19:34:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by donkey.heisl.org (Postfix) with ESMTP id 8E7D7285475 for ; Mon, 18 Feb 2013 19:28:51 +0100 (CET) Received: from donkey.heisl.org ([127.0.0.1]) by localhost (donkey.heisl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xf7ljBiSzd8k for ; Mon, 18 Feb 2013 19:28:51 +0100 (CET) Received: from [192.168.0.20] (chello213047090191.3.14.vie.surfer.at [213.47.90.191]) (Authenticated sender: stone@heisl.org) by donkey.heisl.org (Postfix) with ESMTPSA id 35FB5285474 for ; Mon, 18 Feb 2013 19:28:51 +0100 (CET) Message-ID: <512272D9.8090601@heisl.org> Date: Mon, 18 Feb 2013 19:28:41 +0100 From: Stone MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------070800030505000504000404" Subject: [dm-crypt] Device /dev/md2 is not a valid LUKS device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de This is a multi-part message in MIME format. --------------070800030505000504000404 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit hi guy's. i new in your mailing list and i have a problem with my setup. today my raid5 degraded totaly and i can fix it with a command to re-created /mdadm --create /dev/md2 --assume-clean --verbose --level=5 --raid-devices=4 /dev/sdc1 /dev/sdd1 missing /dev/sdf1/ After this i add my /dev/sde1 also to my /dev/md2 device. My problem is now the i cannot open my crypt device /cryptsetup luksOpen /dev/md2 md2_nas// //Device /dev/md2 is not a valid LUKS device./ Befor one year i has the device created with this command: /luksformat -t ext4 /dev/md0/ A dont have a backup of the header. Is the filesystem broken? /fsck /dev/md2// //fsck from util-linux 2.20.1// //e2fsck 1.42 (29-Nov-2011)// //fsck.ext2: Superblock invalid, trying backup blocks...// //fsck.ext2: Bad magic number in super-block while trying to open /dev/md2/ Is there a chance to get my data from the device? Thank you. --------------070800030505000504000404 Content-Type: text/html; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable hi guy's.

i new in your mailing list and i have a problem with my setup.

today my raid5 degraded totaly and i can fix it with a command to re-created
mdadm --create /dev/md2 --assume-clean --verbose --level=3D5 --raid-devices=3D4 /dev/sdc1 /dev/sdd1 missing /dev/sdf1
After this i add my /dev/sde1 also to my /dev/md2 device.

My problem is now the i cannot open my crypt device
cryptsetup luksOpen /dev/md2 md2_nas
Device /dev/md2 is not a valid LUKS device.

Befor one year i has the device created with this command:
luksformat -t ext4 /dev/md0

A dont have a backup of the header.

Is the filesystem broken?
fsck /dev/md2
fsck from util-linux 2.20.1
e2fsck 1.42 (29-Nov-2011)
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/md2

Is there a chance to get my data from the device?

Thank you.



=A0
--------------070800030505000504000404-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cPR2-e1Mv2-6 for ; Mon, 18 Feb 2013 21:13:39 +0100 (CET) Received: from v4.tansi.org (ns.km33513-03.keymachine.de [87.118.94.3]) by mail.saout.de (Postfix) with ESMTP for ; Mon, 18 Feb 2013 21:13:39 +0100 (CET) Received: from gatewagner.dyndns.org (84-74-164-49.dclient.hispeed.ch [84.74.164.49]) by v4.tansi.org (Postfix) with ESMTPA id DE6CF1404001 for ; Mon, 18 Feb 2013 21:13:38 +0100 (CET) Date: Mon, 18 Feb 2013 21:13:38 +0100 From: Arno Wagner Message-ID: <20130218201338.GA19576@tansi.org> References: <512272D9.8090601@heisl.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <512272D9.8090601@heisl.org> Subject: Re: [dm-crypt] Device /dev/md2 is not a valid LUKS device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On Mon, Feb 18, 2013 at 07:28:41PM +0100, Stone wrote: > hi guy's. > > i new in your mailing list and i have a problem with my setup. > > today my raid5 degraded totaly and i can fix it with a command to re-created > /mdadm --create /dev/md2 --assume-clean --verbose --level=5 > --raid-devices=4 /dev/sdc1 /dev/sdd1 missing /dev/sdf1/ > After this i add my /dev/sde1 also to my /dev/md2 device. Arggghhh, never, ever create a new RAID on top of the components when trying to recover one! Unless you have exactly the same parameters and same component order (and possibly same mdadm version), this does not work, but will destroy data. You have now completely wiped the old RAID metadata and potentially wiped the LUKS header and/or keyslot-area. The right way to do this is to 1) Make a complete backups (binary) of the RAID components 2) force assembly (not creation) with the components present at the end and the component that fell out of the RAID last. That ususlly gives you a complete or almost complete recovery. Also, why did the RAID degrade? > My problem is now the i cannot open my crypt device > /cryptsetup luksOpen /dev/md2 md2_nas// > //Device /dev/md2 is not a valid LUKS device./ Several possible root-causes come to mind: - Wrong component order - Wrong spuperblock placement > Befor one year i has the device created with this command: > /luksformat -t ext4 /dev/md0/ Did you re-name from md0 to md2 at some time? > A dont have a backup of the header. > > Is the filesystem broken? > /fsck /dev/md2// > //fsck from util-linux 2.20.1// > //e2fsck 1.42 (29-Nov-2011)// > //fsck.ext2: Superblock invalid, trying backup blocks...// > //fsck.ext2: Bad magic number in super-block while trying to open /dev/md2/ > > Is there a chance to get my data from the device? Well, maybe. If the medatata-placement did not destroy the header and key-slot area, then you can in theory reconstruct the data that the adding of sde1 overwrote. Basically, some areas of sde1 will now hold plain data while the raid controller thinks it is parity and some areas will be the other way round. Some areas may even be fine. If this were non-encrypted, you could use some commercial raid recovery software, but with encrypted data it has nothing to latch onto to guess the right geometry. Basically, you would have to manually reconstruct first the LUKS header and key-slot and then guess the original RAID geometry. You cannot even decrypt the components individually, as you need to correct sector numbers for decryption to work. I would say the effort is very likely not worth it. Arno -- Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: arno@wagner.name GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718 ---- One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision. -- Bertrand Russell