Need to attach LVM from deleted VM to new VM

DanBob

New Member
Apr 25, 2019
2
0
1
63
Hello all,

I had a single Ubuntu VM running under PM 5.4.3 with 15 Million small files on an LVM volume formatted as ext4. Everything was fine until I installed new NVidia drivers for the GTX 1060 running in PCI pass through when the process hung. When I rebooted the Ubuntu instance was stuck at the >grub loader.

Being foolish I deleted the VM rather than trying to repair or reinstall Ubuntu in that same VM. This was from thinking that I could easily attach the LVM volume to a new VM. I can see the LVM disk under the node but I can't add it to the VM under "Add>Hardware>>Disk. IT only allows me to add the small space not used by the existing LVM.

I was able to edit the vim<id>.conf file to make the disk available in the VM (https://pve.proxmox.com/wiki/Physical_disk_to_kvm) but it is not mountable. The warning is that y it "has a valid LVM signature" and to "be careful to use wipefs to avoid conflicts" or something of that nature.

I have a backup of the data but it will take a long time to copy. I want to avoid having to start over and add the drive again using " Add a new physical hard drive to Proxmox VE 4x 5x"

Thanks for helping this newb out if you can.
 
Last edited:
I assume you created your Ubuntu VM the normal way and therefore a new volume was created on your standard Proxmox installation. This volume got deleted when you deleted your VM, so I'm not sure what you are trying to do now. Passing the whole disk where your LVM-thin is located to your VM wont bring back your data, but you are a lucky one, because you have a backup.
 
Tim - thanks for your reply. I see now that I was not clear on the actual LVM volume that I was asking about!

I had attached a *second* data drive in addition to the Ubuntu OS VM that was lost; that is the one I was trying to gain access to. I was expecting to be able to mount the data drive after I rebuilt the Ubuntu VM.

The drive was seen in the LVM tab under the node but I could only add the small unused portion of it; never being able to attach the valid data that was still on the drive.

I have since then started over and add the drive again using " Add a new physical hard drive to Proxmox VE 4x 5x" and reformatted it under the Ubuntu VM. I was able to mount the backup and copied the data so I am OK now, but would enjoy knowing how I could retain the data and attach to another VM if needed. Seems like it should be easy to do!

If not I expect that the best way to to deal with data portability is to make a backup so I will look into that. Any direction would be appreciated.
 

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!