[SOLVED] Recovery after OS drive failure

m0rik

New Member
Dec 22, 2020
2
0
1
39
Hi there,

We have a Proxmox Server (v. 6.2-4), which hosts a few VMs and containers. Unfortunately, the server OS drive seems to be inaccessible after a power failure. We have replaced the OS drive and installed a new Proxmox environment (v 6.2-4) from scratch.

We've plugged in the old storage array, which contains the previous local-lvm (pve) where the old VMs and containers were installed. We can see the LVs come up, but I can't see a way to mount the disk for data retrieval or find a way to import them into Proxmox. Is this possible?

I've seen another post that mentioned adding it as storage, but it's already showing up in Datacenter\pve\Disks. I've also seen another forum that mentions copying the LVs, but I'm still researching that process.

I'll post the output of lvs.

Code:
LV            VG    Attr       LSize   Pool    Origin Data%  Meta%  Move Log Cpy%Sync Convert
vm-100-disk-0 ds001 Vwi-a-tz--   1.00t vm-data        39.36
vm-101-disk-0 ds001 Vwi-aotz--  19.53g vm-data        34.40
vm-102-disk-0 ds001 Vwi-a-tz--  20.00g vm-data        82.90
vm-103-disk-0 ds001 Vwi-a-tz-- 200.00g vm-data        0.00
vm-103-disk-1 ds001 Vwi-a-tz--  <1.27t vm-data        0.01
vm-103-disk-2 ds001 Vwi-a-tz--  <1.76t vm-data        0.01
vm-104-disk-0 ds001 Vwi-a-tz--  20.00g vm-data        100.00
vm-104-disk-1 ds001 Vwi-a-tz--   4.00t vm-data        0.00
vm-data       ds001 twi-aotz--   5.44t                8.01   4.72
data          pve   twi-a-tz--  <5.32g                0.00   1.57
root          pve   -wi-ao----   3.25g
swap          pve   -wi-ao----   1.62g
 

fiona

Proxmox Staff Member
Staff member
Aug 1, 2019
2,186
405
88
Hi,
you should be able to add the old thin pool vm-data with Datacenter > Storage > Add > LVM Thin and then PVE should see the VM images. Of course you'll have to recreate the VM configuration files or adapt the drive locations if you still have them.
 

m0rik

New Member
Dec 22, 2020
2
0
1
39
I appreciate guidance. It was very helpful! For anyone who has the same issue, here's a breakdown of my fix.

I created a dummy VM [ID: 105] in the new Proxmox install with similar specifications to the machine I was trying to restore and 4G dummy drive.

I renamed the LV for the old drive to use the ID for the new VM.

lvrename /dev/ds001/vm-100-disk-0 /dev/ds001/vm-105-disk-0

I edited the configuration file for the VM to use the old drive.

nano /etc/pve/qemu-server/105.conf

Added the following line to the file:

scsi1:ds001:vm-105-disk-0,size=1T

Changed the bootdisk:

bootdisk: scsi0 >> bootdisk: scsi1

And removed the dummy drive to keep things clean by going to 105 > Hardware, selecting the dummy disk, and clicking Detach. Then I went to the content page of the LV that the dummy drive was stored, local-lvm > Content in my case, selected the dummy disk, and clicked Remove. Be sure you've got the right disk selected, type the ID to confirm, and click Remove again.

The VM started up like a charm. Merry Christmas!
 
Last edited:

fiona

Proxmox Staff Member
Staff member
Aug 1, 2019
2,186
405
88
Hi,
for LXC, how to recover after boot disk failure ?
how exactly did the disk fail? Do you have a backup? Could you share the output of pveversion -v and pct start <ID> --debug?
 

haodk

New Member
Jul 4, 2021
3
0
1
25
Hi,

how exactly did the disk fail? Do you have a backup? Could you share the output of pveversion -v and pct start <ID> --debug?
Oh, It isn't happen to me now.
But I'm imaging in some day it happen and I don't have backup for this LXC.
LXC disk image is on another disk and still healthy, after reinstall proxmox OS how can I running this LXC.
 

fiona

Proxmox Staff Member
Staff member
Aug 1, 2019
2,186
405
88
Oh, It isn't happen to me now.
But I'm imaging in some day it happen and I don't have backup for this LXC.
LXC disk image is on another disk and still healthy, after reinstall proxmox OS how can I running this LXC.
It's essentially the same as @m0rik already described, with some minor differences:
  • No need to adapt bootdisk, edit rootfs to point to your old image.
  • The configuration is in /etc/pve/lxc rather than /etc/pve/qemu-server.
But I do recommend using a backup if the data is somehow important. And if you really can't, maybe just secure the configuration, so at least you don't need to recreate that.
 
  • Like
Reactions: haodk

haodk

New Member
Jul 4, 2021
3
0
1
25
It's essentially the same as @m0rik already described, with some minor differences:
  • No need to adapt bootdisk, edit rootfs to point to your old image.
  • The configuration is in /etc/pve/lxc rather than /etc/pve/qemu-server.
But I do recommend using a backup if the data is somehow important. And if you really can't, maybe just secure the configuration, so at least you don't need to recreate that.
thank you very much!
 

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!