Description of problem: The mount-vfs command failed to mount the logical volume to '/'. However, the mount command is OK. Version-Release number of selected component (if applicable): libguestfs-1.38.0-1.el7.x86_64 qemu-kvm-1.5.3-156.el7.x86_64 kernel-3.10.0-862.el7.x86_64 libvirt-3.9.0-14.el7.x86_64 How reproducible: 100% Steps: 1. On rhel7.5 host #qemu-img create -f raw fs_mount.ext2.raw 10G 2.#guestfish -a fs_mount.ext2.raw -v -x ><fs> run ><fs> pvcreate /dev/sda ><fs> vgcreate vol_test /dev/sda ><fs> lvcreate vol_file vol_test 10000 ><fs> mkfs ext2 /dev/vol_test/vol_file ><fs> list-filesystems /dev/vol_test/vol_file: ext2 ><fs> mount-vfs "" ext2 /dev/vol_test/vol_file / ------------------------------------------------- libguestfs: trace: mount_vfs "" "ext2" "/dev/vol_test/vol_file" "/" libguestfs: trace: vfs_type "/dev/vol_test/vol_file" guestfsd: <= vfs_type (0xc6) request length 68 bytes commandrvf: stdout=n stderr=y flags=0x0 commandrvf: udevadm --debug settle -E /dev/vol_test/vol_file calling: settle command: blkid '-c' '/dev/null' '-o' 'value' '-s' 'TYPE' '/dev/vol_test/vol_file' command: blkid returned 0 command: blkid: stdout: ext2 guestfsd: => vfs_type (0xc6) took 0.00 secs libguestfs: trace: vfs_type = "ext2" guestfsd: <= mount_vfs (0x4b) request length 88 bytes commandrvf: stdout=n stderr=y flags=0x0 commandrvf: udevadm --debug settle -E /dev/vol_test/vol_file calling: settle [ 11.893586] traps: guestfsd[190] general protection ip:5583dc66da83 sp:7ffcc869b910 error:0 in guestfsd[5583dc585000+1c2000] /init: line 244: 190 Segmentation fault $cmd + sync + test '' = 1 + reboot -f Rebooting. [ 11.900859] Unregister pv shared memory for cpu 0 [ 11.901502] sd 2:0:1:0: [sdb] Synchronizing SCSI cache [ 11.902234] sd 2:0:0:0: [sda] Synchronizing SCSI cache [ 11.903551] Restarting system. [ 11.903960] reboot: machine restart libguestfs: error: appliance closed the connection unexpectedly, see earlier error messages libguestfs: child_cleanup: 0x5632104f6cd0: child process died libguestfs: calling virDomainDestroy flags=0 libguestfs: trace: mount_vfs = -1 (error) ------------------------------------------------- Actual results: The mount-vfs command failed with segmentation fault. Expected results: The mount-vfs command can mount the logical volume successfully. Additional info: The same error occurs on other filesystems(ext3,ext4,xfs).
> [ 11.893586] traps: guestfsd[190] general protection ip:5583dc66da83 sp:7ffcc869b910 error:0 in guestfsd[5583dc585000+1c2000] /init: line 244: 190 Segmentation fault $cmd Ouch. A one line reproducer (which works upstream too) is: $ guestfish -v -x -N lvfs mount-vfs "" ext2 /dev/VG/LV /
Patch posted: https://www.redhat.com/archives/libguestfs/2018-April/msg00059.html
Upstream fix: https://github.com/libguestfs/libguestfs/commit/07ead43cbbf0bbc69a00e4a5df1a9642fd75cbf4
Fix backported in 1.38.1.
Verified with packages: libguestfs-1.38.1-1.el7.x86_64 Steps: 1. On rhel7.5 host #guestfish -v -x -N lvfs mount-vfs "" ext2 /dev/VG/LV / --------------------------------------------------------- ... command: mount '-t' 'ext2' '/dev/VG/LV' '/sysroot//' [ 2.570310] EXT4-fs (dm-0): mounting ext2 file system using the ext4 subsystem [ 2.573742] EXT4-fs (dm-0): mounted filesystem without journal. Opts: (null) guestfsd: => mount_vfs (0x4b) took 0.01 secs libguestfs: trace: mount_vfs = 0 ... --------------------------------------------------------- No error pops up. So verified this bug.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:3021