Bug 627675

Summary: libguestfs inspector code cannot handle /dev/disk/by-id/* paths
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 836573 (view as bug list) Environment:
Last Closed: 2012-06-29 20:45:28 UTC Type: ---
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: 836573    

Description Richard W.M. Jones 2010-08-26 16:14:38 UTC
Description of problem:

This is from an OpenSUSE 11.3 guest.
><fs> cat /etc/fstab 
/dev/system/root     /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-QEMU_HARDDISK_QM00001-part1 /boot                ext4       acl,user_xattr        1 2
/dev/system/home     /home                ext4       defaults              1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

When guestfish -i runs it says:
libguestfs: error: mount_ro: mount_ro_stub: /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001-part1: No such file or directory

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

1.5.5

Comment 1 Richard W.M. Jones 2010-08-26 16:16:11 UTC
It seems very ill-advised for a machine to encode the
hard drive name in a path anyway, since it would stop
the machine from being cloned or copied to another
type of hard drive, or in the virt case from being moved
to another hypervisor.

Comment 2 Richard W.M. Jones 2011-04-12 17:38:54 UTC
I still think this is a bug in OpenSUSE, but I will just
note that the same error happens in libguestfs 1.9.18.

Comment 3 Richard W.M. Jones 2012-06-29 20:45:09 UTC
I've pushed a fix for this upstream.  Some or all of the following
commits are required since I also refactored the surrounding
code and added a useful new API.

Required:
https://github.com/libguestfs/libguestfs/commit/152b179a19e43fcb0baec65ea65d394ee1dba891

Optional code refactoring:
https://github.com/libguestfs/libguestfs/commit/47b8225b05a7e35411f954f61f3eb3115c5a9f45

Required:
https://github.com/libguestfs/libguestfs/commit/7eaa99994ebd354f4b078d4068695984989a907f

Optional code refactoring:
https://github.com/libguestfs/libguestfs/commit/ea8421c5d297698856a87c2cfe4a6b42796175a8

Not needed, just an intervening commit in the series:
https://github.com/libguestfs/libguestfs/commit/339f3647f889424af2a2256c4fcad0b44982c275

Optional (test of /dev/disk/by-id paths):
https://github.com/libguestfs/libguestfs/commit/5489304c8d2836713ec58051c24514eba22b8c94

Comment 4 Richard W.M. Jones 2012-06-29 20:46:00 UTC
Available in libguestfs >= 1.19.15.