On Wed, Feb 18, 2015 at 4:51 AM, Pino Toscano <ptoscano@redhat.com> wrote:
In data martedì 17 febbraio 2015 13:37:55, Leonard Basuino ha scritto:
> On Mon, Feb 16, 2015 at 6:10 PM, Richard W.M. Jones <rjones@redhat.com>
> wrote:
>
> > On Mon, Feb 16, 2015 at 06:00:06PM -0500, Leonard Basuino wrote:
> > > Hope someone can point me in the right direction.  I don't know if what I
> > > am trying to do should work or not.
> > >
> > > I have 2 disk images.  One is a VM with an ext2 boot filesystem and ext4
> > > filesystems with the OS loaded.  I am amble to guestmount this with no
> > > issue and am able to see the files that are on the ext2 file system.
> > >
> > > I can also run guestfish on the image, mount the ext2 filesystem, and
> > list
> > > the files.
> > >
> > > However, the second image I have is only a boot disk image with just an
> > > ext2 filesystem.
> > >
> > > guestmount complains that there is no OS and won't mount.
> >
> > What you really need to do is run:
> >
> >   virt-filesystems -a second-disk.img --all --long -h
> >
> > which will tell you what filesystems (etc) are available in the second
> > image.
> >
>
>
> > The only filesystem is /dev/sda1 of type ext2
>
>
>
> > > guestfish complains "...wrong fs type, bad option, bad superblock...".
> >
> > Try using guestfish -v -x flags to provide extra information about
> > this error.  See:
> >
> > http://libguestfs.org/guestfs-faq.1.html#debug
> >
>
> I get the following debug info:
>
> mount -o /dev/sda1 /
> [ <time> ] EXT4-fs (sda1): mounting ext2 file system using the ext4
> subsystem
> [ <time> ] EXT4-fs (sda1): bad geometry: block count 104388 exceeds size of
> device (103408 blocks)
> mount: wrong fs type, bad option, bad superblock on /dev/sda1
> ....

This might mean that the partition has been resized to a smaller size,
but without updating the partition table. Is that the case?

Can you please post the output of the guestfish command
`sfdisk-l /dev/sda`?
 
(ok, I have to type it so pardon any typos)
 
Disk /dev/sda: 101 cylinders, 64 heads, 32 sectors/track
Units: cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0
 
   Device  Boot  Start          End     #cyls       #blocks    Id  System
/dev/sda1     *         0+       100         101-      103408    83  Linux
/dev/sda2               0             -             0                0     0  Empty
/dev/sda3               0             -             0                0     0  Empty
/dev/sda3               0             -             0                0     0  Empty
 

> also, trying to mount the image with:
> mount -t ext2 <image> <mount point>
> returns:
> mount: wrong fs type, bad option, bad superblock on /dev/loop0
> ...
> the end of dmesg has:
> [<time>] EXT4-fs (loop0): VFS: Can't find ext4 filesystem
>
> This has me wondering because the debug messages from guestfish -v -x
> indicate it is mouting ext2 with ext4.
> EXT4-fs (sdb): mounting ext2 filesystem using the ext4 subsystem

In recent (well, few years...) Linux versions the ext4 filesystems
takes care of ext2 and ext3 versions as well, so the above message
is correct.

> So is the problem that there is no ext4 filesystem in the image and RHEL 7
> is having issues with it?

I'm not sure what you mean here, can you please rephrase?
 
I was wondering if the message indicated it was looking for ext4 in the image which doesn't exist?
I verified that the same image mounts without issue on a RHEL 6 box but not on a RHEL 7 box.

Thanks,
--
Pino Toscano

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs