Assaf Gordon
2014-Sep-18 15:38 UTC
[Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images
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 Sec Base Last Size 1 1 A MINIX 0 1 1 649 255 63 63+10483199 10483137 - 2 2 None 0 0 0 0 0 0 0 0 0 3 3 None 0 0 0 0 0 0 0 0 0 4 4 None 0 0 0 0 0 0 0 0 0 # df Filesystem 512-blocks Used Avail %Cap Mounted on /dev/c0d0p0s0 4194304 111632 4082672 2% / none 0 0 0 100% /proc /dev/c0d0p0s2 3831200 805792 3025408 21% /usr /dev/c0d0p0s1 2457600 25784 2431816 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 3655832 18% / devfs 1 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: <UNUSED> The data for partition 3 is: <UNUSED> The data for partition 4 is: <UNUSED>
Richard W.M. Jones
2014-Sep-18 18:47 UTC
Re: [Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images
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
Assaf Gordon
2014-Sep-18 19:38 UTC
Re: [Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images
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 11892 2063296 1% minixR330.qcow2:/dev/sda6 1215924 -94776 1310700 -7% minixR330.qcow2:/dev/sda7 1895536 312296 1583240 17% ==== -2- With the FreeBSD, "guestfish" can't mount the "ufs" filesystem: ====$ guestfish -a ./freebsd93.qcow2><fs> run ><fs> list-filesystems/dev/sda1: unknown /dev/sda2: ufs /dev/sda3: unknown><fs> 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 =====
Pino Toscano
2014-Sep-23 09:35 UTC
Re: [Libguestfs] libguestfs fails on FreeBSD9.3, MINIX3 qcow2 images
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
Apparently Analagous Threads
- [LLVMdev] build failure in llvm revision69440
- [Bug 8313] New: Minix Support - check for netinet/{in_systm,ip}.h and SO_BROADCAST
- Panic: file istream-zlib.c: ...assertion failed: (ret == -1) / core dump on signal 6 / zlib
- [LLVMdev] Summer Of Code 2009
- [LLVMdev] Got a "corrupted double-linked list" error?