Richard W.M. Jones
2012-Aug-01 17:16 UTC
[Libguestfs] libguestfs question - multiple partitions in the guest
On Wed, Aug 01, 2012 at 11:47:14AM -0500, Shawn Kennedy wrote:> Problem: > When trying to inspect the guest using a command like 'virt-ls', we > get back: > > ~]# virt-ls -d guest /path > virt-ls: multi-boot operating systems are not supported by the -i optionWhat does virt-inspector2 [this is RHEL 6] display for this guest? virt-inspector2 -d guest virt-ls fundamentally doesn't work with multi-boot guests. However that doesn't mean to say you can't use libguestfs, you just need to use some lower level tools or write a Perl/Python/whatever script against the API. Have a look at the second example in the guestfs-perl(3) / guestfs-python(3) man pages to give you some ideas how to go about this. By the way it's probably better to use the RHEL 6.3 package, libguestfs 1.16.19, since it has more bugs fixed.> Question: > We know it's because we have 2 filesystems in the guest and > we have no problem using the '-m' option on the lower-level tools, > but how do we know which filesystem is mounted?? A simple > 'mount' command could tell us that, but how to run it if I > don't know which -m mount point to use??If I understand your question correctly, then the 'mountpoints' command lists what is mounted, eg: $ guestfish -c qemu:///system -d F16x64 -i --ro 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 Operating system: Fedora release 16 (Verne) /dev/mapper/vg_f16x64-lv_root mounted on / /dev/vda2 mounted on /boot ><fs> mountpoints /dev/vg_f16x64/lv_root: / /dev/vda2: /boot (or 'mounts' which does the same but only lists the devices). Please send replies to the mailing list. I hopefully deleted any specifics of your environment in this reply. 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 Xen guests. http://et.redhat.com/~rjones/virt-p2v
Shawn Kennedy
2012-Aug-01 18:19 UTC
[Libguestfs] libguestfs question - multiple partitions in the guest
Hi Richard, Because I have 2 filesystems (one in a mounted LV and one in a unmounted LV), I get 2 sets of mountpoints in virt-inspector2 .... <mountpoints> <mountpoint dev="/dev/VG1/LV0001.root">/</mountpoint> <mountpoint dev="/dev/VG1/LV0001.var">/var</mountpoint> <mountpoint dev="/dev/VG1/LV0001.app1">/app1</mountpoint> <mountpoint dev="/dev/sda1">/boot</mountpoint> <mountpoint dev="/dev/VG1/home">/home</mountpoint> <mountpoint dev="/dev/VG1/logs">/logs</mountpoint> <mountpoint dev="/dev/VG1/cores">/cores</mountpoint> <mountpoint dev="/dev/VG1/storage">/storage</mountpoint> </mountpoints> <mountpoints> <mountpoint dev="/dev/VG1/LV0002.root">/</mountpoint> <mountpoint dev="/dev/VG1/LV0002.var">/var</mountpoint> <mountpoint dev="/dev/VG1/LV0002.app1">/app1</mountpoint> <mountpoint dev="/dev/sda1">/boot</mountpoint> <mountpoint dev="/dev/VG1/home">/home</mountpoint> <mountpoint dev="/dev/VG1/logs">/logs</mountpoint> <mountpoint dev="/dev/VG1/cores">/cores</mountpoint> <mountpoint dev="/dev/VG1/storage">/storage</mountpoint> </mountpoints> So, which one is the real one?? If I log into the guest directly, I know the /dev/VG1/LV0002* is the mounted partition (by using 'mount' command or by examining /etc/fstab). (from the guest) # mount | grep root /dev/mapper/VG1-LV0002.root on / type ext3 (rw) As much as I would like to, we cannot move the RHEL release to the next release. Project restrictions and all ... :-) Lastly, where is 'guestfish' installed on the system?? It's not installed on my system, even though I have installed the RHEL6.2 RPMs. # rpm -qa | grep libguest python-libguestfs-1.7.17-26.el6.x86_64 libguestfs-1.7.17-26.el6.x86_64 libguestfs-tools-c-1.7.17-26.el6.x86_64 libguestfs-mount-1.7.17-26.el6.x86_64 libguestfs-tools-1.7.17-26.el6.x86_64 # guestfish -bash: guestfish: command not found> -----Original Message----- > From: Richard W.M. Jones [mailto:rjones at redhat.com] > On Wed, Aug 01, 2012 at 11:47:14AM -0500, Shawn Kennedy wrote: > > Problem: > > When trying to inspect the guest using a command like 'virt-ls', we > > get back: > > > > ~]# virt-ls -d guest /path > > virt-ls: multi-boot operating systems are not supported by the -i option > > What does virt-inspector2 [this is RHEL 6] display for this guest? > > virt-inspector2 -d guest > > virt-ls fundamentally doesn't work with multi-boot guests. However > that doesn't mean to say you can't use libguestfs, you just need to > use some lower level tools or write a Perl/Python/whatever script > against the API. Have a look at the second example in the > guestfs-perl(3) / guestfs-python(3) man pages to give you some ideas > how to go about this. > > By the way it's probably better to use the RHEL 6.3 package, > libguestfs 1.16.19, since it has more bugs fixed. > > > Question: > > We know it's because we have 2 filesystems in the guest and > > we have no problem using the '-m' option on the lower-level tools, > > but how do we know which filesystem is mounted?? A simple > > 'mount' command could tell us that, but how to run it if I > > don't know which -m mount point to use?? > > If I understand your question correctly, then the 'mountpoints' > command lists what is mounted, eg: > > $ guestfish -c qemu:///system -d F16x64 -i --ro > > 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 > > Operating system: Fedora release 16 (Verne) > /dev/mapper/vg_f16x64-lv_root mounted on / > /dev/vda2 mounted on /boot > > ><fs> mountpoints > /dev/vg_f16x64/lv_root: / > /dev/vda2: /boot > > (or 'mounts' which does the same but only lists the devices).
Apparently Analagous Threads
- [PATCH] New APIs: {compress, gzip, xz}-out, {compress, gzip, xz}-device-out.
- 【help】why not support showing filename containing chinese characters with the ls function?
- Re: LVM mounting issue
- can''t mount vfat fs on lvm created by winxp guest
- LVM & volume groups