Re: Accessing data on a xen guest disk image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Create a new VM using a naming convention different than you do in your other guests/VMs/domUs for the logical volumes. Since you are using VolGroup/LogVol, I suggest using VolGrp/LogVol... it really doesn't matter. You can call it Foo00/Bar00. People seem to overlook the fact you can name these anything you want (within reason). You can even name it just like you name the logical volume for every other VM you have in dom0, but label it something different when you install the domU. The label inside dom0 is just for dom0 to track it, you label it again when you install the VM so the VM can track it. Basically when you install a VM you have a logical volume label nested in another logical volume label. In fact, I do this sometimes on purpose. On dom0, I label a disk as VolGrp00/LogVol20, then when I install the VM I label it as xVolGrp00/LogVol20. Then I set up filters on dom0 (/etc/lvm/lvm.conf) to filter out the VM disks from dom0 seeing it. (r|^x|)

Once you have the new test or recovery or utility (whatever you want to call it) VM, then present the disk that you want to recover as the recovery VMs second disk. Again, the key is to make sure whatever you labelled your root disk inside the VM is different. e.g.


disk = ['phy:/dev/VolGrp00/LogVol21,sda,w', 'phy:/dev/VolGrp00/LogVol20,sdb,w' ]

so, LogVol20 is whatever the root disk is of the VM that you are trying to recover. LogVol21 is whatever the root disk is for your newly created VM that you are going to use for rescue. Again, you can slice off a logical volume in dom0 (lvcreate -L10G -n LogVol21 VolGrp00) but when you installed the VM, you format/label the disk inside the VM as something different (Foo00/Bar00, or VolGroup00/LogVolume00).

The disk you want to recover shows up as sdb, but you can also mount it based on the label of VolGrp00/LogVol20 because the label is there and not confused with the root disk of the recovery VM (Foo00/Bar00).

Then you just simply mount it to /media or /mnt or some other mount point you create to get data off it. Or you don't even have to mount it, you can just fsck it.

I've done this several times (more than I really care to remember) because of accidentally starting the same VM on 2 different cluster nodes. Imagine connecting the same disk to 2 different computers... hehe really messes things up good!

Happy Holidays!

Dennison Williams wrote:
Mark Nielsen wrote:
Let me ask this first: what is it exactly that you are trying to do? If
you are trying to mount a guest disk on dom0, why?

I am trying to recover the data located on my guest disk.  This guest
disk is a logical volume in dom0.  The guest disk and the dom0 disk are
managed by LVM each with the same naming convention
(VolGroup00/LogVol0[0-1]).

The times I've needed to access a VMs disk has been when something
terrible has happened to the VM and I've needed to mount the VMs disk so
I can recover information of try to fsck it. I do this by having a
stand-by VM that uses a different naming convention that my other VMs
use. This way I can use my test/rescue VM to mount up the other VMs
disks and fsck them, or recover data from them.

I am unclear about how I could access a LV on dom0 from a domU VM.  Can
you explain how this would be done?


--
Fedora-xen mailing list
Fedora-xen@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-xen

[Index of Archives]     [Fedora General]     [Fedora Music]     [Linux Kernel]     [Fedora Desktop]     [Fedora Directory]     [PAM]     [Big List of Linux Books]     [Gimp]     [Yosemite News]

  Powered by Linux