Bug 1186935

Summary: libguestfs cannot inspect recent Fedora / RHEL >= 7 when /usr is a separate partition
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano, rbalakri, rjones, seils, william
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-17 17:29:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1318440, 1388407    
Attachments:
Description Flags
Reproducer: usrsplit.sh none

Description Richard W.M. Jones 2015-01-28 22:10:01 UTC
Description of problem:

libguestfs inspection doesn't work on recent Fedora/RHEL 7
guests if /usr is a separate partition.

Because of UsrMove, /bin -> /usr/bin.

Inspection of the root filesystem fails because /bin is
a symlink but the target (ie. /usr/bin) does not exist as
/usr is not on the same partition.

libguestfs: trace: mount_ro "/dev/logger/rootvol" "/"
libguestfs: trace: mount_ro = 0
libguestfs: trace: part_to_partnum "/dev/logger/rootvol"
libguestfs: trace: part_to_partnum = -1 (error)
libguestfs: trace: is_dir "/etc"
libguestfs: trace: is_dir = 1
libguestfs: trace: is_dir "/bin"
libguestfs: trace: is_dir = 0
libguestfs: trace: is_dir "/share"
libguestfs: trace: is_dir = 0
libguestfs: trace: is_file "/grub/menu.lst"
libguestfs: trace: is_file = 0
libguestfs: trace: is_file "/grub/grub.conf"
libguestfs: trace: is_file = 0
libguestfs: trace: is_file "/grub2/grub.cfg"
libguestfs: trace: is_file = 0
libguestfs: trace: is_file "/hurd/console"
libguestfs: trace: is_file = 0
libguestfs: trace: is_symlink "/bin"
libguestfs: trace: is_symlink = 1
libguestfs: trace: is_dir "/usr/bin"
libguestfs: trace: is_dir = 0
libguestfs: trace: is_dir "/log"
libguestfs: trace: is_dir = 0
libguestfs: trace: case_sensitive_path "/windows"
libguestfs: trace: case_sensitive_path = "/windows"
libguestfs: trace: case_sensitive_path "/windows/system32"
libguestfs: trace: case_sensitive_path = NULL (error)
libguestfs: trace: case_sensitive_path "/winnt"
libguestfs: trace: case_sensitive_path = "/winnt"
libguestfs: trace: case_sensitive_path "/winnt/system32"
libguestfs: trace: case_sensitive_path = NULL (error)
libguestfs: trace: case_sensitive_path "/win32"
libguestfs: trace: case_sensitive_path = "/win32"
libguestfs: trace: case_sensitive_path "/win32/system32"
libguestfs: trace: case_sensitive_path = NULL (error)
libguestfs: trace: case_sensitive_path "/win"
libguestfs: trace: case_sensitive_path = "/win"
libguestfs: trace: case_sensitive_path "/win/system32"
libguestfs: trace: case_sensitive_path = NULL (error)
libguestfs: trace: case_sensitive_path "/boot.ini"
libguestfs: trace: case_sensitive_path = "/boot.ini"
libguestfs: trace: is_file "/boot.ini"
libguestfs: trace: is_file = 0
libguestfs: trace: case_sensitive_path "/System Volume Information"
libguestfs: trace: case_sensitive_path = "/System Volume Information"
libguestfs: trace: is_dir "/System Volume Information"
libguestfs: trace: is_dir = 0
libguestfs: trace: case_sensitive_path "/System Volume Information"
libguestfs: trace: case_sensitive_path = "/System Volume Information"
libguestfs: trace: is_dir "/System Volume Information"
libguestfs: trace: is_dir = 0
libguestfs: trace: case_sensitive_path "/FDOS"
libguestfs: trace: case_sensitive_path = "/FDOS"
libguestfs: trace: is_dir "/FDOS"
libguestfs: trace: is_dir = 0
libguestfs: trace: umount_all
libguestfs: trace: umount_all = 0

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

libguestfs 1.28.1

Additional info:

Comment 1 Richard W.M. Jones 2015-02-03 14:57:00 UTC
Created attachment 987636 [details]
Reproducer: usrsplit.sh

The attached script is a short but rather ugly script that
reproduces the bug by creating a Fedora guest with a separate /usr
partition.

Comment 2 Richard W.M. Jones 2015-03-02 09:15:43 UTC
*** Bug 1197407 has been marked as a duplicate of this bug. ***

Comment 4 Pino Toscano 2016-03-17 17:29:06 UTC
Fixed with commit
https://github.com/libguestfs/libguestfs/commit/1df34fd8d131dc577344550350077431f56e8bdc
which is in libguestfs >= 1.33.16.

Comment 5 Pino Toscano 2016-06-09 15:44:49 UTC
The fix was backported in libguestfs 1.32.4.

Comment 6 Richard W.M. Jones 2016-09-06 15:02:56 UTC
It looks like this bug was opened against the upstream
package, which is why we "lost" it in RHEL.

However the good news is that it's fixed in RHEL 7.3,
and the packages are available now:

https://people.redhat.com/~rjones/libguestfs-RHEL-7.3-preview/
http://oirase.annexia.org/virt-p2v/

Comment 7 Pino Toscano 2016-09-06 15:06:28 UTC
(In reply to Richard W.M. Jones from comment #6)
> It looks like this bug was opened against the upstream
> package, which is why we "lost" it in RHEL.

We didn't, as there's a counterpart bug for 7.2: bug 1318440.

Comment 8 Pino Toscano 2017-07-11 06:42:07 UTC
(In reply to Pino Toscano from comment #4)
> Fixed with commit
> https://github.com/libguestfs/libguestfs/commit/
> 1df34fd8d131dc577344550350077431f56e8bdc
> which is in libguestfs >= 1.33.16.

To be more precise, there were 3 commits needed: (two small refactor patches, and the actual fix)
https://github.com/libguestfs/libguestfs/commit/0c4edcecbaa82be2251d296e524e3bb50840ba9e
https://github.com/libguestfs/libguestfs/commit/e77e1ef95ed79d34dfcbaa08e26a333462471899
https://github.com/libguestfs/libguestfs/commit/1d86b3768956f818262a5189bb1ba996dedbf531

Comment 9 Pino Toscano 2017-07-11 06:42:25 UTC
*** Bug 1469339 has been marked as a duplicate of this bug. ***