[SOLVED] Restore VM from separate disk after OS disk failure

avdol

New Member
Mar 6, 2021
11
1
3
30
Hi,

My proxmox setup involves installation of the OS on 1 120gb ssd and the VM stored on a separate larger 256gb SSD.
The 120gb disk failed but the 256gb is still intact. I have installed proxmox on a new 120gb ssd however I am struggling to gain access to the VM on the 256gb SSD.

For clarity please see below. nvme0n1 is a new nvme ssd that i wish to use as vm storage. I have called it vmdatastore.
sda is the old 2.5" sata sdd which has the vm data i wish to copy to the new nvme ssd.
I have created a new vm 100 on nvme0n1 to match that of sda, however I do not know how to proceed.

Note I have tried using the qm rescan command in shell to try and bring up the "unused harddrive" option within the hardware option of the vm but it didn't work.

1623882508018.png
 
Last edited:

Stefan_R

Proxmox Staff Member
Staff member
Jun 4, 2019
1,135
226
68
Vienna
Please post your storage config ('/etc/pve/storage.cfg'). It seems like you're using LVM and your old pool had a different name - try adding the LVM pool "vmmachines" to your current PVE setup under "Datacenter" -> "Storage".

Alternatively, if you're just trying to copy over the data anyway, just create a new disk with the same capacity (as you seem to have done with VMID 100) and 'dd' the data over, i.e.:
Code:
dd if=/dev/mapper/vmmachines-vm--100--disk--0 of=/dev/mapper/vmdatastore-vm--100--disk--0 status=progress bs=1M
Then your new disk will have the same content as the old one and your VM should boot.
 

avdol

New Member
Mar 6, 2021
11
1
3
30
Please post your storage config ('/etc/pve/storage.cfg'). It seems like you're using LVM and your old pool had a different name - try adding the LVM pool "vmmachines" to your current PVE setup under "Datacenter" -> "Storage".

Alternatively, if you're just trying to copy over the data anyway, just create a new disk with the same capacity (as you seem to have done with VMID 100) and 'dd' the data over, i.e.:
Code:
dd if=/dev/mapper/vmmachines-vm--100--disk--0 of=/dev/mapper/vmdatastore-vm--100--disk--0 status=progress bs=1M
Then your new disk will have the same content as the old one and your VM should boot.
Hi,

I used the following command from another.
dd if=/dev/volY/dopefish of=image.raw

The above code worked for VM100 but it seems like I'm out of space to do the same for the remaining vms. How do i locate image.raw and delete?
I intend on using the command you recommended above once i delete the image.raw
 
Last edited:

avdol

New Member
Mar 6, 2021
11
1
3
30
Hi,

I used the following command from another.
dd if=/dev/volY/dopefish of=image.raw

The above code worked for VM100 but it seems like I'm out of space to do the same for the remaining vms. How do i locate image.raw and delete?
I intend on using the command you recommended above once i delete the image.raw

Found it, it's located my Home directory.
 
Last edited:

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 your own in 60 seconds.

Buy now!