I’ve been using a Xen guest under RHEL 5.2 to hold this webserver, and because of failures, I choose to keep a copy of the full disk image on another machine.
Having to transfer the full disk in the network means stop the server (xen guest), rsync the image on disk (wait 40 minutes), then start guest again.
After doing the initial image transfer, it would be easier to just sync updated files, but… how to loop mount a full disk?
In my case, the hdd image contained a partition for
/boot and a partition for a LVM pv.
First, I needed to check Number of cylinders in virtual disk inside Xen Guest. Using fdisk I could check that number, for example, 777.
On the remote system, the one with the full image transferred previously I could then do:
1 2 3 4 5 6 7 8
In this case, as I want to access my LVM volume, so I need to convert the partition start to a size, so:
and then thanks to losetup:
1 2 3 4 5 6 7
and mount our drives doing
mount /dev/GUESTvg/LVMunit where desired ;)
At this point I can just run:
And get a ‘working’ copy of the remote machine but just copying changed elements.