Bug 1033573 - libguestfs inspection does not recognize NAS4Free OS installed on QCOW2 image
Summary: libguestfs inspection does not recognize NAS4Free OS installed on QCOW2 image
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-22 12:08 UTC by Pablo Hinojosa
Modified: 2021-04-19 10:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)
virt-inspector -vx -a disk.img > /tmp/log 2>&1 output (47.97 KB, text/plain)
2013-11-22 12:08 UTC, Pablo Hinojosa
no flags Details

Description Pablo Hinojosa 2013-11-22 12:08:15 UTC
Created attachment 827707 [details]
virt-inspector -vx -a disk.img > /tmp/log 2>&1 output

Description of problem:
virt-inspector -a /var/lib/libvirt/images/NAS4Free.img 
W: kvm binary is deprecated, please use qemu-system-x86_64 instead
<?xml version="1.0"?>
<operatingsystems/>



Version-Release number of selected component (if applicable):
1.18.10

How reproducible:
Always

Steps to Reproduce:
1.Make an installation of NAS4Free on a QCOW2 image. 
2.run virt-inspector -a /var/lib/libvirt/images/NAS4Free.img 
3.

Actual results:
Operating Systems return is empty

Expected results:
FreeBSD or something like that 

Additional info:
Maybe it is related with https://bugzilla.redhat.com/show_bug.cgi?id=1033207
No UFS module running.

Comment 1 Richard W.M. Jones 2013-11-22 12:34:08 UTC
Looking at the log file, this does seem to be a complete
failure of blkid to detect any filesystem on the disk
partitions.  That would be indicative of bug 541618, but
not definite proof.

You could try:

guestfish --ro -a /var/lib/libvirt/images/NAS4Free.img
><fs> run
><fs> list-partitions
><fs> file /dev/vda1
><fs> file /dev/vda2
><fs> file /dev/vda3
><fs> file /dev/vda4
><fs> file /dev/vda5
><fs> vfs-type /dev/vda1
><fs> vfs-type /dev/vda2
><fs> vfs-type /dev/vda3
><fs> vfs-type /dev/vda4
><fs> vfs-type /dev/vda5

That might tell us if 'file' thinks there are UFS (FreeBSD-format)
partitions which blkid cannot detect.

I don't think this is related to bug 1033207 - they seem to be
different problems.

Comment 2 Pablo Hinojosa 2013-11-22 12:44:39 UTC
(In reply to Richard W.M. Jones from comment #1)
> Looking at the log file, this does seem to be a complete
> failure of blkid to detect any filesystem on the disk
> partitions.  That would be indicative of bug 541618, but
> not definite proof.
> 
> You could try:
> 
> guestfish --ro -a /var/lib/libvirt/images/NAS4Free.img
> ><fs> run
> ><fs> list-partitions
> ><fs> file /dev/vda1
> ><fs> file /dev/vda2
> ><fs> file /dev/vda3
> ><fs> file /dev/vda4
> ><fs> file /dev/vda5
> ><fs> vfs-type /dev/vda1
> ><fs> vfs-type /dev/vda2
> ><fs> vfs-type /dev/vda3
> ><fs> vfs-type /dev/vda4
> ><fs> vfs-type /dev/vda5
> 
> That might tell us if 'file' thinks there are UFS (FreeBSD-format)
> partitions which blkid cannot detect.
> 
> I don't think this is related to bug 1033207 - they seem to be
> different problems.

I have isntalled and loaded the UFS module (but I think this is only for read, not write).

guestfish --ro -a /var/lib/libvirt/images/NAS4Free.img 

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
W: kvm binary is deprecated, please use qemu-system-x86_64 instead
><fs> list-partitions 
/dev/vda1
/dev/vda2
/dev/vda5
><fs> file /dev/vda1
x86 boot sector; partition 4: ID=0xa5, active, starthead 0, startsector 0, 50000 sectors, code offset 0x3c, BSD disklabel
><fs> file /dev/vda2
x86 boot sector; partition 4: ID=0xa5, active, starthead 0, startsector 0, 50000 sectors, code offset 0x3c, BSD disklabel
><fs> file /dev/vda3
libguestfs: error: file: file_stub: /dev/vda3: No such file or directory
><fs> file /dev/vda5
data
><fs> vfs-type /dev/vda1 

><fs> vfs-type /dev/vda2

><fs> vfs-type /dev/vda3
libguestfs: error: vfs_type: vfs_type_stub: /dev/vda3: No such file or directory
><fs> vfs-type /dev/vda5

><fs>

Comment 3 Pablo Hinojosa 2013-11-22 14:49:46 UTC
Here is the image: http://mirror.catn.com/pub/catn/images/seed/NAS4Free/

Comment 4 Richard W.M. Jones 2013-11-22 15:30:01 UTC
Even with virt-rescue and attempting to use the ufstype=... options
I cannot get any of the partitions to mount.

><rescue> mkdir /tmp/mnt
><rescue> mount -t ufs -r -o ufstype=ufs2 /dev/sda5 /tmp/mnt
[   33.146517] ufs_read_super: bad magic number
mount: wrong fs type, bad option, bad superblock on /dev/sda5,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
><rescue> mount -t ufs -r -o ufstype=44bsd /dev/sda5 /tmp/mnt
[   39.621641] ufs_read_super: bad magic number
mount: wrong fs type, bad option, bad superblock on /dev/sda5,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
><rescue> file -bsL /dev/sda5
data

Also there is a disturbing kernel error:

[    0.405325]  sda: sda1 sda2
[    0.405325]  sda1: <bsd: sda5 >
[    0.405325]  sda2: <bsd:bad subpartition - ignored
[    0.405325]  >

and the partitions found by the kernel don't match those
found by parted (which I believe more).

I think this could be a Linux kernel bug handling BSD partitions.


Note You need to log in before you can comment on or make changes to this bug.