Kraska, Joe A \(US SSA\)
2007-Apr-17 20:44 UTC
[Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -o loop)
I seem to have forgotten something: I have some virtual machine image files (created with the dd if=/dev/zero technique), that have RHEL 4 u 4 installed in them. I would swear that at one time I knew how to mount these image files using the mount -o loop -t ext3 technique. That doesn''t work. My guess is that this has something to do with the LVM structure inside the RHEL4 u 4 vm. This question is actually unrelated to Xen, but I''m asking it here as I learened dd/mount tricks with the qemu installer here. Can someone jog my memory? What''s the magic incantation? Joe. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Marcin Owsiany
2007-Apr-17 21:15 UTC
Re: [Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -o loop)
On Tue, Apr 17, 2007 at 01:44:57PM -0700, Kraska, Joe A (US SSA) wrote:> Can someone jog my memory? What''s the magic incantation?modprobe loop ? :) -- 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
Kraska, Joe A \(US SSA\)
2007-Apr-17 21:44 UTC
RE: [Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -oloop)
> > Can someone jog my memory? What''s the magic incantation? > > modprobe loop ? :)Well. That was helpful... but didn''t solve the problem. I have one box in which modprobe fatals, but another one in which it''s okay. Here''s what happens: [root@blade15 xen-rh64-gold]# modprobe loop [root@blade15 xen-rh64-gold]# ls hda mnt [root@blade15 xen-rh64-gold]# mount -o loop -t ext3 hda mnt mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so And yet, I would swear that this worked at one time. The vm installed into "had" is configured with the default partitioning mechanism, which involves LVM. Joe. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jerry Amundson
2007-Apr-17 22:13 UTC
Re: [Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -oloop)
On 4/17/07, Kraska, Joe A (US SSA) <joe.kraska@baesystems.com> wrote:> > > Can someone jog my memory? What''s the magic incantation? > > > > modprobe loop ? :) > > Well. That was helpful... but didn''t solve the problem. > I have one box in which modprobe fatals, but another one > in which it''s okay. Here''s what happens: > > [root@blade15 xen-rh64-gold]# modprobe loop > [root@blade15 xen-rh64-gold]# ls > hda mnt > [root@blade15 xen-rh64-gold]# mount -o loop -t ext3 hda mnt > mount: wrong fs type, bad option, bad superblock on /dev/loop0, > missing codepage or other error > In some cases useful info is found in syslog - try > dmesg | tail or so > > And yet, I would swear that this worked at one time. > > The vm installed into "had" is configured with the default > partitioning mechanism, which involves LVM.kpartx ? http://fedoraproject.org/wiki/FedoraXenQuickstartFC5 jerry -- "Oh joy! Rapture! I''ve got a brain" -Scarecrow _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Luke S. Crawford
2007-Apr-17 22:23 UTC
RE: [Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -oloop)
On Tue, 17 Apr 2007, Kraska, Joe A (US SSA) wrote:>>> Can someone jog my memory? What''s the magic incantation?>> modprobe loop ? :)> Well. That was helpful... but didn''t solve the problem....> [root@blade15 xen-rh64-gold]# mount -o loop -t ext3 hda mnt > mount: wrong fs type, bad option, bad superblock on /dev/loop0,you want losetup /dev/loop1 /dev/hda then kpartx -av /dev/loop1 (the partitions are in /dev/mapper/loop1px) then mount /dev/mapper/loop1p2 /mnt or something like that ...> The vm installed into "had" is configured with the default > partitioning mechanism, which involves LVM.LVM is different... if the above doesn''t work, try running vgscan/lvscan after you losetup. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Kraska, Joe A \(US SSA\)
2007-Apr-17 23:29 UTC
RE: [Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -oloop)
> > [root@blade15 xen-rh64-gold]# mount -o loop -t ext3 hda mnt > > mount: wrong fs type, bad option, bad superblock on /dev/loop0, > > you want > > losetup /dev/loop1 /dev/hda > > then kpartx -av /dev/loop1 > > (the partitions are in /dev/mapper/loop1px) > > then mount /dev/mapper/loop1p2 /mnt > > or something like that > > ... > > > The vm installed into "had" is configured with the default > > partitioning mechanism, which involves LVM. > > LVM is different... if the above doesn''t work, try runningvgscan/lvscan> after you losetup.Mkay. Maybe it wasn''t obvious but "hda" in the above mount command is the Xen image file. It was the file made with dd, into which RHEL44 was installed using Qemu. I''m a bit confused in your instructions, because you seem to be forwarding me to a /dev/hda, and don''t reference my file based image at all. That I can see. Sorry about my confusion. My sojourn into Xen has me learning basic low level linux commands that other gurus take for granted. :) Joe. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Kraska, Joe A \(US SSA\)
2007-Apr-17 23:32 UTC
RE: [Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -oloop)
> kpartx ? > http://fedoraproject.org/wiki/FedoraXenQuickstartFC5Thank you. Helpful notes. The section saying that lomount cannot work with LVM volumes suggests to me that mount -o loop would not either. Perhaps my past mounting successes were only associated with mounting the dd image file PRIOR to installing the OS with qemu? Anyway, I''ll try kpartx on the image file, yes. Thank you. Joe. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Luke S. Crawford
2007-Apr-17 23:40 UTC
RE: [Xen-users] Mounting RHEL 4 virtual machine disks (dd/mount -oloop)
On Tue, 17 Apr 2007, Kraska, Joe A (US SSA) wrote:> Mkay. Maybe it wasn''t obvious but "hda" in the above mount command is > the > Xen image file. It was the file made with dd, into which RHEL44 was > installed > using Qemu. I''m a bit confused in your instructions, because you seem to > be > forwarding me to a /dev/hda, and don''t reference my file based image at > all. > That I can see.Ahh. my mistake then. it''s losetup /dev/loop1 /path/to/file now /dev/loop1 (you may need to increment or decrement the 1 to get a free loop device) is a device in the Dom0 that looks a lot like how the DomU would see /dev/hda. so now you go from /dev/loop1 to the sub-partitions. kpartx -av /dev/loop1 would be how you would do it if it were straight partitions. with lvm, you need to vgscan it, but from what I understand, vgscan scans all devices, including or excluding certain devices in the lvm config files. (on my system, /etc/lvm/lvm.conf specifies a filter= that excludes the cdrom device) You need to somehow get vgscan to read /dev/loop1. (it is possible that just ''vgscan'' or ''lvscan'' after you do the losetup will do the job.) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users