<br>
<div class="gmail_quote">On Mon, Feb 16, 2015 at 6:10 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">On Mon, Feb 16, 2015 at 06:00:06PM -0500, Leonard Basuino wrote:<br>> Hope someone can point me in the right direction.  I don't know if what I<br>> am trying to do should work or not.<br>><br>> I have 2 disk images.  One is a VM with an ext2 boot filesystem and ext4<br>> filesystems with the OS loaded.  I am amble to guestmount this with no<br>> issue and am able to see the files that are on the ext2 file system.<br>><br>> I can also run guestfish on the image, mount the ext2 filesystem, and list<br>> the files.<br>><br>> However, the second image I have is only a boot disk image with just an<br>> ext2 filesystem.<br>><br>> guestmount complains that there is no OS and won't mount.<br><br>What you really need to do is run:<br><br>  virt-filesystems -a second-disk.img --all --long -h<br><br>which will tell you what filesystems (etc) are available in the second<br>image.<br></blockquote>
<div> </div>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">The only filesystem is /dev/sda1 of type ext2</blockquote>
<div> </div>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">> guestfish complains "...wrong fs type, bad option, bad superblock...".<br><br>Try using guestfish -v -x flags to provide extra information about<br>this error.  See:<br><br><a href="http://libguestfs.org/guestfs-faq.1.html#debug" target="_blank">http://libguestfs.org/guestfs-faq.1.html#debug</a><br></blockquote>
<div> </div>
<div>I get the following debug info:</div>
<div> </div>
<div>mount -o /dev/sda1 /</div>
<div>[ <time> ] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem</div>
<div>[ <time> ] EXT4-fs (sda1): bad geometry: block count 104388 exceeds size of device (103408 blocks)</div>
<div>mount: wrong fs type, bad option, bad superblock on /dev/sda1</div>
<div>....</div>
<div> </div>
<div>also, trying to mount the image with:</div>
<div>mount -t ext2 <image> <mount point></div>
<div>returns:</div>
<div>mount: wrong fs type, bad option, bad superblock on /dev/loop0</div>
<div>...</div>
<div>the end of dmesg has:</div>
<div>[<time>] EXT4-fs (loop0): VFS: Can't find ext4 filesystem</div>
<div> </div>
<div>This has me wondering because the debug messages from guestfish -v -x indicate it is mouting ext2 with ext4.</div>
<div>EXT4-fs (sdb): mounting ext2 filesystem using the ext4 subsystem</div>
<div> </div>
<div>So is the problem that there is no ext4 filesystem in the image and RHEL 7 is having issues with it?</div>
<div> </div>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">Also, what version of libguestfs and where did you get it from?<br><br></blockquote>
<div>version 1.22.6-22, came with RHEL 7</div>
<div> </div>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">> Should I be able to mount a boot disk image with guestmount?<br><br>Yes, libguestfs aims to be able to access any disk image, and mostly<br>we have achieved that.  Whether it is bootable or not wouldn't<br>normally matter.<br><br>> I suspect I'll have to use the -m (mount) option and not -i (as I did for<br>> the image with an OS), but that failed too even though I passed in the fs<br>> type of ext2,<br><br>`-i' invokes inspection:<br><br><a href="http://libguestfs.org/guestfs.3.html#inspection" target="_blank">http://libguestfs.org/guestfs.3.html#inspection</a><br><br>Inspection is an optional convenience feature, and you can access disk<br>images without it, but then you need to know what filesystems you want<br>to mount (eg. using 'virt-filesystems' -- see above).<br><br>> Why would I be able to mount, via guestfish, the ext2 in the first image<br>> (with other filesystems of type ext4) but not the disk image with only an<br>> ext2 filesystem?<br><br>I've no idea, but for more information you can enable debugging at run<br>time:<br><br><a href="http://libguestfs.org/guestfs-faq.1.html#debug" target="_blank">http://libguestfs.org/guestfs-faq.1.html#debug</a><br><br>Rich.<br><span><font color="#888888"><br><br>--<br>Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" target="_blank">http://people.redhat.com/~rjones</a><br>Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com/" target="_blank">http://rwmj.wordpress.com</a><br>virt-p2v converts physical machines to virtual machines.  Boot with a<br>live CD or over the network (PXE) and turn machines into KVM guests.<br><a href="http://libguestfs.org/virt-v2v" target="_blank">http://libguestfs.org/virt-v2v</a><br></font></span></blockquote></div><br>