Mounting LUKS with the help of a cloned drive?
I have cloned my LUKS-encrypted system drive to a bigger one, using dd. The big drive was working fine, until a possible power-failure caused it not to be mountable anymore:
Code:
root@xxx:/home/xxx# cryptsetup luksOpen /dev/sdc1 cheer The original disk (which I'm still using, and this was the source of cloning): Code:
Disk /dev/sda: 320.0 GB, 320072933376 bytes Code:
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes Code:
LUKS header information for /dev/sda1 Code:
LUKS header information for /dev/sdc1 |
As far as I can tell the LUKS tools don't directly support it. However, it is possible to manually clone the header from the old volume to the new one. Assuming the problem is header corruption (that's what it sounds like), that should fix it.
A LUKS volume starts with a 592-byte volume header, then an arbitrary-sized key material section, then the bulk data section (payload volume). The payload offset field of the volume header tells us what sector the bulk data section starts at. According to the luksDump output in your post, the payload offset is 2056 sectors. Thus, we need to clone the first 2056 sectors (the offset is zero-based so sector 2056 is the 2057th sector). The first dd command below will back up the new volume's header to '/root/luks-backup.bin', just in case. The second will clone the header from the old volume to the new. These need to be run as root, of course. Code:
dd if=/dev/sdc1 of=/root/luks-backup.bin bs=512 count=2056 |
All times are GMT -5. The time now is 12:50 PM. |