Hi all, So on Centos/RHEL, LVMs are the default layout. I can''t figure out for the life of me, how to mount LVMs. Any one know? I love lomount as it allows me to check filesystems very easily, that can''t boot. - Brian _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Brian Krusic wrote:> Hi all, > > So on Centos/RHEL, LVMs are the default layout. > > I can''t figure out for the life of me, how to mount LVMs. > > Any one know? > > I love lomount as it allows me to check filesystems very easily, that > can''t boot. > > - BrianWhat do you mean? Are you using LVM to create volumes then trying to mount them with your xen config files to use as volumes in your DomUs? If so, just use this in your config file: disk = [ ''phy:/dev/xen/xen_machine,xvda,w'', ] Where xen is the volume group and xen_machine is the volume. Increment xvd(a,b,c,etc) for each volume, its the volume name it will be mounted with in the DomU. w makes it writeable. -- Ryan Duff web: http://www.ryanduff.net aim: ryancduff twitter: ryancduff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Ryan, I create my VMs using the virtual manager gui in Centos. I then simply use an installer CD when prompted and an xvda type img file is created (I usually don''t allocate all space during the creation). During the OS installer phase (Centos/RHEL), I create default partition layouts which use LVMs. So at the end, I have this img file that I can''t figure out how to mount. I know that within that img file, that partition 2 is the root fs which is what I''d like to lomount. - Brian On Feb 5, 2009, at 6:26 PM, Ryan Duff wrote:> Brian Krusic wrote: >> Hi all, >> >> So on Centos/RHEL, LVMs are the default layout. >> >> I can''t figure out for the life of me, how to mount LVMs. >> >> Any one know? >> >> I love lomount as it allows me to check filesystems very easily, that >> can''t boot. >> >> - Brian > > What do you mean? Are you using LVM to create volumes then trying to > mount them with your xen config files to use as volumes in your DomUs? > > If so, just use this in your config file: > > disk = [ ''phy:/dev/xen/xen_machine,xvda,w'', ] > > > Where xen is the volume group and xen_machine is the volume. Increment > xvd(a,b,c,etc) for each volume, its the volume name it will be mounted > with in the DomU. w makes it writeable. > > > -- > Ryan Duff > web: http://www.ryanduff.net > aim: ryancduff > twitter: ryancduff > > _______________________________________________ > 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
Forgot, my conf files disk line of interest looks like this; disk = [ "tap:aio:/var/lib/xen/images/foo.img,xvda,w" ] - Brian On Feb 5, 2009, at 6:26 PM, Ryan Duff wrote:> Brian Krusic wrote: >> Hi all, >> >> So on Centos/RHEL, LVMs are the default layout. >> >> I can''t figure out for the life of me, how to mount LVMs. >> >> Any one know? >> >> I love lomount as it allows me to check filesystems very easily, that >> can''t boot. >> >> - Brian > > What do you mean? Are you using LVM to create volumes then trying to > mount them with your xen config files to use as volumes in your DomUs? > > If so, just use this in your config file: > > disk = [ ''phy:/dev/xen/xen_machine,xvda,w'', ] > > > Where xen is the volume group and xen_machine is the volume. Increment > xvd(a,b,c,etc) for each volume, its the volume name it will be mounted > with in the DomU. w makes it writeable. > > > -- > Ryan Duff > web: http://www.ryanduff.net > aim: ryancduff > twitter: ryancduff > > _______________________________________________ > 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
Quoting Brian Krusic <brian@krusic.com>:> On Feb 5, 2009, at 6:26 PM, Ryan Duff wrote: > >> Brian Krusic wrote: >>> Hi all, >>> >>> So on Centos/RHEL, LVMs are the default layout. >>> >>> I can''t figure out for the life of me, how to mount LVMs. >>> >>> Any one know? >>> >>> I love lomount as it allows me to check filesystems very easily, that >>> can''t boot. >>>Hi Brian, Are you trying to mount a LVM that is inside the xen host LVM? If so, you will want to look at ''kpartx''. If you are just trying to mount a LVM partition then you will need to run ''vgscan'' then ''vgchange -ay'', or maybe it was vgchange -ay then vgscan. :) Jon _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Brian Krusic wrote:> Forgot, my conf files disk line of interest looks like this; > > disk = [ "tap:aio:/var/lib/xen/images/foo.img,xvda,w" ]First make sure your guest isn''t running unless you want to trash its file systems. losetup -f /var/lib/xen/images/foo.img losetup -a # Make a note of which device corresponds to /var/lib/images/foo.img, # ''ll call it /dev/loopN but it''s probably /dev/loop0 kpartx -va /dev/loopN You''ll get two new entries in /dev/mapper now: /dev/mapper/loopNp1 and /dev/mapper/loopNp2. loopNp1 is /boot (asume you have got a standard layout). loopNp2 is a volume group. You can just mount /dev/loopNp1 to poke around the /boot file system. Now vgscan This is where you might come unstuck. The default volume group for Red Hat and similar is "VolGroup00". If your dom0 is using LVM and so is the guest then you''ll have do VolGroup00''s and that''s bad. The best thing to do now is to boot a rescue image in a different domU and rename the guest''s volume group. You''ll need to undo the kpartx and losetup (see below first) and when you''ve all finished then you''ll need to either fix up the guest''s /boot/initrd*.img, /etc/fstab and /boot/grub/grub.conf to hold the new name or you''ll have to rename it back again in the rescue guest. Anyway, assuming you don''t get a clash: vgchange -ay VolGroup00 The guest''s file systems are now in /dev/VolGroup00 and you can mount them as normal. To undo everything: 1. umount any file systyems you mounted 2. vgchange -an VolGroup00 3. kpartx -d /dev/loopN 4. losetup -d /dev/loopN And next time you build a system, change the name of its volume group so you don''t wind up with two systems with the same volume group name! And I wish Red Hat had listened to me years ago when I said that "VolGroup00" was a really poor idea. jch _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
John, Worked like a charm, you rock! How on Gods green Earth did you figure this out? I woulda been stuck if it weren''t for you, but now I am stocked. - Brian On Feb 6, 2009, at 7:56 AM, John Haxby wrote:> Brian Krusic wrote: >> Forgot, my conf files disk line of interest looks like this; >> >> disk = [ "tap:aio:/var/lib/xen/images/foo.img,xvda,w" ] > > First make sure your guest isn''t running unless you want to trash > its file systems. > > losetup -f /var/lib/xen/images/foo.img > losetup -a > # Make a note of which device corresponds to /var/lib/images/foo.img, > # ''ll call it /dev/loopN but it''s probably /dev/loop0 > kpartx -va /dev/loopN > > You''ll get two new entries in /dev/mapper now: /dev/mapper/loopNp1 > and /dev/mapper/loopNp2. loopNp1 is /boot (asume you have got a > standard layout). loopNp2 is a volume group. You can just mount > /dev/loopNp1 to poke around the /boot file system. > > Now > > vgscan > > This is where you might come unstuck. The default volume group for > Red Hat and similar is "VolGroup00". If your dom0 is using LVM and > so is the guest then you''ll have do VolGroup00''s and that''s bad. > The best thing to do now is to boot a rescue image in a different > domU and rename the guest''s volume group. You''ll need to undo the > kpartx and losetup (see below first) and when you''ve all finished > then you''ll need to either fix up the guest''s /boot/initrd*.img, / > etc/fstab and /boot/grub/grub.conf to hold the new name or you''ll > have to rename it back again in the rescue guest. > > Anyway, assuming you don''t get a clash: > > vgchange -ay VolGroup00 > > The guest''s file systems are now in /dev/VolGroup00 and you can > mount them as normal. > > To undo everything: > > 1. umount any file systyems you mounted > 2. vgchange -an VolGroup00 > 3. kpartx -d /dev/loopN > 4. losetup -d /dev/loopN > > And next time you build a system, change the name of its volume > group so you don''t wind up with two systems with the same volume > group name! And I wish Red Hat had listened to me years ago when I > said that "VolGroup00" was a really poor idea. > > jch > > > > _______________________________________________ > 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