I inherited a CentOS 7 vm with a messy disk system. Here's a breakdown:
The VM has 2 hard disks, and the OS has two LVs with luks-encryption on top. Output from
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 40G 0 disk ├─sda1 8:1 0 500M 0 part /boot ├─sda2 8:2 0 29.5G 0 part │ └─luks-05ef98b8-5161-4ca1-917e-8637bf8f0000 253:0 0 29.5G 0 crypt │ ├─swap 253:1 0 3G 0 lvm [SWAP] │ └─root 253:2 0 76.5G 0 lvm / └─sda3 8:3 0 10G 0 part └─root 253:2 0 76.5G 0 lvm / sdb 8:16 0 40G 0 disk ├─sdb1 8:17 0 10G 0 part │ └─root 253:2 0 76.5G 0 lvm / └─sdb2 8:18 0 30G 0 part └─root 253:2 0 76.5G 0 lvm /
and lvm devices:
# ls /dev/mapper/ control luks-05ef98b8-5161-4ca1-917e-8637bf8f0000 root swap
My goal just is to effectively remove the luks encryption. It's the older LUKS1, so it's not able to decrypt while online. So far, I have been trying to copy all the data to a new drive, and boot to that instead:
- Add a new drive to the VM with enough space to hold everything (labeled
copy everything to the drive:
# dd if=/dev/mapper/root of=/dev/sdc conv=noerror,sync
This gets me a simple, unencrypted copy of my system, but I'm not sure how to get it booted from here. I can't just make a new
/boot partition and copy the old one to it since all the lvm and luks-encryption configurations still live in grub for example. What is the easiest way to basically slide my OS out of the encryption? What kind of tools can make this easier?
Starting fresh with a new OS isn't an option for me.