Peter Peltonen
2007-Mar-10 23:05 UTC
[Xen-users] mount xen partitions inside logical volume from dom0?
I''ve installed a FC5 domU under RHEL5-beta2 dom0 with virt-manager. As the disk for domU I used: phy:/dev/mapper/VolGroup00-LogVol02,xvda,w In the domU I have partitions: /dev/xvda1 on / type ext3 (rw) /dev/xvda2 on /var type ext3 (rw) How do I access these partitions from dom0? For example if I take an LVM snapshot of LogVol02, how do I mount the / partition of the domU installed on the volume for backup purposes? Regards, Peter _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Mar-11 13:08 UTC
Re: [Xen-users] mount xen partitions inside logical volume from dom0?
Peter Peltonen wrote:> I''ve installed a FC5 domU under RHEL5-beta2 dom0 with virt-manager. > > As the disk for domU I used: > > phy:/dev/mapper/VolGroup00-LogVol02,xvda,w > > In the domU I have partitions: > > /dev/xvda1 on / type ext3 (rw) > /dev/xvda2 on /var type ext3 (rw) > > How do I access these partitions from dom0? For example if I take an > LVM snapshot of > LogVol02, how do I mount the / partition of the domU installed on the > volume for backup purposes?You use the "lomount" command, I believe. Type "lomount --help" to gain access to the partitions inside :/dev/mapper/VolGroup00-LogVol02. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Peter Peltonen
2007-Mar-11 15:35 UTC
Re: [Xen-users] mount xen partitions inside logical volume from dom0?
On 3/11/07, Nico Kadel-Garcia <nkadel@gmail.com> wrote:> You use the "lomount" command, I believe. Type "lomount --help" to gain > access to the partitions inside :/dev/mapper/VolGroup00-LogVol02.But I thought lomount can handle only disk images? At least that''s what the help says: # lomount -h Usage: lomount [-verbose] [OPTIONS] -diskimage FILE -partition NUM [OPTIONS] All OPTIONS are passed through to ''mount''. ex. lomount -t fs-type -diskimage hda.img -partition 1 /mnt And I am talking about partitions made by the FC6 Anaconda installer to the logical volume. After reading the RHEL5/FC6 Xen documentation through again I realised I must use kpartx: kpartx -av /dev/VolGroup00/LogVol02 and then I can mount the partition: mkdir /mnt/LogVol02p1 mount /dev/mapper/LogVol02p1 /mnt/LogVol02p1 Of course the domU must be shutdown to do this and one has to umount the partition before starting the domU again. But now I can do the following: - pause the virtual machine - take an lvm snapshot - unpause the virtual machine - mount the snapshot volume - backup the snapshot volume - delete the snapshot Now I''m just wondering what''s the best way to backup the snapshot... Cheers, Peter _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
jez
2007-Mar-12 03:06 UTC
Re: [Xen-users] mount xen partitions inside logical volume from dom0?
On Sun, Mar 11, 2007 at 05:35:38PM +0200, Peter Peltonen wrote:> On 3/11/07, Nico Kadel-Garcia <nkadel@gmail.com> wrote: > >You use the "lomount" command, I believe. Type "lomount --help" to gain > >access to the partitions inside :/dev/mapper/VolGroup00-LogVol02. > > But I thought lomount can handle only disk images? At least that''s > what the help says: > > # lomount -h > Usage: lomount [-verbose] [OPTIONS] -diskimage FILE -partition NUM [OPTIONS] > All OPTIONS are passed through to ''mount''. > ex. lomount -t fs-type -diskimage hda.img -partition 1 /mnt > > And I am talking about partitions made by the FC6 Anaconda installer > to the logical > volume. >Are these like magical partitions - unlike say the terribly normal ones you get with "fdisk /dev/VolGroup00/LogVol01"? :-) Nico''s right, lomount works just fine. You might want to try it out before you delete your snapshot: lomount -verbose -t ext3 -partition 2 \ -diskimage /dev/mapper/VolGroup00-LogVol02 /mnt> After reading the RHEL5/FC6 Xen documentation through again I realised I > must > use kpartx: >Oops! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users