Can't mount SSD due to duplicate VG Names

tinfoil-hat

Well-Known Member
Joined
Oct 24, 2021
Messages
695
Reaction score
419
Credits
4,753
Hi, I installed LMDE on a second SSD of mine. I tried to mount my old installation to copy my data to the new SSD, but since LMDE7 names it's LVM VGs all the same, I cannot open / mount my old installation. I am using Cryptsetup on both SSDs. Here's what I've done:

Code:
anon@navi ~> lsblk
NAME                                          MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
sda                                             8:0    0  7,3T  0 disk 
└─sda1                                          8:1    0  7,3T  0 part 
  └─luks-a0d47b69-155f-4b95-b17a-606f237a16b2 254:3    0  7,3T  0 crypt /mnt/8TB-int
nvme0n1                                       259:0    0  1,9T  0 disk 
├─nvme0n1p1                                   259:1    0  286M  0 part 
├─nvme0n1p2                                   259:2    0  977M  0 part 
└─nvme0n1p3                                   259:3    0  1,9T  0 part 
nvme1n1                                       259:4    0  1,8T  0 disk 
├─nvme1n1p1                                   259:5    0  286M  0 part  /boot/efi
├─nvme1n1p2                                   259:6    0  977M  0 part  /boot
└─nvme1n1p3                                   259:7    0  1,8T  0 part 
  └─lvmlmde                                   254:0    0  1,8T  0 crypt
    ├─lvmlmde-root                            254:1    0  1,8T  0 lvm   /
    └─lvmlmde-swap                            254:2    0 62,7G  0 lvm   [SWAP]

Code:
anon@navi ~> sudo mount /dev/mapper/ssd /media/anon/ssd/
mount: /media/anon/ssd: unknown filesystem type 'LVM2_member'.
       dmesg(1) may have more information after failed mount system call.
anon@navi ~ [32]> sudo pvscan
                  sudo vgscan
                  sudo lvscan
  WARNING: VG name lvmlmde is used by VGs LuM4W2-VVLk-zTcm-hCZz-gdxD-PYTA-C9y6JC and HlSkPZ-h3PR-mCa8-w6MG-3QZB-w8IT-F94Nar.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  PV /dev/mapper/ssd       VG lvmlmde   lvm2 [1,86 TiB / 1,00 GiB free]
  PV /dev/mapper/lvmlmde   VG lvmlmde   lvm2 [<1,82 TiB / 1,00 GiB free]
  Total: 2 [<3,68 TiB] / in use: 2 [<3,68 TiB] / in no VG: 0 [0   ]
  WARNING: VG name lvmlmde is used by VGs LuM4W2-VVLk-zTcm-hCZz-gdxD-PYTA-C9y6JC and HlSkPZ-h3PR-mCa8-w6MG-3QZB-w8IT-F94Nar.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  Found volume group "lvmlmde" using metadata type lvm2
  Found volume group "lvmlmde" using metadata type lvm2
  WARNING: VG name lvmlmde is used by VGs LuM4W2-VVLk-zTcm-hCZz-gdxD-PYTA-C9y6JC and HlSkPZ-h3PR-mCa8-w6MG-3QZB-w8IT-F94Nar.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  inactive          '/dev/lvmlmde/root' [<1,80 TiB] inherit
  inactive          '/dev/lvmlmde/swap' [<62,66 GiB] inherit
  ACTIVE            '/dev/lvmlmde/root' [<1,76 TiB] inherit
  ACTIVE            '/dev/lvmlmde/swap' [<62,66 GiB] inherit
 


Classic LMDE duplicate VG name collision. The fix is to rename the old VG by UUID before activating it. Here's the procedure.

  1. Identify which UUID belongs to which VG
Code:
sudo vgs --noheadings -o vg_name,vg_uuid

You'll see two entries both named lvmlmde with different UUIDs. Cross-reference with pvs to figure out which UUID is on /dev/mapper/ssd (your old drive):

Code:
sudo pvs -o pv_name,vg_uuid

  1. Rename the old VG using its UUID
Code:
sudo vgrename <OLD_UUID> lvmlmde_old

Replace <OLD_UUID> with the UUID from the old drive, formatted like LuM4W2-VVLk-zTcm-hCZz-gdxD-PYTA-C9y6JC (whichever belongs to /dev/mapper/ssd). Full example:

Code:
sudo vgrename LuM4W2-VVLk-zTcm-hCZz-gdxD-PYTA-C9y6JC lvmlmde_old

  1. Activate the renamed VG
Code:
sudo vgchange -ay lvmlmde_old

  1. Mount the old root LV
Code:
sudo mkdir -p /mnt/old_root
Code:
sudo mount /dev/lvmlmde_old/root /mnt/old_root

A few notes:

Your lsblk shows nvme0n1p3 has no LUKS mapping yet. You will need to cryptsetup luksOpen that partition first and map it to something like "ssd" before the LVM steps above will work. Based on pvscan already seeing /dev/mapper/ssd, it looks like you already handled that, so you should be good.

After you are done copying data, you can leave the rename in place. It will not affect your running system since the active VG is the lvmlmde on nvme1n1.

If vgchange -ay activates both VGs, that is fine. Just be careful to only mount from lvmlmde_old.

The UUID-based vgrename is the cleanest approach here since it sidesteps any ambiguity about which VG you are touching.
 
Thanks a lot! I just booted into a live media and copied the most important files to my 8TB drive. I'll definetly have a look at your howto and report back, thank you!
 


Follow Linux.org

Staff online

Members online


Top