← Back to Dashboard

Importing & Renaming Cloned Volume Groups (LVM)

This guide outlines the process for mounting an external or snapshotted disk that contains an LVM Volume Group (VG) with the same name or UUID as an existing one.

1. Identify the External Physical Volume

Before importing, you need to confirm which device contains the LVM metadata. Use pvscan to list all detected physical volumes.

sudo pvscan

Look for the device path (e.g., /dev/sdb1) associated with the "extra" Volume Group.

2. Import and Rename the Volume Group

When you clone a disk, the VG name and UUID are identical to the source. vgimportclone fixes this by changing the UUIDs and allowing you to assign a new name automatically.

sudo vgimportclone /dev/sdb1
Note: By default, this command often renames the VG to [original_name]-repaired or adds a numerical suffix to avoid conflicts with your boot drive.

3. Rescan and Activate the VG

Refresh the LVM system cache and bring the "new" Volume Group online.

Rescan Metadata

sudo vgscan

Activate the Volume Group

sudo vgchange -ay

4. Verify and Mount

Identify the specific Logical Volume (LV) you wish to mount from the newly imported group.

sudo lvs
# Create mount point and attach
sudo mkdir -p /mnt/external_data
sudo mount /dev/mapper/ubuntu--vg1-root /mnt/external_data

Summary Checklist

Step Command Purpose
Find sudo pvscan Locate the disk partition.
Rename sudo vgimportclone [device] Solve UUID/Name conflicts.
Refresh sudo vgscan Re-index LVM metadata.
Enable sudo vgchange -ay Make volumes accessible.
Mount sudo mount [path] [target] Access the actual files.