Re: [Libguestfs] guestmount without fstab
[A question about whether it is possible to use guestmount on a guest which does not have /etc/fstab. I've no reproduced this because I'm CC-ing my reply to a public mailing list] It's definitely possible. I would suggest first using $ virt-filesystems -a disk.img --all --long -h to get an idea of what's inside your disk image, then you use a command such as: $ guestmount -a disk.img -m /dev/sda1 /tmp/mnt As for the particular question about lack of /etc/fstab. Are you getting some kind of error when using the guestmount -i option? It used to be (a long time ago) that libguestfs inspection[1] could not handle guests that did not have /etc/fstab, but that should be fixed in recent versions. If you mean, something which isn't a virtual machine disk image, then of course libguestfs can handle these. See reference [2]. Rich. [1] http://libguestfs.org/guestfs.3.html#inspection [2] http://libguestfs.org/guestfs-faq.1.html#whats-the-deal-with-guestfish--i -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com 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/
On Tuesday 23 February 2016 15:21:17 Richard W.M. Jones wrote:
As for the particular question about lack of /etc/fstab. Are you getting some kind of error when using the guestmount -i option? It used to be (a long time ago) that libguestfs inspection[1] could not handle guests that did not have /etc/fstab, but that should be fixed in recent versions.
Not really: /etc/fstab is currently used [1] as criteria to detect whether the content of a partition is the root of a Linux installation. To check what the inspection of libguestfs would find in an image, run the 'virt-inspector' standalone tool and check the <mountpoints> and <filesystems> tags in the resulting XML. [1] src/inspect-fs.c, check_filesystem function Thanks, -- Pino Toscano
On Tue, Feb 23, 2016 at 06:21:34PM +0100, Pino Toscano wrote:
On Tuesday 23 February 2016 15:21:17 Richard W.M. Jones wrote:
As for the particular question about lack of /etc/fstab. Are you getting some kind of error when using the guestmount -i option? It used to be (a long time ago) that libguestfs inspection[1] could not handle guests that did not have /etc/fstab, but that should be fixed in recent versions.
Not really: /etc/fstab is currently used [1] as criteria to detect whether the content of a partition is the root of a Linux installation.
Yup - you're totally right. I was confusing that with the bug we used to have if /etc/fstab was empty (RHBZ#1113156). Something to fix with the new inspection code :-) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On 02/23/2016 08:42 PM, Richard W.M. Jones wrote:
On Tue, Feb 23, 2016 at 06:21:34PM +0100, Pino Toscano wrote:
On Tuesday 23 February 2016 15:21:17 Richard W.M. Jones wrote:
As for the particular question about lack of /etc/fstab. Are you getting some kind of error when using the guestmount -i option? It used to be (a long time ago) that libguestfs inspection[1] could not handle guests that did not have /etc/fstab, but that should be fixed in recent versions.
Not really: /etc/fstab is currently used [1] as criteria to detect whether the content of a partition is the root of a Linux installation.
Yup - you're totally right. I was confusing that with the bug we used to have if /etc/fstab was empty (RHBZ#1113156).
Something to fix with the new inspection code :-)
Rich.
My intended use-case was to mount a container image that lacks kernel, fstab and bootloader, not a full virtual machine. Thank you very much for the explanation. I will try different approaches. Have a nice day, Fero
On Thursday 25 February 2016 10:26:18 Frantisek Kluknavsky wrote:
On 02/23/2016 08:42 PM, Richard W.M. Jones wrote:
On Tue, Feb 23, 2016 at 06:21:34PM +0100, Pino Toscano wrote:
On Tuesday 23 February 2016 15:21:17 Richard W.M. Jones wrote:
As for the particular question about lack of /etc/fstab. Are you getting some kind of error when using the guestmount -i option? It used to be (a long time ago) that libguestfs inspection[1] could not handle guests that did not have /etc/fstab, but that should be fixed in recent versions.
Not really: /etc/fstab is currently used [1] as criteria to detect whether the content of a partition is the root of a Linux installation.
Yup - you're totally right. I was confusing that with the bug we used to have if /etc/fstab was empty (RHBZ#1113156).
Something to fix with the new inspection code :-)
Rich.
My intended use-case was to mount a container image that lacks kernel, fstab and bootloader, not a full virtual machine. Thank you very much for the explanation. I will try different approaches.
I'm working on this, see the two threads starting at: https://www.redhat.com/archives/libguestfs/2016-February/msg00205.html https://www.redhat.com/archives/libguestfs/2016-February/msg00207.html Do your container images have things like: - /etc/hosts - /etc/services ? Thanks, -- Pino Toscano
On Thu, Feb 25, 2016 at 10:26:18AM +0100, Frantisek Kluknavsky wrote:
On 02/23/2016 08:42 PM, Richard W.M. Jones wrote:
On Tue, Feb 23, 2016 at 06:21:34PM +0100, Pino Toscano wrote:
On Tuesday 23 February 2016 15:21:17 Richard W.M. Jones wrote:
As for the particular question about lack of /etc/fstab. Are you getting some kind of error when using the guestmount -i option? It used to be (a long time ago) that libguestfs inspection[1] could not handle guests that did not have /etc/fstab, but that should be fixed in recent versions.
Not really: /etc/fstab is currently used [1] as criteria to detect whether the content of a partition is the root of a Linux installation.
Yup - you're totally right. I was confusing that with the bug we used to have if /etc/fstab was empty (RHBZ#1113156).
Something to fix with the new inspection code :-)
Rich.
My intended use-case was to mount a container image that lacks kernel, fstab and bootloader, not a full virtual machine. Thank you very much for the explanation. I will try different approaches.
There are two parts to this question. (1) Does inspection of such a disk image work? Answer: not at the moment, but Pino is working on fixing that. (2) Can you mount it anyway. YES: You don't need inspection to mount disk images. Please look at my original answer in detail, especially the links I posted. https://www.redhat.com/archives/libguestfs/2016-February/msg00197.html Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (3)
-
Frantisek Kluknavsky -
Pino Toscano -
Richard W.M. Jones