How to restore raw disk

bravo0916

Member
Jan 29, 2024
60
5
8
Hello team,

I upgraded to 9.0 version from scratch. Now, I am trying to restore all VM data, but all of them are raw data. I don't see any options to restore from raw files. The raw data is stored in LVM disk. I tried to create new VM with different ID and tried to import. But I got error like this.
Note: 103 is new VM and vm-107-disk-1 is raw disk that I want to restore. Do you have any ideas?

qm importdisk 103 vm-107-disk-1 data2
vm-107-disk-1: non-existent or non-regular file

Thank you very much for your support.

Regards,
 
Last edited:
Hello


You’re getting non-existent or non-regular file because qm importdisk only works with regular files (raw/qcow2). If your vm-107-disk-1 is an LVM volume, you need to re-add it as storage instead.


Quick steps:


  1. Check if it’s a file or LV:

    Code:
    ls -l vm-107-disk-1 || true
    file vm-107-disk-1  || true
    lvs | grep 107 || true

  2. If it’s a file (raw/qcow2):

    Code:
    qm importdisk 103 /full/path/vm-107-disk-1 data2 --format raw
    qm set 103 --scsi0 data2:vm-103-disk-0

  3. If it’s an LV (block device):

    Add the VG/thinpool back as storage in Proxmox (Datacenter ? Storage ? Add ? LVM/LVM-Thin).
    Optionally rename LV to match new VM ID:
    Code:
    lvrename <VG> vm-107-disk-1 vm-103-disk-0

    Then attach it:
    Code:
    qm set 103 --scsi0 data2:vm-103-disk-0


    That should bring the disk back under the new VM.

    And dont forget after the first step come back with the results dont run anything without checking in i might have made some misstakes. we are not perfect we are only humans :)
Edit:

you might want to look up Proxmox Backup Server ;) its made for stuff like this.
 
Last edited:
  • Like
Reactions: waltar and UdoB