I have two disks as RAID-1 encrypted via LUKS:
# blkid
...
/dev/md0: UUID="x-x-x-x-x" TYPE="crypto_LUKS"
Accidently I executed cryptsetup luksFormat /dev/md0 instead of cryptsetup luksOpen /dev/md0 secure. luksFormat returned WARNING: Device /dev/md0 already contains a 'crypto_LUKS' superblock signature.
Now I cant use open anymore, the following lines provide more information:
# cryptsetup luksOpen /dev/md0 secure
Device /dev/md0 is not a valid LUKS device.
# cryptsetup luksDump /dev/md0
Device /dev/md0 is not a valid LUKS device.
# hexdump -C /dev/md0 | grep LUKS
00000000 4c 55 4b 53 ba be 00 02 00 00 00 00 00 00 40 00 |LUKS..........@.|
hexdump: /dev/md0: Input/output error
Is there anything I can do, to get my data?
ACCEPTED]
From man cryptsetup (section luksFormat):
WARNING: Doing a luksFormat on an existing LUKS container will make all data of the old container permanently irretrievable, unless you have a header backup.
I guess you don't have a header backup and therefore your data will be history.
Sorry for the bad news.
Nevertheless, the hexdump: /dev/md0: Input/output error indicates a problem with one of your drives!!
dmesg shows many messages like Buffer I/O error on dev md0, logical block 64, async page read. - user1753343