Re: [Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images

2014-09-23 Thread Pino Toscano
Hello Assaf,

On Thursday 18 September 2014 11:38:09 Assaf Gordon wrote:
> I'm experimenting with libguestfs on non-linux VMs, encountered errors
> on FreeBSD9.3 and MINIX3 (and few others, but these ones are easy to
> share), with host Ubuntu 14.04.01 LTS x86-64.

Thanks for the images!

Now with recent versions of libguestfs (>= 1.27.53, currently to be 
released yet), a basic Minix detection is done.
For further details, see
  https://bugzilla.redhat.com/show_bug.cgi?id=1144137
(feel free to subscribe to it).

-- 
Pino Toscano

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


Re: [Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images

2014-09-18 Thread Richard W.M. Jones
On Thu, Sep 18, 2014 at 03:38:05PM -0400, Assaf Gordon wrote:
> Hello Richard,
> 
> On 09/18/2014 02:47 PM, Richard W.M. Jones wrote:
> >Note that you can do useful things with libguestfs without necessarily
> >needing inspection to work.  Libguestfs will open any disk image, but
> >without inspection you won't be able to detect OSes in the disk image
> >nor map devices to mountpoints, unless you do it yourself.
> 
> Two more related issues:
> 
> -1-
> With minix, "virt-df" returns negative values:
> 
> =
> $ virt-df -a ./minixR330.qcow2
> Filesystem   1K-blocks   Used  Available  Use%
> minixR330.qcow2:/dev/sda5  2075188  1189220632961%
> minixR330.qcow2:/dev/sda6  1215924 -947761310700   -7%
> minixR330.qcow2:/dev/sda7  1895536 3122961583240   17%
> =

virt-df should never print negative numbers like this.  So this is a
bug -- please file it using the link from the http://libguestfs.org
front page.

> -2-
> With the FreeBSD, "guestfish" can't mount the "ufs" filesystem:
> =
> $ guestfish -a ./freebsd93.qcow2
> > run
> > list-filesystems
> /dev/sda1: unknown
> /dev/sda2: ufs
> /dev/sda3: unknown
> > mount-ro /dev/sda2 /
> libguestfs: error: mount_ro: /dev/sda2 on / (options: 'ro'): mount: wrong fs 
> type, bad option, bad superblock on /dev/sda2,
>missing codepage or helper program, or other error
>In some cases useful info is found in syslog - try
>dmesg | tail  or so
> =
> 
> The "dmesg" (from without guestfish) shows this:
> =
> [   17.052574] You didn't specify the type of your ufs filesystem
> [   17.052574]
> [   17.052574] mount -t ufs -o 
> ufstype=sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...
> [   17.052574]
> [   17.052574] >>>WARNING<<< Wrong ufstype may corrupt your filesystem, 
> default is ufstype=old
> [   17.068725] ufs_read_super: bad magic number
> =

This one is a fairly well-known problem in the Linux kernel / *BSD
filesystem.  See:

  
http://libguestfs.org/guestfs-faq.1.html#ufs-disks-as-used-by-bsd-cannot-be-opened

There's no good answer to this except for BSD to start properly
identifying all the variants of UFS.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

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


Re: [Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images

2014-09-18 Thread Assaf Gordon

Hello Richard,

On 09/18/2014 02:47 PM, Richard W.M. Jones wrote:

Note that you can do useful things with libguestfs without necessarily
needing inspection to work.  Libguestfs will open any disk image, but
without inspection you won't be able to detect OSes in the disk image
nor map devices to mountpoints, unless you do it yourself.


Two more related issues:

-1-
With minix, "virt-df" returns negative values:

=
$ virt-df -a ./minixR330.qcow2
Filesystem   1K-blocks   Used  Available  Use%
minixR330.qcow2:/dev/sda5  2075188  1189220632961%
minixR330.qcow2:/dev/sda6  1215924 -947761310700   -7%
minixR330.qcow2:/dev/sda7  1895536 3122961583240   17%
=


-2-
With the FreeBSD, "guestfish" can't mount the "ufs" filesystem:
=
$ guestfish -a ./freebsd93.qcow2

 run
 list-filesystems

/dev/sda1: unknown
/dev/sda2: ufs
/dev/sda3: unknown

 mount-ro /dev/sda2 /

libguestfs: error: mount_ro: /dev/sda2 on / (options: 'ro'): mount: wrong fs 
type, bad option, bad superblock on /dev/sda2,
   missing codepage or helper program, or other error
   In some cases useful info is found in syslog - try
   dmesg | tail  or so
=

The "dmesg" (from without guestfish) shows this:
=
[   17.052574] You didn't specify the type of your ufs filesystem
[   17.052574]
[   17.052574] mount -t ufs -o 
ufstype=sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...
[   17.052574]
[   17.052574] >>>WARNING<<< Wrong ufstype may corrupt your filesystem, default 
is ufstype=old
[   17.068725] ufs_read_super: bad magic number
=

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


Re: [Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images

2014-09-18 Thread Richard W.M. Jones
On Thu, Sep 18, 2014 at 11:38:09AM -0400, Assaf Gordon wrote:
> Hello Richard and all,
> 
> (continuing from 
> https://www.redhat.com/archives/libguestfs/2014-September/msg00112.html ).
> 
> I'm experimenting with libguestfs on non-linux VMs, encountered errors on 
> FreeBSD9.3 and MINIX3 (and few others, but these ones are easy to share), 
> with host Ubuntu 14.04.01 LTS x86-64.
> 
> Attached are logs from "virt-inspector -v -x" for each VM.

Thanks -- both of these are inspection bugs.  I have filed there here:

https://bugzilla.redhat.com/show_bug.cgi?id=1144137
https://bugzilla.redhat.com/show_bug.cgi?id=1144138

Note that you can do useful things with libguestfs without necessarily
needing inspection to work.  Libguestfs will open any disk image, but
without inspection you won't be able to detect OSes in the disk image
nor map devices to mountpoints, unless you do it yourself.

The first bug (Minix) is likely quite easy to fix actually.  I suspect
that adjusting this function would do it:

https://github.com/libguestfs/libguestfs/blob/master/src/inspect-fs-unix.c#L1489

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

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


[Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images

2014-09-18 Thread Assaf Gordon

Hello Richard and all,

(continuing from 
https://www.redhat.com/archives/libguestfs/2014-September/msg00112.html ).

I'm experimenting with libguestfs on non-linux VMs, encountered errors on 
FreeBSD9.3 and MINIX3 (and few others, but these ones are easy to share), with 
host Ubuntu 14.04.01 LTS x86-64.

Attached are logs from "virt-inspector -v -x" for each VM.

The images are here:
  http://files.housegordon.org/libguestfs/minixR330.qcow2.clean_install.xz 
(44MB)
  http://files.housegordon.org/libguestfs/freebsd93.qcow2.clean_install.xz 
(161MB)

To run them:
  xz -dc < minix3/minixR330.qcow2.clean_install.xz > minixR330.qcow2
  kvm -drive file=minixR330.qcow2,if=virtio,media=disk,index=0 \
  -m 384 -curses -net user -net nic,model=virtio

  xz -dc < freebsd93.qcow2.clean_install.xz > freebsd93.qcow2
  kvm -drive file=freebsd93.qcow2,if=virtio,media=disk,index=0 \
  -m 384 -curses -net user -net nic,model=virtio

Root password for freebsd is "12345".
Root in Minix does not require a password.


Regards,
 - Assaf


 Disk structure from within MINIX3 VM guest 
# fdisk /dev/c0d0
Geometry of /dev/c0d0: 10402x16x63
Inconsistent size in partition 1.
Suspect head and sector parameters.
Disk appears to have mis-specified number of heads or sectors.
Try  fdisk -h256 -s63 /dev/c0d0  instead of
fdisk -h16 -s63 /dev/c0d0
Do not write the table if you are not sure!.

first  -last  sectors---
Num Sorted Act  Type Cyl Head Sec   Cyl Head SecBaseLastSize
1 1A   MINIX0   1   1649 255   63  63+10483199 10483137
-
2 2None 0   0   0  0   00   0   0   0
3 3None 0   0   0  0   00   0   0   0
4 4None 0   0   0  0   00   0   0   0

# df
Filesystem512-blocks   Used  Avail %Cap Mounted on
/dev/c0d0p0s04194304 1116324082672   2% /
none   0  0  0 100% /proc
/dev/c0d0p0s23831200 8057923025408  21% /usr
/dev/c0d0p0s12457600  257842431816   1% /home
none   0  0  0 100% /sys

# mount
/dev/c0d0p0s0 on / type mfs (rw)
none on /proc type procfs (rw)
/dev/c0d0p0s2 on /usr type mfs (rw)
/dev/c0d0p0s1 on /home type mfs (rw)
none on /sys type devman (rw)


== Disk structure from within FreeBSD 9.3 VM guest ==
# df
Filesystem   1K-blocks   Used   Avail Capacity  Mounted on
/dev/vtbd0p2   4818524 777212 365583218%/
devfs1  1   0   100%/dev

# mount
/dev/vtbd0p2 on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)

# fdisk /dev/vtbd0
*** Working on device /dev/vtbd0 ***
parameters extracted from in-core disklabel are:
cylinders=10402 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=10402 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 238 (0xee),(EFI GPT)
start 1, size 10485759 (5119 Meg), flag 0
beg: cyl 0/ head 0/ sector 2;
end: cyl 1023/ head 255/ sector 63
The data for partition 2 is:

The data for partition 3 is:

The data for partition 4 is:






virt-inspector.freebsd93.txt.xz
Description: application/xz


virt-inspector.minix.txt.xz
Description: application/xz
___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs