baumi's blog

baumi's personal blog … Linux, OS X, Windows, Random things, …

Elementary OS: properly mounting an encrypted clonezilla/dd backup with LUKS + LVM (changing identical UUIDs)

During extensive configuration of my new system i did a f***up and ended up having a system that doesn’t boot but holding all data, and luckily – i’ve had a several days old bootable system (without the most recent data). So i ended up restoring the bootable system and then trying to mount the 1:1 clone (dd/clonezilla) of the broken system that holds all recent data. So here is how i solved it. I’m NOT claiming this is the best/nicest/cleanest/preferred way of doing it. It just works for me + solved my problem.

This is my system after booting and the BACKUP connected via USB to /dev/sdb:

Because of the 1:1 clone (dd/clonezilla) the UUID are equal:

So when i tried mounting the LUKS on /dev/sdb5, this is what happened:

That sucks. Obviously mounting the backup will mask my booted root system. But that makes sense. I assume this is happening because the UUID is fixed to sda5_crypt in /etc/crypttab:

Besides the UUIDs being equal, the LVM volumegroup inside the LUKS will also be identical (elementary-vg). But lets first change the UUID of our encrypted backup disk LUKS partition:

Now we have changed the 2 at the end of UUID for /dev/sdb5 into a 3. It won’t be masking our / system. However, the volume group names are still identical.

To solve the problem i’ve bootet up a GParted Live system from a USB stick, mounted the encrypted LUKS and renamed the volumegroup name. I’ve also assigned new UUIDs to both physical and logical volume.

1) Boot Gparted LIVE USB System
2) Enter shell, then lets mount the LUKS on /dev/sdb5 (sda5 = system disk, sdc = usb stick, sdb = USB backup disk):

Then reboot the system and … finally:

Comments are currently closed.