Itamar Reis Peixoto
2007-Jun-17 07:13 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
what''s the error message ? -------------------- Itamar Reis Peixoto e-mail: itamar@ispbrasil.com.br msn: itamarjp@starmedia.com skype: itamarjp icq: 81053601 +55 34 3238 3845 +55 11 4063 5033 ----- Original Message ----- From: Pascal To: xen-users@lists.xensource.com Sent: Sunday, June 17, 2007 3:17 PM Subject: [Xen-users] Howto access the guest filesystem under LVM ? Hello, I have created a guest using virt-install. On the dom0 we have created a LogicalVolume and used it to install the guest We need to copy all the contents of the guest, so we''d like to access the guest filesystem from dom0 Tried something like : mount -o loop /dev/xenvps/mylv /mnt But it doesn''t work is there a way to mount in dom0 the guest filesystem ? Thanks pascal ------------------------------------------------------------------------------ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hello, I have created a guest using virt-install. On the dom0 we have created a LogicalVolume and used it to install the guest We need to copy all the contents of the guest, so we''d like to access the guest filesystem from dom0 Tried something like : mount -o loop /dev/xenvps/mylv /mnt But it doesn''t work is there a way to mount in dom0 the guest filesystem ? Thanks pascal _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Marcin Owsiany
2007-Jun-17 18:37 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
On Sun, Jun 17, 2007 at 08:17:58PM +0200, Pascal wrote:> I have created a guest using virt-install. > On the dom0 we have created a LogicalVolume and used it to install the guest > > We need to copy all the contents of the guest, so we''d like to access > the guest filesystem from dom0 > > Tried something like : > mount -o loop /dev/xenvps/mylv /mnt > > But it doesn''t workOmit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device file, so there''s no need for loop. Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 at the same time is asking for trouble. -- Marcin Owsiany <marcin@owsiany.pl> http://marcin.owsiany.pl/ GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216 "Every program in development at MIT expands until it can read mail." -- Unknown _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pascal
2007-Jun-17 19:00 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
> On Sun, Jun 17, 2007 at 08:17:58PM +0200, Pascal wrote: > >> I have created a guest using virt-install. >> On the dom0 we have created a LogicalVolume and used it to install the guest >> >> We need to copy all the contents of the guest, so we''d like to access >> the guest filesystem from dom0 >> >> Tried something like : >> mount -o loop /dev/xenvps/mylv /mnt >> >> But it doesn''t work >> > > Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device > file, so there''s no need for loop. > > Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 > at the same time is asking for trouble. > >Thanks Does it mean I should first shutdown the guest ? and maybe do mount /dev/mapper/xenvps-centos45 /mnt (loke this it is not a symlink) Pascal _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pascal
2007-Jun-17 19:04 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
>> I have created a guest using virt-install. >> On the dom0 we have created a LogicalVolume and used it to install the guest >> >> We need to copy all the contents of the guest, so we''d like to access >> the guest filesystem from dom0 >> >> Tried something like : >> mount -o loop /dev/xenvps/mylv /mnt >> >> But it doesn''t work >> > > Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device > file, so there''s no need for loop. > > Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 > at the same time is asking for trouble. > >It doesn''t work # mount /dev/mapper/xenvps-centos45 /mnt/ mount: you must specify the filesystem type Pascal _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2007-Jun-17 19:07 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
Pascal wrote:> >> On Sun, Jun 17, 2007 at 08:17:58PM +0200, Pascal wrote: >> >>> I have created a guest using virt-install. >>> On the dom0 we have created a LogicalVolume and used it to install the guest >>> >>> We need to copy all the contents of the guest, so we''d like to access >>> the guest filesystem from dom0 >>> >>> Tried something like : >>> mount -o loop /dev/xenvps/mylv /mnt >>> >>> But it doesn''t work >>> >> >> Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device >> file, so there''s no need for loop. >> >> Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 >> at the same time is asking for trouble. >> >> > Thanks > > Does it mean I should first shutdown the guest ? > > and maybe do > mount /dev/mapper/xenvps-centos45 /mnt > > (loke this it is not a symlink) > PascalIn general, yes. Shut down the guest, to avoid the file system changing under you. Or if you''re using LVM and just want to look at it, simply LVM snapshot it and look at the snapshot. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Goran Vukoman
2007-Jun-17 19:12 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
I don''t know virt-install but maybe the file is partitioned? Check this with fdisk -l -u my-image.img and check the start sector of desired partition. Then mount with mount -o loop,offset=XXXXX my-image.img /mnt XXXXX = number of start sector multiplied with 512 e.g. start sector = 63 -> XXXXX = 63 * 512 = 32256 Goran Am Sonntag, den 17.06.2007, 21:04 +0200 schrieb Pascal:> > > > I have created a guest using virt-install. > > > On the dom0 we have created a LogicalVolume and used it to install the guest > > > > > > We need to copy all the contents of the guest, so we''d like to access > > > the guest filesystem from dom0 > > > > > > Tried something like : > > > mount -o loop /dev/xenvps/mylv /mnt > > > > > > But it doesn''t work > > > > > > > Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device > > file, so there''s no need for loop. > > > > Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 > > at the same time is asking for trouble. > > > > > It doesn''t work > > # mount /dev/mapper/xenvps-centos45 /mnt/ > mount: you must specify the filesystem type > > Pascal > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pascal
2007-Jun-17 19:25 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
Hi It''s not an image file ! Here is the xen config file # Automatically generated xen config file name = "centos45" memory = "1024" disk = [ ''phy:/dev/xenvps/centos45,xvda,w'', ] vif = [ ''mac=00:16:3e:1b:9b:36, bridge=xenbr0'', ] uuid = "cd39e4ad-a993-4e2e-fef0-4dcb6d3d862b" bootloader="/usr/bin/pygrub" vcpus=1 on_reboot = ''restart'' on_crash = ''restart'' What I want is mounted the phy:/dev/xenvps/centos45 in dom0 to be able to copy all the domU (/proc /dev /bin etc) pascal Goran Vukoman a écrit :> I don''t know virt-install but maybe the file is partitioned? Check this > with > > fdisk -l -u my-image.img > > and check the start sector of desired partition. Then mount with > > mount -o loop,offset=XXXXX my-image.img /mnt > > XXXXX = number of start sector multiplied with 512 > e.g. start sector = 63 -> XXXXX = 63 * 512 = 32256 > > Goran > > Am Sonntag, den 17.06.2007, 21:04 +0200 schrieb Pascal: > >>>> I have created a guest using virt-install. >>>> On the dom0 we have created a LogicalVolume and used it to install the guest >>>> >>>> We need to copy all the contents of the guest, so we''d like to access >>>> the guest filesystem from dom0 >>>> >>>> Tried something like : >>>> mount -o loop /dev/xenvps/mylv /mnt >>>> >>>> But it doesn''t work >>>> >>>> >>> Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device >>> file, so there''s no need for loop. >>> >>> Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 >>> at the same time is asking for trouble. >>> >>> >>> >> It doesn''t work >> >> # mount /dev/mapper/xenvps-centos45 /mnt/ >> mount: you must specify the filesystem type >> >> Pascal >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users >> > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Marcin Owsiany
2007-Jun-17 19:41 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
On Sun, Jun 17, 2007 at 09:04:09PM +0200, Pascal wrote:> > >>I have created a guest using virt-install. > >>On the dom0 we have created a LogicalVolume and used it to install the > >>guest > >> > >>We need to copy all the contents of the guest, so we''d like to access > >>the guest filesystem from dom0 > >> > >>Tried something like : > >>mount -o loop /dev/xenvps/mylv /mnt > >> > >>But it doesn''t work > >> > > > >Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device > >file, so there''s no need for loop. > > > >Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 > >at the same time is asking for trouble. > > > > > It doesn''t work > > # mount /dev/mapper/xenvps-centos45 /mnt/ > mount: you must specify the filesystem typeAh, I think with newer centos/RH you need to treat the volume as a whole disk and perform some tricks to make linux see partitions inside it, and potentially even use them as LVM volumes.. I think there were examples of that on the list earlier, I don''t remember the details, though. -- Marcin Owsiany <marcin@owsiany.pl> http://marcin.owsiany.pl/ GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216 "Every program in development at MIT expands until it can read mail." -- Unknown _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pascal
2007-Jun-17 21:15 UTC
Re: [Xen-users] Howto access the guest filesystem under LVM ?
Marcin Owsiany a écrit :> On Sun, Jun 17, 2007 at 09:04:09PM +0200, Pascal wrote: > >>>> I have created a guest using virt-install. >>>> On the dom0 we have created a LogicalVolume and used it to install the >>>> guest >>>> >>>> We need to copy all the contents of the guest, so we''d like to access >>>> the guest filesystem from dom0 >>>> >>>> Tried something like : >>>> mount -o loop /dev/xenvps/mylv /mnt >>>> >>>> But it doesn''t work >>>> >>>> >>> Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device >>> file, so there''s no need for loop. >>> >>> Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 >>> at the same time is asking for trouble. >>> >>> >>> >> It doesn''t work >> >> # mount /dev/mapper/xenvps-centos45 /mnt/ >> mount: you must specify the filesystem type >> > > Ah, I think with newer centos/RH you need to treat the volume as a whole > disk and perform some tricks to make linux see partitions inside it, and > potentially even use them as LVM volumes.. I think there were examples > of that on the list earlier, I don''t remember the details, though. >Well I didn''t find anything about this in the xen doc and google didn''t give me something :\ Hope somebody knows how to mount a guest filesytem created under an LVM partition Pascal _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Artur Linhart - Linux communication
2007-Jun-20 23:52 UTC
RE: [Xen-users] Howto access the guest filesystem under LVM ?
Hello, Do Zou need a read-only or read-write access? If read-only is enough, then You could create the snapshot of the logical volume with lvcreate and read from it... With regards Artur _____ From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Pascal Sent: Sunday, June 17, 2007 11:15 PM To: Marcin Owsiany; xen-users@lists.xensource.com Subject: Re: [Xen-users] Howto access the guest filesystem under LVM ? Marcin Owsiany a écrit : On Sun, Jun 17, 2007 at 09:04:09PM +0200, Pascal wrote: I have created a guest using virt-install. On the dom0 we have created a LogicalVolume and used it to install the guest We need to copy all the contents of the guest, so we''d like to access the guest filesystem from dom0 Tried something like : mount -o loop /dev/xenvps/mylv /mnt But it doesn''t work Omit "-o loop". /dev/xenvps/mylv is a (symlink-to) a real block device file, so there''s no need for loop. Keep in mind that having it mounted R/W in guest and R/W or R/O in dom0 at the same time is asking for trouble. It doesn''t work # mount /dev/mapper/xenvps-centos45 /mnt/ mount: you must specify the filesystem type Ah, I think with newer centos/RH you need to treat the volume as a whole disk and perform some tricks to make linux see partitions inside it, and potentially even use them as LVM volumes.. I think there were examples of that on the list earlier, I don''t remember the details, though. Well I didn''t find anything about this in the xen doc and google didn''t give me something :\ Hope somebody knows how to mount a guest filesytem created under an LVM partition Pascal __________ Informace od NOD32 2335 (20070616) __________ Tato zprava byla proverena antivirovym systemem NOD32. http://www.nod32.cz _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users