PATCH: Allow specifying the filesystem driver for guestmount
Currently guestfish has mount-vfs, and the libguestfs API has guestfs_mount_vfs(), but guestmount doesn't allow the user to specify a filesystem. This patch extends the --mount argument, so you can force an ext2 partition to mount as ext4: guestmount -a mydisk.img -m /dev/vda:/:defaults:ext4 mountpoint You could also use it to choose between ntfs and ntfs-3g, or between hfsplus and the commercial ufsd. Finally, it could be useful if blkid misidentifies the filesystem. GitHub compare doodad: https://github.com/vasi/libguestfs/compare/fuse-fstype Patch: https://github.com/vasi/libguestfs/compare/fuse-fstype.patch Thanks for making such a useful utility! -V
On Wed, May 08, 2013 at 10:01:26PM -0400, Dave Vasilevsky wrote:
Currently guestfish has mount-vfs, and the libguestfs API has guestfs_mount_vfs(), but guestmount doesn't allow the user to specify a filesystem. This patch extends the --mount argument, so you can force an ext2 partition to mount as ext4:
guestmount -a mydisk.img -m /dev/vda:/:defaults:ext4 mountpoint
You could also use it to choose between ntfs and ntfs-3g, or between hfsplus and the commercial ufsd. Finally, it could be useful if blkid misidentifies the filesystem.
GitHub compare doodad: https://github.com/vasi/libguestfs/compare/fuse-fstype Patch: https://github.com/vasi/libguestfs/compare/fuse-fstype.patch
ACK. I'll push this later on today after I've done a few tests. In answer to your other question about the incompatible protocol between libguestfs 1.18 on the host and 1.21 in the appliance, I realized why this was happening. It's because of the changes that were made in libguestfs 1.20 where we reimplemented various calls to avoid protocol limits. This means these calls are no longer implemented in the daemon, but instead are emulated on the library side. The calls affected were: guestfs_cat, guestfs_find, guestfs_read_file, guestfs_read_lines, guestfs_write, guestfs_write_append, guestfs_lstatlist, guestfs_lxattrlist, guestfs_readlinklist, guestfs_ls Which means that these calls would break, whereas others would still work fine. In any case, I believe it'll be better for you to upgrade the host side to at least libguestfs 1.20. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Thanks for investigating! Hopefully the protocol compatibility can be documented--it would be good to know in other situations where one is forced to use a fixed appliance, like on BSD and OS X. There's one more little thing that came up. You recommended in IRC that for testing I do "LIBGUESTFS_PATH=/path/to/appliance ./run ./fish/guestfish ...". But it turns out that the ./run script unconditionally overwrites LIBGUESTFS_PATH, preferring the local "appliance" directory. This was easy to work around, but I thought you should be aware of it, in case it's not the intended behaviour. This crazy project does seem to be working, and I now have write access to journaled HFS+ from Linux! I'll write some documentation for others who want to try it, and of course libguestfs will feature prominently. Dave
On Thu, May 09, 2013 at 12:31:07PM -0400, Dave Vasilevsky wrote:
Thanks for investigating! Hopefully the protocol compatibility can be documented--it would be good to know in other situations where one is forced to use a fixed appliance, like on BSD and OS X.
There's one more little thing that came up. You recommended in IRC that for testing I do "LIBGUESTFS_PATH=/path/to/appliance ./run ./fish/guestfish ...". But it turns out that the ./run script unconditionally overwrites LIBGUESTFS_PATH, preferring the local "appliance" directory. This was easy to work around, but I thought you should be aware of it, in case it's not the intended behaviour.
Yup, that is sort of a bug, although it's hard to know what is best to do. I suppose we should assume if the user has set LIBGUESTFS_PATH then they really want that path, and not the local appliance/ path. Another way to look at it would be to disable setting that environment variable if libguestfs was configured with --disable-appliance.
This crazy project does seem to be working, and I now have write access to journaled HFS+ from Linux! I'll write some documentation for others who want to try it, and of course libguestfs will feature prominently.
Thanks, 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
participants (2)
-
Dave Vasilevsky -
Richard W.M. Jones