Access VMs on old Proxmox disk

RafaelT

New Member
Jul 13, 2021
17
1
3
39
I did a fresh proxmox install on a new ssd.
On installation it recognizes that there was a vg "pve" on an old hard disc and asked me to rename it to "pve--OLD..." , so I did.
The new Proxmox Server comes up, and I see that it somehow recognizes both hard disks.

proxmox_lvm.png

But it doesn't show any of my old vm's in the new installation.
It was mentioned that I should crreate a new vg but it just says there is no empty hard drive for it.

This is what it shows me in the console:
Code:
root@pve:~# lvs
  LV                         VG               Attr       LSize    Pool Origin        Data%  Meta%  Move Log Cpy%Sync Convert
  data                       pve              twi-a-tz-- <794.79g                    0.00   0.24                            
  root                       pve              -wi-ao----   96.00g                                                           
  swap                       pve              -wi-ao----    8.00g                                                           
  data                       pve-OLD-1ED18B1F twi-aotz--    1.67t                    4.28   0.37                            
  root                       pve-OLD-1ED18B1F -wi-a-----   96.00g                                                           
  snap_vm-102-disk-0_working pve-OLD-1ED18B1F Vri---tz-k  500.00g data vm-102-disk-0                                        
  swap                       pve-OLD-1ED18B1F -wi-a-----    8.00g                                                           
  vm-100-disk-0              pve-OLD-1ED18B1F Vwi-a-tz--   20.00g data               16.82                                  
  vm-102-disk-0              pve-OLD-1ED18B1F Vwi-a-tz--  500.00g data               13.18                                  
  vm-102-state-working       pve-OLD-1ED18B1F Vwi-a-tz--  <16.50g data               5.66                                   
  vm-200-disk-0              pve-OLD-1ED18B1F Vwi-a-tz--   10.00g data               7.82                                   
  vm-201-disk-0              pve-OLD-1ED18B1F Vwi-a-tz--   50.00g data               4.12

Code:
root@pve:~# lsblk
NAME                                               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                                                  8:0    0   1.8T  0 disk 
├─sda1                                               8:1    0  1007K  0 part 
├─sda2                                               8:2    0   512M  0 part 
└─sda3                                               8:3    0   1.8T  0 part 
  ├─pve--OLD--1ED18B1F-swap                        253:0    0     8G  0 lvm  
  ├─pve--OLD--1ED18B1F-root                        253:1    0    96G  0 lvm  
  ├─pve--OLD--1ED18B1F-data_tmeta                  253:2    0  15.8G  0 lvm  
  │ └─pve--OLD--1ED18B1F-data-tpool                253:4    0   1.7T  0 lvm  
  │   ├─pve--OLD--1ED18B1F-data                    253:5    0   1.7T  1 lvm  
  │   ├─pve--OLD--1ED18B1F-vm--100--disk--0        253:6    0    20G  0 lvm  
  │   ├─pve--OLD--1ED18B1F-vm--200--disk--0        253:7    0    10G  0 lvm  
  │   ├─pve--OLD--1ED18B1F-vm--201--disk--0        253:8    0    50G  0 lvm  
  │   ├─pve--OLD--1ED18B1F-vm--102--disk--0        253:9    0   500G  0 lvm  
  │   └─pve--OLD--1ED18B1F-vm--102--state--working 253:10   0  16.5G  0 lvm  
  └─pve--OLD--1ED18B1F-data_tdata                  253:3    0   1.7T  0 lvm  
    └─pve--OLD--1ED18B1F-data-tpool                253:4    0   1.7T  0 lvm  
      ├─pve--OLD--1ED18B1F-data                    253:5    0   1.7T  1 lvm  
      ├─pve--OLD--1ED18B1F-vm--100--disk--0        253:6    0    20G  0 lvm  
      ├─pve--OLD--1ED18B1F-vm--200--disk--0        253:7    0    10G  0 lvm  
      ├─pve--OLD--1ED18B1F-vm--201--disk--0        253:8    0    50G  0 lvm  
      ├─pve--OLD--1ED18B1F-vm--102--disk--0        253:9    0   500G  0 lvm  
      └─pve--OLD--1ED18B1F-vm--102--state--working 253:10   0  16.5G  0 lvm  
nvme0n1                                            259:0    0 931.5G  0 disk 
├─nvme0n1p1                                        259:1    0  1007K  0 part 
├─nvme0n1p2                                        259:2    0   512M  0 part 
└─nvme0n1p3                                        259:3    0   931G  0 part 
  ├─pve-swap                                       253:11   0     8G  0 lvm  [SWAP]
  ├─pve-root                                       253:12   0    96G  0 lvm  /
  ├─pve-data_tmeta                                 253:13   0   8.1G  0 lvm  
  │ └─pve-data                                     253:15   0 794.8G  0 lvm  
  └─pve-data_tdata                                 253:14   0 794.8G  0 lvm  
    └─pve-data                                     253:15   0 794.8G  0 lvm

I'm also not able to mount any disk as I tried:

Code:
root@pve:~# mount /dev/mapper/pve--OLD--1ED18B1F-vm--102--disk--0 /mnt/vm102-tpool/
mount: /mnt/vm102-tpool: wrong fs type, bad option, bad superblock on /dev/mapper/pve--OLD--1ED18B1F-vm--102--disk--0, missing codepage or helper program, or other error.

I also could not simply boot the old hard drive, as it seems to be tied to the vg name pve...

I am kinda lost and don't know what I should try next.
 
I guess I'm a step closer:

I managed to install a lvm via Datacenter->Storage and point it to the old disk.
new_lvm.png
I just still don't get how to use vm-102-disk-0 as a VM
 
I would be happy, if I would be able to just recover the files on my old disk.

I tried
Code:
root@pve:~# kpartx -avr /dev/mapper/pve--OLD--1ED18B1F-vm--102--disk--0
pve--OLD--1ED18B1F-vm--102--disk--0p1 : 0 409600 /dev/mapper/pve--OLD--1ED18B1F-vm--102--disk--0 2048
pve--OLD--1ED18B1F-vm--102--disk--0p2 : 0 1048164319 /dev/mapper/pve--OLD--1ED18B1F-vm--102--disk--0 411648

root@pve:~# cryptsetup luksOpen /dev/mapper/pve--OLD--1ED18B1F-vm--102--disk--0p2 luks
Enter passphrase for /dev/mapper/pve--OLD--1ED18B1F-vm--102--disk--0p2:
device-mapper: reload ioctl on luks (253:20) failed: Invalid argument
somehow the device-mapper fails.
Can anyone give me any hint on what to do?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!