Re: [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 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). 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 ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [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:rjo...@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). ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
On Wed, Aug 01, 2012 at 01:19:45PM -0500, Shawn Kennedy wrote: 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 virt-inspector is hopefully seeing two separate operatingsystem's here. 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). So I think what you're asking is, what root device is currently mounted in the running guest, when you're inspecting the guest from outside (hopefully read-only) using libguestfs. This isn't something that libguestfs can know since all it can see is what is in the disks, not the state of the running guest itself. But there are some heuristics you could use instead: (1) You could look at tell-tale signs to see which root device has most recently been mounted. Probably the simplest thing is to look at the date of /var/log/messages in each potential root, and choose the most recent one (since /var/log/messages is reliably and frequently updated when a guest boots and runs). (2) You could try doing what virt-v2v does, which is to parse the grub configuration to find out what root parameter is being passed to the kernel at boot time. I believe this is the code ... http://git.fedorahosted.org/git/?p=virt-v2v.git;a=blob;f=lib/Sys/VirtConvert/Converter/RedHat.pm;h=6bda68bffad6fc959dbadadee89447df71245491;hb=HEAD#l549 (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 That's odd. It should be in libguestfs-tools-c. Try: rpm -ql libguestfs-tools-c | grep guestfish and check that your $PATH is set correctly. 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://et.redhat.com/~rjones/virt-top ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
Hi Rich, Let's handle the easy one first: # rpm -qa | grep libguestfs-tools-c libguestfs-tools-c-1.7.17-26.el6.x86_64 # rpm -ql libguestfs-tools-c /usr/bin/virt-cat /usr/bin/virt-df /usr/bin/virt-filesystems /usr/bin/virt-inspector2 /usr/bin/virt-ls /usr/bin/virt-rescue /usr/share/man/man1/virt-cat.1.gz /usr/share/man/man1/virt-df.1.gz /usr/share/man/man1/virt-filesystems.1.gz /usr/share/man/man1/virt-inspector2.1.gz /usr/share/man/man1/virt-ls.1.gz /usr/share/man/man1/virt-rescue.1.gz It's not in that package according to my distro (RHEL6.2). Thanks, Shawn -Original Message- From: Richard W.M. Jones [mailto:rjo...@redhat.com] Sent: Wednesday, August 01, 2012 2:54 PM To: Shawn Kennedy Cc: libguestfs@redhat.com; 'Smudde, Mark Alan (Mark)'; 'Tockstein, James E (Jim)' Subject: Re: [Libguestfs] libguestfs question - multiple partitions in the guest On Wed, Aug 01, 2012 at 01:19:45PM -0500, Shawn Kennedy wrote: 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 That's odd. It should be in libguestfs-tools-c. Try: rpm -ql libguestfs-tools-c | grep guestfish and check that your $PATH is set correctly. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
On Wed, Aug 01, 2012 at 08:54:01PM +0100, Richard W.M. Jones wrote: (1) You could look at tell-tale signs to see which root device has most recently been mounted. Probably the simplest thing is to look at the date of /var/log/messages in each potential root, and choose the most recent one (since /var/log/messages is reliably and frequently updated when a guest boots and runs). As in the attached program. Neat!! I just looked at it - very nice!! We will give it a try and report our findings! If it does work, we will have to convert it to Python (preferred). Thanks! Shawn ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
-Original Message- From: libguestfs-boun...@redhat.com [mailto:libguestfs-boun...@redhat.com] On Behalf Of Shawn Kennedy Sent: Wednesday, August 01, 2012 3:34 PM To: libguestfs@redhat.com Cc: 'Smudde, Mark Alan (Mark)'; 'Tockstein, James E (Jim)' Subject: Re: [Libguestfs] libguestfs question - multiple partitions in the guest On Wed, Aug 01, 2012 at 08:54:01PM +0100, Richard W.M. Jones wrote: (1) You could look at tell-tale signs to see which root device has most recently been mounted. Probably the simplest thing is to look at the date of /var/log/messages in each potential root, and choose the most recent one (since /var/log/messages is reliably and frequently updated when a guest boots and runs). As in the attached program. Neat!! I just looked at it - very nice!! We will give it a try and report our findings! If it does work, we will have to convert it to Python (preferred). Success!! # ./mostrecent.pl /storage/images/guest.img Youngest root filesystem is: /dev/VG1/LV0002.root With that knowledge, we can then mount (ro) the right mount point and inspect further! Thank you again! Shawn ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
On Wed, Aug 01, 2012 at 03:23:24PM -0500, Shawn Kennedy wrote: Hi Rich, Let's handle the easy one first: # rpm -qa | grep libguestfs-tools-c libguestfs-tools-c-1.7.17-26.el6.x86_64 # rpm -ql libguestfs-tools-c /usr/bin/virt-cat /usr/bin/virt-df /usr/bin/virt-filesystems /usr/bin/virt-inspector2 /usr/bin/virt-ls /usr/bin/virt-rescue /usr/share/man/man1/virt-cat.1.gz /usr/share/man/man1/virt-df.1.gz /usr/share/man/man1/virt-filesystems.1.gz /usr/share/man/man1/virt-inspector2.1.gz /usr/share/man/man1/virt-ls.1.gz /usr/share/man/man1/virt-rescue.1.gz It's not in that package according to my distro (RHEL6.2). Sorry .. it's RHEL 6.2 so the package is called 'guestfish'. # yum install guestfish 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 ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
-Original Message- From: Richard W.M. Jones [mailto:rjo...@redhat.com] Sent: Wednesday, August 01, 2012 3:53 PM To: Shawn Kennedy Cc: libguestfs@redhat.com; 'Smudde, Mark Alan (Mark)'; 'Tockstein, James E (Jim)' Subject: Re: [Libguestfs] libguestfs question - multiple partitions in the guest On Wed, Aug 01, 2012 at 03:23:24PM -0500, Shawn Kennedy wrote: Hi Rich, Let's handle the easy one first: # rpm -qa | grep libguestfs-tools-c libguestfs-tools-c-1.7.17-26.el6.x86_64 # rpm -ql libguestfs-tools-c /usr/bin/virt-cat /usr/bin/virt-df /usr/bin/virt-filesystems /usr/bin/virt-inspector2 /usr/bin/virt-ls /usr/bin/virt-rescue /usr/share/man/man1/virt-cat.1.gz /usr/share/man/man1/virt-df.1.gz /usr/share/man/man1/virt-filesystems.1.gz /usr/share/man/man1/virt-inspector2.1.gz /usr/share/man/man1/virt-ls.1.gz /usr/share/man/man1/virt-rescue.1.gz It's not in that package according to my distro (RHEL6.2). Sorry .. it's RHEL 6.2 so the package is called 'guestfish'. # yum install guestfish Ah nuts! Looks like I missed a package when I pulled everything together!! Thanks, I will add accordingly! Shawn ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
-Original Message- From: libguestfs-boun...@redhat.com [mailto:libguestfs-boun...@redhat.com] On Behalf Of Shawn Kennedy From: Richard W.M. Jones [mailto:rjo...@redhat.com] (2) You could try doing what virt-v2v does, which is to parse the grub configuration to find out what root parameter is being passed to the kernel at boot time. I believe this is the code ... http://git.fedorahosted.org/git/?p=virt- v2v.git;a=blob;f=lib/Sys/VirtConvert/Converter/RedHat.pm;h=6bda68bffad6fc959dbadadee89447df71245491;hb=H EAD#l549 We will look into seeing what this is doing. looking at the grub config will be the most correct way. That URL doesn't work. Do you have a working link?? Thanks! Shawn ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
On Wed, Aug 01, 2012 at 03:31:19PM -0500, Shawn Kennedy wrote: I wonder - maybe an new tool (virt-grub) to dump out the grub content of the guest image (if linux)!! :-) :-) :-) It's actually pretty simple to script this. See attached (requires a grub1 guest). 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 #!/usr/bin/python import sys import re import guestfs assert (len (sys.argv) == 2) disk = sys.argv[1] g = guestfs.GuestFS () # Attach the disk image read-only to libguestfs. g.add_drive_opts (disk, readonly=1) # Run the libguestfs back-end. g.launch () # Ask libguestfs to inspect for operating systems. roots = g.inspect_os () for root in roots: print (root: %s % root) # Mount up the disks, like guestfish -i. mps = g.inspect_get_mountpoints (root) def compare (a, b): if len(a[0]) len(b[0]): return 1 elif len(a[0]) == len(b[0]): return 0 else: return -1 mps.sort (compare) for mp_dev in mps: try: g.mount_ro (mp_dev[1], mp_dev[0]) except RuntimeError as msg: print %s (ignored) % msg # Run Augeas on the guest. g.aug_init (/, 0) # Display grub configuration recursively. def display (node): xs = g.aug_match (%s/* % node) for x in xs: try: y = g.aug_get (x) print x, , y except RuntimeError: pass display (x) display (/files/etc/grub.conf) g.aug_close () # Unmount everything. g.umount_all () ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
On Wed, Aug 01, 2012 at 04:02:27PM -0500, Shawn Kennedy wrote: -Original Message- From: libguestfs-boun...@redhat.com [mailto:libguestfs-boun...@redhat.com] On Behalf Of Shawn Kennedy From: Richard W.M. Jones [mailto:rjo...@redhat.com] (2) You could try doing what virt-v2v does, which is to parse the grub configuration to find out what root parameter is being passed to the kernel at boot time. I believe this is the code ... http://git.fedorahosted.org/git/?p=virt- v2v.git;a=blob;f=lib/Sys/VirtConvert/Converter/RedHat.pm;h=6bda68bffad6fc959dbadadee89447df71245491;hb=H EAD#l549 We will look into seeing what this is doing. looking at the grub config will be the most correct way. That URL doesn't work. Do you have a working link?? That's strange, did fedorahosted just switch from gitweb to cgit? http://git.fedorahosted.org/cgit/virt-v2v.git/tree/lib/Sys/VirtConvert/Converter/RedHat.pm#n549 or: http://bit.ly/Mk4XAg Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
-Original Message- From: Richard W.M. Jones [mailto:rjo...@redhat.com] On Wed, Aug 01, 2012 at 04:02:27PM -0500, Shawn Kennedy wrote: -Original Message- From: libguestfs-boun...@redhat.com [mailto:libguestfs-boun...@redhat.com] On Behalf Of Shawn Kennedy From: Richard W.M. Jones [mailto:rjo...@redhat.com] (2) You could try doing what virt-v2v does, which is to parse the grub configuration to find out what root parameter is being passed to the kernel at boot time. I believe this is the code ... http://git.fedorahosted.org/git/?p=virt- v2v.git;a=blob;f=lib/Sys/VirtConvert/Converter/RedHat.pm;h=6bda68bffad6fc959dbadadee89447df71245491;hb=H EAD#l549 We will look into seeing what this is doing. looking at the grub config will be the most correct way. That URL doesn't work. Do you have a working link?? That's strange, did fedorahosted just switch from gitweb to cgit? http://git.fedorahosted.org/cgit/virt-v2v.git/tree/lib/Sys/VirtConvert/Converter/RedHat.pm#n549 or: http://bit.ly/Mk4XAg Success! I can view it now. Thanks! Shawn ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
-Original Message- From: Richard W.M. Jones [mailto:rjo...@redhat.com] Sent: Wednesday, August 01, 2012 4:22 PM To: Shawn Kennedy Cc: libguestfs@redhat.com; 'Smudde, Mark Alan (Mark)'; 'Tockstein, James E (Jim)' Subject: Re: [Libguestfs] libguestfs question - multiple partitions in the guest On Wed, Aug 01, 2012 at 03:31:19PM -0500, Shawn Kennedy wrote: I wonder - maybe an new tool (virt-grub) to dump out the grub content of the guest image (if linux)!! :-) :-) :-) It's actually pretty simple to script this. See attached (requires a grub1 guest). Luckily, we still are grub1 . # grub --version grub (GNU GRUB 0.97) So I ran it and it tells me I have 2 OSs ... root: /dev/VG1/LV0001.root root: /dev/VG1/LV0002.root I thought it might dump the running grub, but then again, it doesn't know what running is it looks like using /var/log/messages file to determine what is (likely) mounted in the guest. Thanks! Shawn ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
On Wed, Aug 01, 2012 at 05:02:28PM -0500, Shawn Kennedy wrote: -Original Message- From: Richard W.M. Jones [mailto:rjo...@redhat.com] Sent: Wednesday, August 01, 2012 4:22 PM To: Shawn Kennedy Cc: libguestfs@redhat.com; 'Smudde, Mark Alan (Mark)'; 'Tockstein, James E (Jim)' Subject: Re: [Libguestfs] libguestfs question - multiple partitions in the guest On Wed, Aug 01, 2012 at 03:31:19PM -0500, Shawn Kennedy wrote: I wonder - maybe an new tool (virt-grub) to dump out the grub content of the guest image (if linux)!! :-) :-) :-) It's actually pretty simple to script this. See attached (requires a grub1 guest). Luckily, we still are grub1 . # grub --version grub (GNU GRUB 0.97) So I ran it and it tells me I have 2 OSs ... root: /dev/VG1/LV0001.root root: /dev/VG1/LV0002.root I thought it might dump the running grub, [...] I thought it would do too. One problem with Augeas is that it relies on the exact location of the configuration file. You can try changing: display (/files/etc/grub.conf) to: display (/files) and see if the grub config shows up anywhere in the (likely to be huge) output. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
-Original Message- From: Richard W.M. Jones [mailto:rjo...@redhat.com] Sent: Wednesday, August 01, 2012 5:09 PM To: Shawn Kennedy Cc: libguestfs@redhat.com; 'Smudde, Mark Alan (Mark)'; 'Tockstein, James E (Jim)' Subject: Re: [Libguestfs] libguestfs question - multiple partitions in the guest On Wed, Aug 01, 2012 at 05:02:28PM -0500, Shawn Kennedy wrote: -Original Message- From: Richard W.M. Jones [mailto:rjo...@redhat.com] Sent: Wednesday, August 01, 2012 4:22 PM To: Shawn Kennedy Cc: libguestfs@redhat.com; 'Smudde, Mark Alan (Mark)'; 'Tockstein, James E (Jim)' Subject: Re: [Libguestfs] libguestfs question - multiple partitions in the guest On Wed, Aug 01, 2012 at 03:31:19PM -0500, Shawn Kennedy wrote: I wonder - maybe an new tool (virt-grub) to dump out the grub content of the guest image (if linux)!! :-) :-) :-) It's actually pretty simple to script this. See attached (requires a grub1 guest). Luckily, we still are grub1 . # grub --version grub (GNU GRUB 0.97) So I ran it and it tells me I have 2 OSs ... root: /dev/VG1/LV0001.root root: /dev/VG1/LV0002.root I thought it might dump the running grub, [...] I thought it would do too. One problem with Augeas is that it relies on the exact location of the configuration file. You can try changing: display (/files/etc/grub.conf) to: display (/files) and see if the grub config shows up anywhere in the (likely to be huge) output. You are right /files is a very big list and after 10+ minutes of running, it wasn't done. I narrowed it down (/files/boot) to see if I could find the files in /boot (after all, /boot/grub/grub.com is where it really is) and alas, it doesn't find it, just found this: root: /dev/VG1/LV0001.root /files/boot/grub/device.map/hd0 /dev/vda root: /dev/VG1/LV0002.root /files/boot/grub/device.map/hd0 /dev/vda Thanks, Shawn ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs