I frequently mirror and swap internal hard drives using an external USB/eSATA docking station. However, this creates a tricky issue when mounting on another Ubuntu machine.

During standard installation with LUKS + LVM encryption, Ubuntu names the root volume group ubuntu-vg. If you plug in a secondary drive where Ubuntu was also installed, LVM encounters a name conflict between the host’s volume group and the external disk’s volume group, preventing activation.

Problem Symptoms

When you connect the encrypted drive in a GUI environment, Ubuntu prompts for your LUKS passphrase. After entering it, the file manager fails to mount the volume because both disks share the ubuntu-vg volume group name.

Even though mounting fails, the unlock step succeeded in creating a device mapping. Running ls -la /dev/mapper/ will reveal a node like /dev/mapper/luks-xxxxxx.

Recovery Steps

  1. Verify the decrypted physical volume: Run pvdisplay and locate your external device mapping (e.g., /dev/mapper/luks-xxxxxx). Notice that both the host and external drive share the same VG Name.

  2. Retrieve the volume group UUID: Run:

    sudo pvs -o +vg_uuid
    

    The VG UUID is displayed in the rightmost column (a series of dash-delimited alphanumeric characters). Copy the UUID that corresponds to your external disk’s LUKS mapper device. Be careful not to confuse it with your host drive’s UUID!

  3. Rename the conflicting volume group: Rename the external volume group using its UUID:

    sudo vgrename <EXTERNAL_VG_UUID> oldhd
    

    (You can replace oldhd with any unique name of your choice).

  4. Activate the volume group: Activate all logical volumes in the newly renamed group:

    sudo vgchange -a y
    
  5. Create a mount point:

    sudo mkdir -p /mnt/oldhd
    
  6. Mount the logical volume:

    sudo mount /dev/oldhd/root /mnt/oldhd
    
  7. Access your files: You can now navigate into /mnt/oldhd to browse and recover all your data!


Reference: Reddit /r/Ubuntu: Recover LUKS Encrypted LV Group