Adam Miller
2011-Oct-08 08:01 UTC
[Libguestfs] guestmount issues with --live, but guestfish works just fine
Hello all, I am having an issue with guestmount in respect to live instances and I was hoping someone might have an idea where I've gone wrong. The following output is from my shell session, if there's any more information needed please let me know and I'll happily provide it. [root at longitude ~]# virt-filesystems -d F16-rawhide/dev/sda2 /dev/sda3 [root at longitude ~]# guestmount --live -d F16-rawhide -m /dev/sda3:/ /mnt/guestfs/ libguestfs: error: mount_options: /dev/vda3 on /: mount: /dev/vda3 already mounted or / busy mount: according to mtab, /dev/vda3 is already mounted on / libguestfs: error: part_to_dev: part_to_dev_stub: /dev/vda3: device not found libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x34 from daemon, expected 0xffffeeee guestmount: '/dev/sda3' could not be mounted. Did you mean one of these? /dev/vda1 (unknown) /dev/vda2 (unknown) /dev/vda3 (unknown) /dev/vda4 (unknown) libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x0 from daemon, expected 0xffffeeee [root at longitude ~]# guestmount --live -d F16-rawhide -m /dev/vda3:/ /mnt/guestfs/ libguestfs: error: mount_options: mount_options_stub: /dev/vda3: device not found libguestfs: error: unexpected procedure number (74/7) libguestfs: error: unexpected procedure number (7/282) [root at longitude ~]# guestmount --live -d F16-rawhide -m /dev/vda3:/ -v /mnt/guestfs/ libguestfs: [00000ms] connecting to /var/lib/libvirt/qemu/F16-rawhide.libguestfs libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 1a | 00 00 00 01 | 00 12 34 02 | ... libguestfs: error: guestfs_launch failed, unexpected initial message from guestfsd libguestfs: closing guestfs handle 0x1191760 (state 1) libguestfs: sending SIGTERM to process 0 [root at longitude ~]# guestmount --live -d F16-rawhide -m /dev/vda3:/ -v -x /mnt/guestfs/ libguestfs: trace: set_recovery_proc true libguestfs: trace: set_recovery_proc = 0 libguestfs: trace: add_domain "F16-rawhide" "live:true" libguestfs: trace: set_attach_method "unix:/var/lib/libvirt/qemu/F16-rawhide.libguestfs" libguestfs: trace: set_attach_method = 0 libguestfs: trace: add_domain = 0 libguestfs: trace: launch libguestfs: [00000ms] connecting to /var/lib/libvirt/qemu/F16-rawhide.libguestfs libguestfs: recv_from_daemon: received GUESTFS_LAUNCH_FLAG libguestfs: [00000ms] connected libguestfs: trace: launch = 0 libguestfs: trace: mount_options "" "/dev/vda3" "/" libguestfs: send_to_daemon: 72 bytes: 00 00 00 44 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 4a | 00 00 00 00 | ... libguestfs: recv_from_daemon: 96 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 4a | 00 00 00 01 | 00 12 34 00 | ... libguestfs: trace: mount_options = -1 (error) libguestfs: error: mount_options: mount_options_stub: /dev/vda3: device not found libguestfs: trace: list_filesystems libguestfs: trace: list_devices libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 | 00 00 00 07 | 00 00 00 00 | ... libguestfs: recv_from_daemon: 168 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 4a | 00 00 00 01 | 00 12 34 00 | ... libguestfs: error: unexpected procedure number (74/7) libguestfs: trace: list_devices = NULL (error) libguestfs: trace: list_filesystems = NULL (error) libguestfs: closing guestfs handle 0x6e8760 (state 2) libguestfs: trace: internal_autosync libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 | 00 00 01 1a | 00 00 00 00 | ... libguestfs: recv_from_daemon: 56 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 07 | 00 00 00 01 | 00 12 34 01 | ... libguestfs: error: unexpected procedure number (7/282) libguestfs: trace: internal_autosync = -1 (error) libguestfs: trace: kill_subprocess libguestfs: sending SIGTERM to process 0 libguestfs: trace: kill_subprocess = 0 [root at longitude ~]# guestfish --live -d F16-rawhide 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 ><fs> ls /bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var><fs>Many thanks! -AdamM
Richard W.M. Jones
2011-Oct-08 08:15 UTC
[Libguestfs] guestmount issues with --live, but guestfish works just fine
On Sat, Oct 08, 2011 at 03:01:02AM -0500, Adam Miller wrote:> Hello all, > I am having an issue with guestmount in respect to live instances > and I was hoping someone might have an idea where I've gone wrong. The > following output is from my shell session, if there's any more > information needed please let me know and I'll happily provide it. > > [root at longitude ~]# virt-filesystems -d F16-rawhide > /dev/sda2 > /dev/sda3 > [root at longitude ~]# guestmount --live -d F16-rawhide -m /dev/sda3:/ > /mnt/guestfs/ > libguestfs: error: mount_options: /dev/vda3 on /: mount: /dev/vda3 > already mounted or / busy > mount: according to mtab, /dev/vda3 is already mounted on / > libguestfs: error: part_to_dev: part_to_dev_stub: /dev/vda3: device not > found > libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x34 from > daemon, expected 0xffffeeee > > guestmount: '/dev/sda3' could not be mounted. Did you mean one of > these? > /dev/vda1 (unknown) > /dev/vda2 (unknown) > /dev/vda3 (unknown) > /dev/vda4 (unknown) > libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x0 from > daemon, expected 0xffffeeeeYeah, I can sort of see what's going on here. I think it reflects the fact that --live support is not very well integrated with guestmount at the moment. Because this is a live connection, filesystems are already mounted (inside the running guest) so you don't need the -m option at all. Unfortunately a bug in guestmount prevents you from not using the -m option: $ guestmount --live -d FedoraRawhidex64 /tmp/mnt guestmount: must have at least one -a/-d and at least one -m/-i option So at the moment without fixing that bug, it's not possible. I'd be careful with using live support right now. There are a few corner cases where it doesn't behave very well. In particular there are two API calls that try to edit /etc files (OK in the appliance, not so great for live guests): $ git grep /etc daemon daemon/findfs.c: unlink ("/etc/blkid/blkid.tab"); daemon/lvm-filter.c:/* Rewrite the 'filter = [ ... ]' line in /etc/lvm/lvm.conf. daemon/lvm-filter.c: FILE *ifp = fopen ("/etc/lvm/lvm.conf", "r"); daemon/lvm-filter.c: reply_with_perror ("open: /etc/lvm/lvm.conf"); daemon/lvm-filter.c: FILE *ofp = fopen ("/etc/lvm/lvm.conf.new", "w"); daemon/lvm-filter.c: reply_with_perror ("open: /etc/lvm/lvm.conf.new"); daemon/lvm-filter.c: reply_with_error ("/etc/lvm/lvm.conf.new: write failed daemon/lvm-filter.c: unlink ("/etc/lvm/lvm.conf.new"); daemon/lvm-filter.c: reply_with_perror ("/etc/lvm/lvm.conf.new"); daemon/lvm-filter.c: unlink ("/etc/lvm/lvm.conf.new"); daemon/lvm-filter.c: reply_with_perror ("/etc/lvm/lvm.conf.new"); daemon/lvm-filter.c: unlink ("/etc/lvm/lvm.conf.new"); daemon/lvm-filter.c: if (rename ("/etc/lvm/lvm.conf.new", "/etc/lvm/lvm.conf") daemon/lvm-filter.c: reply_with_perror ("rename: /etc/lvm/lvm.conf"); daemon/lvm-filter.c: unlink ("/etc/lvm/lvm.conf.new"); daemon/lvm-filter.c: unlink ("/etc/lvm/cache/.cache"); daemon/mount.c:/* Again, use the external /bin/umount program, so that /etc/mt You need to be cautious with live support and know what you're doing.> [root at longitude ~]# guestmount --live -d F16-rawhide -m /dev/vda3:/ > /mnt/guestfs/ > libguestfs: error: mount_options: mount_options_stub: /dev/vda3: device > not found > libguestfs: error: unexpected procedure number (74/7) > libguestfs: error: unexpected procedure number (7/282)This error is because there is some sort of incompatibility in the protocol between the two versions of libguestfs being used. Again, since live support is still being developed, we haven't (yet) made the protocol stable and compatible between versions. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Richard W.M. Jones
2011-Oct-08 08:34 UTC
[Libguestfs] guestmount issues with --live, but guestfish works just fine
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org -------------- next part -------------- An embedded message was scrubbed... From: "Richard W.M. Jones" <rjones at redhat.com> Subject: Re: [Libguestfs] guestmount issues with --live, but guestfish works just fine Date: Sat, 8 Oct 2011 09:33:31 +0100 Size: 2604 URL: <http://listman.redhat.com/archives/libguestfs/attachments/20111008/e4f7f09d/attachment.eml>