7 # Look for LVM LVs, VGs and PVs in a guest image.
9 die "Usage: lvs.pl guest.img\n" if @ARGV != 1 || ! -f $ARGV[0];
11 print "Creating the libguestfs handle\n";
12 my $h = Sys::Guestfs->new ();
13 $h->add_drive_opts ($ARGV[0], format => "raw");
15 print "Launching, this can take a few seconds\n";
18 print "Looking for PVs on the disk image\n";
20 print "PVs found: (", join (", ", @pvs), ")\n";
22 print "Looking for VGs on the disk image\n";
24 print "VGs found: (", join (", ", @vgs), ")\n";
26 print "Looking for LVs on the disk image\n";
28 print "LVs found: (", join (", ", @lvs), ")\n";