[libvirt-users] "Allocate entire disk now" with an existing virtual disk

Boylan, Ross Ross.Boylan at ucsf.edu
Thu Nov 19 00:09:51 UTC 2015


Have I just overwritten some of my virtual drive, and if so, is there a way to recover?

On a linux host I use LVM logical volumes as the backing for my virtual disks.  Using the Virtual Machine Manager 0.9.1 GUI I did this:
1. select source machine, go into details, select virtual disk and removed the hardware.
2. select destination machine, go into details, add storage.
3. click "select managed or other existing storage"
4. click the browser button under it, and select the volume detached from the source machine
5. set device type to virtio.
6. click finish.
Both VM's were off, and the source VM used virtio also.  KVM is the hypervisor.
There were actually 2 drives, and so I repeated the steps above twice, except that the second time I clicked on "Allocate entire disk now", which deselected it (I hope) before step 6.  The destination machine already had disks.

So, did I just overwrite one of the disks?  If so, is there a way to recover?

The reason I suspect a problem is that, although the partition tables appear intact on both virtual drives, the filesystem does not.  Within the virtual machine 1 partition from each drive is combined in a volume group.  The main logical volume group on that fails to mount:
root at jessie01:~# mount -o ro /dev/markov02/root /mnt/markov02
mount: wrong fs type, bad option, bad superblock on /dev/mapper/markov02-root,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
and e2fsck says
root at jessie01:~# e2fsck /dev/markov02/root
e2fsck 1.42.12 (29-Aug-2014)
/dev/markov02/root: recovering journal
Superblock needs_recovery flag is clear, but journal has data.

It's possible this has nothing to do with the option to allocate the entire disk, since the source VM was having problems anyway (that's why I moved the disks).  However, I'm pretty sure I was able to access the filesystem both in the source VM and in an earlier round when I move the disks to the destination.

Thanks.
Ross Boylan




More information about the libvirt-users mailing list