CentOS7.0关于libguestfs的bug
libguestfs,libguestfs-tools是用来在不启动虚拟机的情况下,快速简单访问虚拟机磁盘的工具。
今天在CentOS7.0系统上通过guestmount命令去mount虚拟机磁盘的时候,突然报出了如下错误:
libguestfs: error: supermin-helper exited with error status 1. To see full error messages you may need to enable debugging. See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
查看具体出错原因,可以在guestmount命令后加上 -v 参数,表示输出debug信息,如下:
libguestfs: launch: backend=libvirt libguestfs: launch: tmpdir=/tmp/libguestfsMYtoWx libguestfs: launch: umask=0022 libguestfs: launch: euid=0 libguestfs: libvirt version = 1001001 (1.1.1) libguestfs: [00000ms] connect to libvirt libguestfs: opening libvirt handle: URI = NULL, auth = virConnectAuthPtrDefault, flags = 0 libguestfs: successfully opened libvirt handle: conn = 0x7feab79698b0 libguestfs: [00004ms] get libvirt capabilities libguestfs: [00017ms] parsing capabilities XML libguestfs: [00018ms] build appliance libguestfs: command: run: supermin-helper libguestfs: command: run: \ --verbose libguestfs: command: run: \ -f checksum libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d libguestfs: command: run: \ x86_64 supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = (null), initrd = (null), appliance = (null) supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d checking modpath /lib/modules/3.10.0-123.el7.x86_64 is a directory picked vmlinuz-3.10.0-123.el7.x86_64 supermin helper [00000ms] finished creating kernel supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/base.img.gz supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img.gz supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles supermin helper [00031ms] visiting /usr/lib64/guestfs/supermin.d/init.img supermin helper [00031ms] visiting /usr/lib64/guestfs/supermin.d/udev-rules.img supermin helper [00031ms] adding kernel modules supermin helper [00068ms] finished creating appliance libguestfs: checksum of existing appliance: c44bb96b2258e5c160495e5fb32bc79b970b92768e64efca76f989f00fb830b7 libguestfs: [00104ms] begin building supermin appliance libguestfs: [00104ms] run supermin-helper libguestfs: command: run: supermin-helper libguestfs: command: run: \ --verbose libguestfs: command: run: \ --copy-kernel libguestfs: command: run: \ -f ext2 libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d libguestfs: command: run: \ x86_64 libguestfs: command: run: \ /var/tmp/guestfs.9MdTWL/kernel libguestfs: command: run: \ /var/tmp/guestfs.9MdTWL/initrd libguestfs: command: run: \ /var/tmp/guestfs.9MdTWL/root supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = /var/tmp/guestfs.9MdTWL/kernel, initrd = /var/tmp/guestfs.9MdTWL/initrd, appliance = /var/tmp/guestfs.9MdTWL/root supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d checking modpath /lib/modules/3.10.0-123.el7.x86_64 is a directory picked vmlinuz-3.10.0-123.el7.x86_64 supermin helper [00011ms] finished creating kernel supermin helper [00267ms] finished mke2fs supermin helper [00268ms] visiting /usr/lib64/guestfs/supermin.d supermin helper [00268ms] visiting /usr/lib64/guestfs/supermin.d/base.img.gz supermin helper [03388ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img.gz supermin helper [03405ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles supermin-helper: ext2: parent directory not found: centos-release: File not found by ext2_lookup libguestfs: error: supermin-helper exited with error status 1, see debug messages above libguestfs: command: run: rm libguestfs: command: run: \ -rf /var/tmp/guestfs.9MdTWL libguestfs: clear_socket_create_context: setsockcreatecon failed: NULL: Invalid argument [you can ignore this UNLESS using SELinux + sVirt] libguestfs: closing guestfs handle 0x7feab7969240 (state 0) libguestfs: command: run: rm libguestfs: command: run: \ -rf /tmp/libguestfsMYtoWx
从输出中可以找到具体出错原因,原来是由于在visit /usr/lib64/guestfs/supermin.d/hostfiles文件时,centos-release: File not found by ext2_lookup。
那么就可以有两种解决办法:
1、第一种是最直接简单的办法,可以先将/usr/lib64/guestfs/supermin.d/hostfiles文件备份一份到其他目录下,然后直接将/usr/lib64/guestfs/supermin.d/hostfiles文件中的所有有centos-release或者redhat-release的行全部删除。
2、第二种就是升级libguestfs,supermin软件包,链接 http://people.redhat.com/~rjones/libguestfs-RHEL-7.1-preview/
-------------------------
No pains, no gains
posted on 2015-03-12 10:03 CasonChan 阅读(3107) 评论(0) 编辑 收藏 举报