Mount old pve data disk

ericpardee

Member
Jul 27, 2021
6
0
6
45
Started using Proxmox VE, noticed that my hard disk was a bit slow and decided to replace with SSD.

I installed Proxmox on the new SSD and all is working but I would like to access the data (view the old configs, etc.) from the prior pve disk.

Both disks are using LVM. While this is similar to this post, I'm not using ZFS, using ext4.

During the install process, the installer picked up the old HDD LVM and asked if I wanted to rename the PV, which I did to pve-OLD-5F42099C

When I attempt to mount the data logical volume of the old disk, I get this:
Code:
root@zeusprox01:~# mount /dev/pve-OLD-5F42099C/data /mnt/pve-OLD/data
mount: /mnt/pve-OLD/data: special device /dev/pve-OLD-5F42099C/data does not exist.

Looking in /dev/pve-OLD-5F42099C/
Code:
root@zeusprox01:~# ls /dev/pve-OLD-5F42099C/
base-103-disk-0  data_meta0  root  swap  vm-102-disk-0    vm-102-disk-1  vm-105-disk-0  vm-105-state-suspend-2021-07-22

Looking at my old data LV
Code:
root@zeusprox01:~# lvdisplay pve-OLD-5F42099C/data
--- Logical volume ---
  LV Name                data
  VG Name                pve-OLD-5F42099C
  LV UUID                NXlZ1p-khml-yzJg-ueW5-VMCF-34qd-AZlT3a
  LV Write Access        read/write (activated read only)
  LV Creation host, time proxmox, 2021-07-21 19:46:37 -0700
  LV Pool metadata       data_tmeta
  LV Pool data           data_tdata
  LV Status              available
  # open                 0
  LV Size                <794.79 GiB
  Allocated pool data    11.47%
  Allocated metadata     0.85%
  Current LE             203466
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:10

storage.cfg
Code:
root@zeusprox01:~# cat /etc/pve/storage.cfg
dir: local
    path /var/lib/vz
    content iso,vztmpl,backup


lvmthin: local-lvm
    thinpool data
    vgname pve
    content rootdir,images


lvmthin: old-local-lvm
        thinpool data
        vgname pve-OLD-5F42099C
        content rootdir, images

Any help the community could provide on how to access this old data would be most appreciated.
Thank you!
 
Hi,
data is a thin pool and not a file system, so it cannot be mounted by itself. It does contain other logical volumes like vm-105-disk-0 and metadata for those. The logical volumes are the disks that were used by the VM, so they should contain file systems/partitions and the data you are looking for. Use e.g. fdisk -l /dev/pve-OLD-5F42099C/vm-105-disk-0 to check.

Instead of mounting those, you should also be able to just create a VM and attach the disk to it. Just create a VM with a matching ID and use qm rescan --vmid <ID>. If the ID is already in use by another VM, use lvrename to rename the logical volume first.
 
Thank you for the response.

Code:
root@zeusprox01:~# lvs
  LV                              VG               Attr       LSize    Pool Origin          Data%  Meta%  Move Log Cpy%Sync Convert
  datassd                         pve              twi-a-tz-- <794.79g                      0.00   0.24
  root                            pve              -wi-ao----   96.00g
  swap                            pve              -wi-ao----    8.00g
  base-100-disk-0                 pve-OLD-5F42099C Vri---tz-k  100.00g data
  base-100-disk-1                 pve-OLD-5F42099C Vri---tz-k    4.00m data
  base-101-disk-0                 pve-OLD-5F42099C Vri---tz-k   32.00g data
  base-103-disk-0                 pve-OLD-5F42099C Vwi-a-tz--  100.00g data                 16.74
  base-104-disk-0                 pve-OLD-5F42099C Vri---tz-k   32.00g data
  data                            pve-OLD-5F42099C twi-aotz-- <794.79g                      11.47  0.85
  data_meta0                      pve-OLD-5F42099C -wi-a-----    8.11g
  root                            pve-OLD-5F42099C -wi-a-----   96.00g
  swap                            pve-OLD-5F42099C -wi-a-----    8.00g
  vm-102-disk-0                   pve-OLD-5F42099C Vwi-a-tz--    4.00m data                 3.12
  vm-102-disk-1                   pve-OLD-5F42099C Vwi-a-tz--  100.00g data                 29.93
  vm-105-disk-0                   pve-OLD-5F42099C Vwi-a-tz--   32.00g data base-104-disk-0 36.72
  vm-105-state-suspend-2021-07-22 pve-OLD-5F42099C Vwi-a-tz--  <16.49g data                 0.00

I guess what I'm not understanding, where are all the configs from the original drive stored?

It makes sense that base-100* - base-104* are the old templates, vm-102 and vm-105 are the old VMs but where are things like /etc/pve/storage.cfg or /etc/pve/local/config.

I mounted root but etc/pve is empty

Thanks Fabian
 
Please have a look at var/lib/pve-cluster within the old root file system and see here for how to recover the file system from the database. Of course this should not be done on a system which is currently in production, and you should backup any newly created configuration from /etc/pve before replacing the file.
 
ohhhhhhhhh, I see. Thanks, I was able to query the sqlite db and see what I needed.

Thanks again Fabian!
 

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!