libguestfs and zfs-fuse
I'm wondering whether or not anyone has tried to use guestmount on an image with a ZFS partition (MBR partition table). I can't seem to find much on the internet regarding it, but I do see hints that may lead me to a solution. I'm under the impression that libguestfs can use what ever is available to the kernel on the host -- in my case I have zfs-use installed and running. I can't seem to mount the image, however. It's the exact same problem stated in this link[1], however I'm not able to discern what exactly is needed to have guestmount be aware that the volume is a zfs partition. In my trace, I see the following (larger selection here[2]): libguestfs: recv_from_daemon: received GUESTFS_LAUNCH_FLAG libguestfs: [03558ms] appliance is up libguestfs: trace: launch = 0 libguestfs: trace: mount_options "" "/dev/sda1" "/" 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 | ... guestfsd: main_loop: new request, len 0x44 /dev/sda1: No such file or directory mount -o /dev/vda1 /sysroot/ mount: unknown filesystem type 'zfs_member' guestfsd: error: /dev/vda1 on /: mount: unknown filesystem type 'zfs_member' From the aforementioned link, I should use zpool import -d $(dir) -R (mountpoint) to mount ZFS filesystems, however I'm not sure how to reconcile that with the 'guestmount' command or whether or not it's a possibility. Since zfs-fuse is a dependency of libguestfs itself, though, I'm hoping someone has made the attempt other than myself and can provide a bit of insight, thanks in advance! [1]https://bbs.archlinux.org/viewtopic.php?pid=1279000 [2]http://pastebin.com/dw0vyWB1 -- Andre Goree -=-=-=-=-=- Email - andre at drenet.net Website - http://www.drenet.net PGP key - http://www.drenet.net/pubkey.txt -=-=-=-=-=-
On Mon, Feb 03, 2014 at 03:12:28PM -0500, Andre Goree wrote:
I'm wondering whether or not anyone has tried to use guestmount on an image with a ZFS partition (MBR partition table). I can't seem to find much on the internet regarding it, but I do see hints that may lead me to a solution. I'm under the impression that libguestfs can use what ever is available to the kernel on the host -- in my case I have zfs-use installed and running. I can't seem to mount the image, however.
Libguestfs can .. however we've never actually wired up ZFS support in the API, and therefore ZFS currently will not work from guestmount. It should be relatively easy to make it work. Are there any ZFS-based test images we can test against? I was testing a Solaris 11 image a few weeks ago but unfortunately Linux couldn't make any sense of it at all -- it seemed to be a much more fundamental problem at the partition level, and nothing specifically to do with ZFS.
From the aforementioned link, I should use zpool import -d $(dir) -R (mountpoint) to mount ZFS filesystems, however I'm not sure how to reconcile that with the 'guestmount' command or whether or not it's a possibility. Since zfs-fuse is a dependency of libguestfs itself, though, I'm hoping someone has made the attempt other than myself and can provide a bit of insight, thanks in advance!
zfs-fuse is a dependency of libguestfs only so that you can use zpool etc commands in the virt-rescue shell. We have never got around to wiring up ZFS in the libguestfs API itself. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On 02/03/2014 3:16 pm, Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 03:12:28PM -0500, Andre Goree wrote:
I'm wondering whether or not anyone has tried to use guestmount on an image with a ZFS partition (MBR partition table). I can't seem to find much on the internet regarding it, but I do see hints that may lead me to a solution. I'm under the impression that libguestfs can use what ever is available to the kernel on the host -- in my case I have zfs-use installed and running. I can't seem to mount the image, however.
Libguestfs can .. however we've never actually wired up ZFS support in the API, and therefore ZFS currently will not work from guestmount.
It should be relatively easy to make it work. Are there any ZFS-based test images we can test against? I was testing a Solaris 11 image a few weeks ago but unfortunately Linux couldn't make any sense of it at all -- it seemed to be a much more fundamental problem at the partition level, and nothing specifically to do with ZFS.
Ahhh, understood. I do have have an image I can provide that was installed onto and MBR layout (seemed the easiest for libguestfs to understand, GPT is preferred if libguestfs works well with it, but that's another matter I can look into later). Standby let me clean it up a bit and I'll get it to you -- I'll put it on my box and send ya a link offlist.
From the aforementioned link, I should use zpool import -d $(dir) -R (mountpoint) to mount ZFS filesystems, however I'm not sure how to reconcile that with the 'guestmount' command or whether or not it's a possibility. Since zfs-fuse is a dependency of libguestfs itself, though, I'm hoping someone has made the attempt other than myself and can provide a bit of insight, thanks in advance!
zfs-fuse is a dependency of libguestfs only so that you can use zpool etc commands in the virt-rescue shell. We have never got around to wiring up ZFS in the libguestfs API itself.
Rich.
Makes sense, thanks for clarifying. -- Andre Goree -=-=-=-=-=- Email - andre at drenet.net Website - http://www.drenet.net PGP key - http://www.drenet.net/pubkey.txt -=-=-=-=-=-
On Mon, Feb 03, 2014 at 03:29:37PM -0500, Andre Goree wrote:
Ahhh, understood. I do have have an image I can provide that was installed onto and MBR layout (seemed the easiest for libguestfs to understand, GPT is preferred if libguestfs works well with it, but that's another matter I can look into later). Standby let me clean it up a bit and I'll get it to you -- I'll put it on my box and send ya a link offlist.
Yes it would be useful to have this image. Either MBR or GPT should work equally well. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
On Mon, Feb 03, 2014 at 09:14:09PM +0000, Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 03:29:37PM -0500, Andre Goree wrote:
Ahhh, understood. I do have have an image I can provide that was installed onto and MBR layout (seemed the easiest for libguestfs to understand, GPT is preferred if libguestfs works well with it, but that's another matter I can look into later). Standby let me clean it up a bit and I'll get it to you -- I'll put it on my box and send ya a link offlist.
Yes it would be useful to have this image. Either MBR or GPT should work equally well.
FYI Andre sent me a disk image: $ qemu-img info FreeBSD_ZFS-test.qcow2 image: FreeBSD_ZFS-test.qcow2 file format: qcow2 virtual size: 1.0G (1073741824 bytes) disk size: 1.0G cluster_size: 65536 $ guestfish --ro -a FreeBSD_ZFS-test.qcow2 Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell
<fs> run <fs> list-filesystems <fs> list-partitions /dev/sda1 <fs> file /dev/sda1 ; partition 4: ID=0xa5, active, starthead 0, startsector 0, 50000 sectors <fs> vfs-type /dev/sda1 zfs_member
I tried opening it with virt-rescue, but for some reason the zfs-fuse daemon would not start, and hence other commands such as zpool didn't work. I opened a bug to look at enabling ZFS: https://bugzilla.redhat.com/show_bug.cgi?id=1061040 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On 02/04/2014 4:54 am, Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 09:14:09PM +0000, Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 03:29:37PM -0500, Andre Goree wrote:
Ahhh, understood. I do have have an image I can provide that was installed onto and MBR layout (seemed the easiest for libguestfs to understand, GPT is preferred if libguestfs works well with it, but that's another matter I can look into later). Standby let me clean it up a bit and I'll get it to you -- I'll put it on my box and send ya a link offlist.
Yes it would be useful to have this image. Either MBR or GPT should work equally well.
FYI Andre sent me a disk image:
$ qemu-img info FreeBSD_ZFS-test.qcow2 image: FreeBSD_ZFS-test.qcow2 file format: qcow2 virtual size: 1.0G (1073741824 bytes) disk size: 1.0G cluster_size: 65536
$ guestfish --ro -a FreeBSD_ZFS-test.qcow2
Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images.
Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell
<fs> run <fs> list-filesystems <fs> list-partitions /dev/sda1 <fs> file /dev/sda1 ; partition 4: ID=0xa5, active, starthead 0, startsector 0, 50000 sectors <fs> vfs-type /dev/sda1 zfs_member
I tried opening it with virt-rescue, but for some reason the zfs-fuse daemon would not start, and hence other commands such as zpool didn't work. I opened a bug to look at enabling ZFS:
https://bugzilla.redhat.com/show_bug.cgi?id=1061040
Rich.
Thanks Rich. -- Andre Goree -=-=-=-=-=- Email - andre at drenet.net Website - http://www.drenet.net PGP key - http://www.drenet.net/pubkey.txt -=-=-=-=-=-
On Tuesday 04 February 2014 09:54:58 Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 09:14:09PM +0000, Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 03:29:37PM -0500, Andre Goree wrote:
Ahhh, understood. I do have have an image I can provide that was installed onto and MBR layout (seemed the easiest for libguestfs to understand, GPT is preferred if libguestfs works well with it, but that's another matter I can look into later). Standby let me clean it up a bit and I'll get it to you -- I'll put it on my box and send ya a link offlist.
Yes it would be useful to have this image. Either MBR or GPT should work equally well.
FYI Andre sent me a disk image:
$ qemu-img info FreeBSD_ZFS-test.qcow2 image: FreeBSD_ZFS-test.qcow2 file format: qcow2 virtual size: 1.0G (1073741824 bytes) disk size: 1.0G cluster_size: 65536
$ guestfish --ro -a FreeBSD_ZFS-test.qcow2
Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images.
Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell
<fs> run <fs> list-filesystems <fs> list-partitions
/dev/sda1
<fs> file /dev/sda1
; partition 4: ID=0xa5, active, starthead 0, startsector 0, 50000 sectors
<fs> vfs-type /dev/sda1
zfs_member
I tried opening it with virt-rescue, but for some reason the zfs-fuse daemon would not start, and hence other commands such as zpool didn't work.
I've taken a quick look at this, and got a bit more with:
<rescue> ln -s ../run/lock /var/lock <rescue> zfs-fuse-helper start Starting zfs-fuse: [ OK ] Immunizing zfs-fuse against OOM kills[ OK ] Mounting zfs partitions: [ OK ] and after this the zpool/zfs commands were usable.
Just note that: a) the first command is not needed now with the newly released development version libguestfs 1.25.33 b) I couldn't mount the image you provided, since it was created with versions of zpool and zfs greater than what zfs-fuse currently supports (it seems not having been updated in a while...) so even if we automate somehow the starting of the zfs-fuse helper and the handling of zpool/zfs, I'm not sure it could be actually useful with a zfs-fuse not supporting recent versions. (To have a test partition with ZFS, I had to create it on a Debian/kFreeBSD 6.0 (oldstable), as even Debian/kFreeBSD 7 (stable) had "too new" zfs stuff for zfs-fuse.) -- Pino Toscano
On 02/05/2014 11:31 am, Pino Toscano wrote:
On Tuesday 04 February 2014 09:54:58 Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 09:14:09PM +0000, Richard W.M. Jones wrote:
On Mon, Feb 03, 2014 at 03:29:37PM -0500, Andre Goree wrote:
Ahhh, understood. I do have have an image I can provide that was installed onto and MBR layout (seemed the easiest for libguestfs to understand, GPT is preferred if libguestfs works well with it, but that's another matter I can look into later). Standby let me clean it up a bit and I'll get it to you -- I'll put it on my box and send ya a link offlist.
Yes it would be useful to have this image. Either MBR or GPT should work equally well.
FYI Andre sent me a disk image:
$ qemu-img info FreeBSD_ZFS-test.qcow2 image: FreeBSD_ZFS-test.qcow2 file format: qcow2 virtual size: 1.0G (1073741824 bytes) disk size: 1.0G cluster_size: 65536
$ guestfish --ro -a FreeBSD_ZFS-test.qcow2
Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images.
Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell
<fs> run <fs> list-filesystems <fs> list-partitions
/dev/sda1
<fs> file /dev/sda1
; partition 4: ID=0xa5, active, starthead 0, startsector 0, 50000 sectors
<fs> vfs-type /dev/sda1
zfs_member
I tried opening it with virt-rescue, but for some reason the zfs-fuse daemon would not start, and hence other commands such as zpool didn't work.
I've taken a quick look at this, and got a bit more with:
<rescue> ln -s ../run/lock /var/lock <rescue> zfs-fuse-helper start Starting zfs-fuse: [ OK ] Immunizing zfs-fuse against OOM kills[ OK ] Mounting zfs partitions: [ OK ] and after this the zpool/zfs commands were usable.
Just note that: a) the first command is not needed now with the newly released development version libguestfs 1.25.33 b) I couldn't mount the image you provided, since it was created with versions of zpool and zfs greater than what zfs-fuse currently supports (it seems not having been updated in a while...) so even if we automate somehow the starting of the zfs-fuse helper and the handling of zpool/zfs, I'm not sure it could be actually useful with a zfs-fuse not supporting recent versions. (To have a test partition with ZFS, I had to create it on a Debian/kFreeBSD 6.0 (oldstable), as even Debian/kFreeBSD 7 (stable) had "too new" zfs stuff for zfs-fuse.)
Interesting, I had no idea zfs-fuse was so far behind. Thanks for checking it out. -- Andre Goree -=-=-=-=-=- Email - andre at drenet.net Website - http://www.drenet.net PGP key - http://www.drenet.net/pubkey.txt -=-=-=-=-=-
participants (3)
-
Andre Goree -
Pino Toscano -
Richard W.M. Jones