I have 3 disks:
- Main OS (CentOS)
- HDD encrypted with LUKS for data (Hardware RAID10, LSI Logical Volume)
- Windows 10 (Recently installed for testing)
My problem is when I installed Windows 10, it broke my LUKS disk by creating a boot loader on it... Now I can't decrypt my disk and I really need my data.
Can I revert the process with Gparted or other tool ? I hope my data is not destroyed by that boot loader...
I really need help please !
EDIT 1 Added some information
fdisk -l
Disk /dev/sda: 12000.0 GB, 11999999164416 bytes, 23437498368 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x385dcf68
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 7 HPFS/NTFS/exFAT
After the answer of Xen2050 here is my result:
LANG=C grep -obUaP "\x4C\x55\x4B\x53\xBA\xBE" /dev/sda
164822601573:LUKS��
Then hope is returned!
I dd my header with block size of 1 bytes with that
dd if=/dev/sda of=luks_header bs=1 skip=164822601573 count=2097152
Now I have my luks header, I can confirm it start with LUKS with vi
LUKSº¾^@squashfs^@sqsh^@hsqs^@lvm2pv^@LVM2 001^@btrfs^@
Now the next step is to rewrite my luks header...
EDIT 2 Added developement
From this unix.stackexchange: https://unix.stackexchange.com/questions/177831/recovering-a-luks-partition
I found the start if my header
hexdump -s 164822601573 -C /dev/sda | grep LUKS
2660314f65 4c 55 4b 53 ba be 00 73 71 75 61 73 68 66 73 00 |LUKS...squashfs.|
Set up loop devices
losetup -o 0x2660314f65 -r -f /dev/sda
losetup -a
cryptsetup luksOpen /dev/loop0 luksrecover
But I have this message error message:
Unsupported LUKS version 115.
I think my header is corrupted... Here is the beginning of mine:
|LUKS...squashfs.|
|sqsh.hsqs.lvm2pv|
|.LVM2 001.btrfs.|
|_BHRfS_M.f2fs.. |
|...<device.</dev|
|ice>.PRI.TIME.DE|
|VNO.%s-XXXXXX.w.|
| PRI="%d".>%s</d|
|evice>.. %s="%s"|
|.%s.old.1.42.9.2|
|8-Dec-2013......|
|................|
*
|...............d|
|.... n;.0.&.A.v.|
|QkkXa.M<q.P ...D|
|.........a...d..|
|...x............|
|.............T..|
|..........@.....|
|.i@<device DEVNO|
|="0x%04lx" TIME=|
|"%ld"...........|
And here is a functional header
|LUKS....aes.....|
|................|
|........xts-plai|
|n64.............|
|........sha1....|
|................|
|............... |
|2x.l...r0....8|.|
|...'..[!D..J..tp|
|....?J...~.x"s.=|
|.?.....]981be66e|
|-a0b0-4daa-8a2c-|
|5a6e5d8ed3ae....|
|..q....ZG..}#..,|
|...w..!|..3..>.?|
|.;.&...-........|
|................|
|................|