Recover deleted qcow disk

pluteus

New Member
Sep 29, 2015
2
0
1
Hi!

I've deleted a disk from the wrong Virtual Machine, and deleted the unused disk afterwards, is there a way to recover this deleted unused disk?

Trying testdisk right now, maybe there's an easier way.

Thanks
Martin
 
I'd say the odds fair if the disk space hasn't been written over. Linux is no where near as friendly as windows for file recovery
 
Suffered the same disaster today...I originally wanted to delete the second hard disk of 105, but accidentally deleted the second of 106, which is still running...
I dont' know why Proxmox allow to delete hard disk while OS is still running, not the same behavior like in physical machine.
I found the Protection defaults to No in Options. Shouldn't it be Yes by default?
And I suggest to add an extra confirmation step like deleting vm, which need to input the vm id.
 
I dont' know why Proxmox allow to delete hard disk while OS is still running, not the same behavior like in physical machine.
And I suggest to add an extra confirmation step like deleting vm, which need to input the vm id.

What ancient version are you running?
I cannot delete a running machine and I have to put in the ID after the remove dialog (obviously after stopping the VM).
 
I cannot delete a running machine
I was deleting a hard drive of a running machine.
For example, win7 on scsi0(as C: drive), D drive on scsi1, D drive can be detached and removed while win7 is still running if the Protection option is "No", which is set default by PVE.
 
Suffered the same disaster today...I originally wanted to delete the second hard disk of 105, but accidentally deleted the second of 106, which is still running...
I dont' know why Proxmox allow to delete hard disk while OS is still running, not the same behavior like in physical machine.
I found the Protection defaults to No in Options. Shouldn't it be Yes by default?
And I suggest to add an extra confirmation step like deleting vm, which need to input the vm id.
KEEP THE VM RUNNING AND search the forum, I remember that as long as the VM is still running, the OS does not *really* (yet) delete the file qcow2! Keep the VM alive and find the post about it, there is some sort of trick AFAIR to "resurrect" it.
FOUND the thread: https://forum.proxmox.com/threads/deleted-image-of-running-vm.9258/
 
Last edited:
the OS does not *really* (yet) delete the file qcow2!

Actually, it is deleted. That's what delete means: removing the file entry in your filessystem. If you have the file open (in a process), you can access the file as the file entry on the filesystem is stored in a symbolic link and copy your data unless it is overwritten in the meantime.

As already stated: You cannot remove a disk from a running VM, not via the GUI.
 
As already stated: You cannot remove a disk from a running VM, not via the GUI.

Well, you can. I have just checked that using one of my CentOS guests. You can detach a device from a running guest, even while the volume is mounted. Its probably the equivalent of pulling a drive from it's drivebay on a hotpluggable system… I haven't checked, if any running traffic to that device would circumvent this, but even if that'd be the case, you should always keep in mind, that you can detach/remove a disk device from a running guest.
 
Well, you can. I have just checked that using one of my CentOS guests.
Yes, I've used to test ZFS with "hot unplug" event. In "Options" there is a HotPlug setting, maybe disk hotplug should be set to FALSE by default instead of true! If someone is willing to file a feature request... is welcomed :)
 
Well, that's the nature of defaults, isn't it - they never suit everyone. Actually, I am pretty content with the current set. To me, it's basically the same as walking up to my servers in the rack and checking twice, before pulling a drive from any server. The same applies to the "virtual" rack, I suppose.
 
Well, that's the nature of defaults, isn't it - they never suit everyone. Actually, I am pretty content with the current set. To me, it's basically the same as walking up to my servers in the rack and checking twice, before pulling a drive from any server. The same applies to the "virtual" rack, I suppose.
Be honest... how often plugging a hard disk from your VM is a good idea against a bad nightmare? Default behavior (and so related default option) is that no one removes disks on running PC/Servers/VM, doing so should be just a nice feature that you can enable if really needed.
 
@mmenaz if you want to disable disk hotplug, then disable disk hotplug? most people want disk hotplug, so it's enabled by default.
 
Well, you can. I have just checked that using one of my CentOS guests. You can detach a device from a running guest, even while the volume is mounted.

Okay, I tried with the boot device and that is not possible. My fault. Another disk can be hot unplugged.
 

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!