[PVE-User] Empty virtual disk
Ronny Aasen
ronny+pve-user at aasen.cx
Mon Sep 16 12:27:16 CEST 2019
On 15.09.2019 22:55, Joe Garvey wrote:
> Hello all,
>
> I had to reboot a QEMU based VM yesterday and after rebooting it reported there was no boot disk. The disk has lost all content in the hard drive. There aren't even any partition. I booted the VM with acronis disk recovery and it showed the disk as uninitialized.
>
> I restored a 6 day old VM and it also had an empty drive. All backups have no data in the drive and are marked as uninitialized.
>
> I tested restoring other VM's in my environment and they have no issues with the disks.
>
> The only difference I see is that the drives are smaller.
>
> The VM in question has been running flawlessly since it was deployed over 30 days ago.
>
>
> Proxmox version: 5.4-2
> SCSI controller: VirtIO SCSI
> Disk Size: 200G
> Caching is Disabled
> Storage: Dell NAS server via iSCSI 4x10GB connections (never had a problem with this)
>
> I'm guessing the data is gone but a ny ideas what has caused this?
>
> Regards,
> Joe
>
>
> _______________________________________________
> pve-user mailing list
> pve-user at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-user
>
that is a tricky one, wild speculations followes:
first of all: Do not write more data to unallocated blocks on the disk.
you may be able to recover the lost qcow2 image using testdisk.
a wild guess is that someone sometime ago did an accidental rm -rf
/path/to/qemu-images
this deleted all qemu images. but they are not really gone before the
last process holding the image open closes.
so when the vm was shutdown and restarted qemu closed the file and it
was removed and an empty file was created when qemu started again.
you can look for deleted but still active files with
find /proc/*/fd -ls | grep '(deleted)'
basically all these files will be deleted if the process there stops.
you can try and copy the running vm images with
cp proc/1722/fd/ /somewhere-not-on-same-disk
this would make inconsistent copies that you can try to fix with
qemu-img check /somewhere-not-on-same-disk
after that i would try to do a disk move of the running vm.
that may or may not fail. and perhaps crash the vm. (and loose the disk
file) but if it works it would probably make a consistent copy, that
would be better then the inconsistent manual copy.
regarding your first lost disk image, i would try with testdisk to try
to recover the lost qcow2 image.
I would focus on the current running vm's first. And i would copy the
orginal disk to a different host for running testdisk on it. something
like :
dd_rescue /dev/qcow2_disk - | ssh user at some-host "cat - >
/large/storage/recovery-file.dump"
then run testdisk on that image file trying to recover the cow file.
good luck
Ronny Aasen
More information about the pve-user
mailing list