Recover VM

eleasar

Member
Jul 24, 2022
3
0
6
Hi,

I had a home server running with Proxmox and the server died. I bought a new server and would like to migrate one of the existing virtual machines over (the rest I can just recreate). I mounted the old disk via USB and I tried to find my way around but found out (I think) that the VM is not stored in some file but differently. Using `vgchange -ay pve-old` I renamed the old disk and can see the following via `lvdisplay` (among others) - I would like to restore that 132 one to the new proxmox installation. Could you please point me into the right direction?

Code:
  --- Logical volume ---
  LV Path                /dev/pve-old/vm-132-disk-0
  LV Name                vm-132-disk-0
  VG Name                pve-old
  LV UUID                1SB2N6-Eprf-LMZs-tg0J-fnMQ-wayh-J3FZKN
  LV Write Access        read/write
  LV Creation host, time pve, 2022-07-26 00:17:06 +0200
  LV Pool name           data
  LV Status              available
  # open                 0
  LV Size                4.00 MiB
  Mapped size            14.06%
  Current LE             1
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:13
  
  --- Logical volume ---
  LV Path                /dev/pve-old/vm-132-disk-1
  LV Name                vm-132-disk-1
  VG Name                pve-old
  LV UUID                9NSb2m-mOPS-UOUz-CCSR-FW7l-0StP-VeBefq
  LV Write Access        read/write
  LV Creation host, time pve, 2022-07-26 00:22:01 +0200
  LV Pool name           data
  LV Status              available
  # open                 0
  LV Size                32.00 GiB
  Mapped size            74.81%
  Current LE             8192
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:14
 
that is an LV, which when activated, is just a regular block device, and you can use a tool like "dd" or "qemu-img" to copy its contents.
 
  • Like
Reactions: eleasar
Thanks for your fast answers! Sadly I only have a very old backup from right after the setup (yes... lessons learned now...). Actually just looked in the wrong location - was stored on the other disk

Thanks for the hint on dd/qemu-img - will look into that!
 
Last edited:
just make sure to copy in the right direction (using the LV /dev/pve-old/vm-123-disk-X as input, and your target file as output, not the other way round ;))
 
  • Like
Reactions: eleasar
Update: thanks for your help! The "dd" approach worked but somehow homeassistent did not start correctly anymore. But I also found my backup - the regular backup was stored in a different folder from what I remembered. So lessens learned to not just do the backup (which I did) but also note down the location...
 
and test restores, yes ;)