Close the current Augeas handle and free up any resources
used by it. After calling this, you have to call
-C<aug_init> again before you can use any other
+C<aug-init> again before you can use any other
Augeas functions.
=head2 aug-defnode
evaluating C<expr>.
If C<expr> evaluates to an empty nodeset, a node is created,
-equivalent to calling C<aug_set> C<expr>, C<value>.
+equivalent to calling C<aug-set> C<expr>, C<value>.
C<name> will be the nodeset containing that single node.
On success this returns a pair containing the
If there was any previous Augeas handle associated with this
guestfs session, then it is closed.
-You must call this before using any other C<aug_*>
+You must call this before using any other C<aug-*>
commands.
C<root> is the filesystem root. C<root> must not be NULL,
=item C<AUG_NO_LOAD> = 32
-Do not load the tree in C<aug_init>.
+Do not load the tree in C<aug-init>.
=back
-To close the handle, you can call C<aug_close>.
+To close the handle, you can call C<aug-close>.
To find out more about Augeas, see L<http://augeas.net/>.
aug-ls path
-This is just a shortcut for listing C<aug_match>
+This is just a shortcut for listing C<aug-match>
C<path/*> and sorting the resulting nodes into alphabetical order.
=head2 aug-match
This writes all pending changes to disk.
-The flags which were passed to C<aug_init> affect exactly
+The flags which were passed to C<aug-init> affect exactly
how files are saved.
=head2 aug-set
This returns the size of the device in bytes.
-See also C<blockdev_getsz>.
+See also C<blockdev-getsz>.
This uses the L<blockdev(8)> command.
This returns the size of sectors on a block device.
Usually 512, but can be larger for modern devices.
-(Note, this is not the size in sectors, use C<blockdev_getsz>
+(Note, this is not the size in sectors, use C<blockdev-getsz>
for that).
This uses the L<blockdev(8)> command.
This returns the size of the device in units of 512-byte sectors
(even if the sectorsize isn't 512 bytes ... weird).
-See also C<blockdev_getss> for the real sector size of
-the device, and C<blockdev_getsize64> for the more
+See also C<blockdev-getss> for the real sector size of
+the device, and C<blockdev-getsize64> for the more
useful I<size in bytes>.
This uses the L<blockdev(8)> command.
C<value> can be NULL.
+=head2 cp
+
+ cp src dest
+
+This copies a file from C<src> to C<dest> where C<dest> is
+either a destination filename or destination directory.
+
+=head2 cp-a
+
+ cp-a src dest
+
+This copies a file or directory from C<src> to C<dest>
+recursively using the C<cp -a> command.
+
+=head2 debug
+
+ debug subcmd 'extraargs ...'
+
+The C<debug> command exposes some internals of
+C<guestfsd> (the guestfs daemon) that runs inside the
+qemu subprocess.
+
+There is no comprehensive help for this command. You have
+to look at the file C<daemon/debug.c> in the libguestfs source
+to find out what you can do.
+
+=head2 dmesg
+
+ dmesg
+
+This returns the kernel messages (C<dmesg> output) from
+the guest kernel. This is sometimes useful for extended
+debugging of problems.
+
+Another way to get the same information is to enable
+verbose messages with C<set-verbose> or by setting
+the environment variable C<LIBGUESTFS_DEBUG=1> before
+running the program.
+
=head2 download
download remotefilename (filename|-)
Use C<-> instead of a filename to read/write from stdin/stdout.
+=head2 drop-caches
+
+ drop-caches whattodrop
+
+This instructs the guest kernel to drop its page cache,
+and/or dentries and inode caches. The parameter C<whattodrop>
+tells the kernel what precisely to drop, see
+L<http://linux-mm.org/Drop_Caches>
+
+Setting C<whattodrop> to 3 should drop everything.
+
+This automatically calls L<sync(2)> before the operation,
+so that the maximum guest memory is freed.
+
+=head2 equal
+
+ equal file1 file2
+
+This compares the two files C<file1> and C<file2> and returns
+true if their content is exactly equal, or false otherwise.
+
+The external L<cmp(1)> program is used for the comparison.
+
=head2 exists
exists path
This returns C<true> if and only if there is a file, directory
(or anything) with the given C<path> name.
-See also C<is_file>, C<is_dir>, C<stat>.
+See also C<is-file>, C<is-dir>, C<stat>.
=head2 file
particular that the filename is not prepended to the output
(the C<-b> option).
+=head2 fsck
+
+ fsck fstype device
+
+This runs the filesystem checker (fsck) on C<device> which
+should have filesystem type C<fstype>.
+
+The returned integer is the status. See L<fsck(8)> for the
+list of status codes from C<fsck>.
+
+Notes:
+
+=over 4
+
+=item *
+
+Multiple status codes can be summed together.
+
+=item *
+
+A non-zero return code can mean "success", for example if
+errors have been corrected on the filesystem.
+
+=item *
+
+Checking or repairing NTFS volumes is not supported
+(by linux-ntfs).
+
+=back
+
+This command is entirely equivalent to running C<fsck -a -t fstype device>.
+
=head2 get-autosync
get-autosync
Get the autosync flag.
+=head2 get-e2label
+
+ get-e2label device
+
+This returns the ext2/3/4 filesystem label of the filesystem on
+C<device>.
+
+=head2 get-e2uuid
+
+ get-e2uuid device
+
+This returns the ext2/3/4 filesystem UUID of the filesystem on
+C<device>.
+
=head2 get-path
get-path
This returns the verbose messages flag.
+=head2 grub-install
+
+ grub-install root device
+
+This command installs GRUB (the Grand Unified Bootloader) on
+C<device>, with the root directory being C<root>.
+
=head2 is-busy
is-busy
B<This command is dangerous. Without careful use you
can easily destroy all your data>.
+=head2 lvremove
+
+ lvremove device
+
+Remove an LVM logical volume C<device>, where C<device> is
+the path to the LV, such as C</dev/VG/LV>.
+
+You can also remove all LVs in a volume group by specifying
+the VG name, C</dev/VG>.
+
=head2 lvs
lvs
This returns a list of the logical volume device names
(eg. C</dev/VolGroup00/LogVol00>).
-See also C<lvs_full>.
+See also C<lvs-full>.
=head2 lvs-full
mkfs fstype device
This creates a filesystem on C<device> (usually a partition
-of LVM logical volume). The filesystem type is C<fstype>, for
+or LVM logical volume). The filesystem type is C<fstype>, for
example C<ext3>.
=head2 mount
The filesystem options C<sync> and C<noatime> are set with this
call, in order to improve reliability.
+=head2 mount-options
+
+ mount-options options device mountpoint
+
+This is the same as the C<mount> command, but it
+allows you to set the mount options as for the
+L<mount(8)> I<-o> flag.
+
+=head2 mount-ro
+
+ mount-ro device mountpoint
+
+This is the same as the C<mount> command, but it
+mounts the filesystem with the read-only (I<-o ro>) flag.
+
+=head2 mount-vfs
+
+ mount-vfs options vfstype device mountpoint
+
+This is the same as the C<mount> command, but it
+allows you to set both the mount options and the vfstype
+as for the L<mount(8)> I<-o> and I<-t> flags.
+
=head2 mounts
mounts
Some internal mounts are not shown.
+=head2 mv
+
+ mv src dest
+
+This moves a file from C<src> to C<dest> where C<dest> is
+either a destination filename or destination directory.
+
+=head2 ping-daemon
+
+ ping-daemon
+
+This is a test probe into the guestfs daemon running inside
+the qemu subprocess. Calling this function checks that the
+daemon responds to the ping message, without affecting the daemon
+or attached block device(s) in any other way.
+
=head2 pvcreate
pvcreate device
where C<device> should usually be a partition name such
as C</dev/sda1>.
+=head2 pvremove
+
+ pvremove device
+
+This wipes a physical volume C<device> so that LVM will no longer
+recognise it.
+
+The implementation uses the C<pvremove> command which refuses to
+wipe physical volumes that contain any volume groups, so you have
+to remove those first.
+
=head2 pvs
pvs
This returns a list of just the device names that contain
PVs (eg. C</dev/sda2>).
-See also C<pvs_full>.
+See also C<pvs-full>.
=head2 pvs-full
Note that this function cannot correctly handle binary files
(specifically, files containing C<\0> character which is treated
-as end of line). For those you need to use the C<read_file>
+as end of line). For those you need to use the C<read-file>
function which has a more complex interface.
=head2 rm
set-autosync true|false
If C<autosync> is true, this enables autosync. Libguestfs will make a
-best effort attempt to run C<sync> when the handle is closed
+best effort attempt to run C<umount-all> followed by
+C<sync> when the handle is closed
(also if the program exits without closing handles).
+This is disabled by default (except in guestfish where it is
+enabled by default).
+
+=head2 set-e2label
+
+ set-e2label device label
+
+This sets the ext2/3/4 filesystem label of the filesystem on
+C<device> to C<label>. Filesystem labels are limited to
+16 characters.
+
+You can use either C<tune2fs-l> or C<get-e2label>
+to return the existing label on a filesystem.
+
+=head2 set-e2uuid
+
+ set-e2uuid device uuid
+
+This sets the ext2/3/4 filesystem UUID of the filesystem on
+C<device> to C<uuid>. The format of the UUID and alternatives
+such as C<clear>, C<random> and C<time> are described in the
+L<tune2fs(8)> manpage.
+
+You can use either C<tune2fs-l> or C<get-e2uuid>
+to return the existing UUID of a filesystem.
+
=head2 set-path | path
set-path path
This command uploads and unpacks local file C<tarfile> (an
I<uncompressed> tar file) into C<directory>.
-To upload a compressed tarball, use C<tgz_in>.
+To upload a compressed tarball, use C<tgz-in>.
Use C<-> instead of a filename to read/write from stdin/stdout.
This command packs the contents of C<directory> and downloads
it to local file C<tarfile>.
-To download a compressed tarball, use C<tgz_out>.
+To download a compressed tarball, use C<tgz-out>.
Use C<-> instead of a filename to read/write from stdin/stdout.
This command uploads and unpacks local file C<tarball> (a
I<gzip compressed> tar file) into C<directory>.
-To upload an uncompressed tarball, use C<tar_in>.
+To upload an uncompressed tarball, use C<tar-in>.
Use C<-> instead of a filename to read/write from stdin/stdout.
This command packs the contents of C<directory> and downloads
it to local file C<tarball>.
-To download an uncompressed tarball, use C<tar_out>.
+To download an uncompressed tarball, use C<tar-out>.
Use C<-> instead of a filename to read/write from stdin/stdout.
tune2fs-l device
-This returns the contents of the ext2 or ext3 filesystem superblock
-on C<device>.
+This returns the contents of the ext2, ext3 or ext4 filesystem
+superblock on C<device>.
It is the same as running C<tune2fs -l device>. See L<tune2fs(8)>
manpage for more details. The list of fields returned isn't
This creates an LVM volume group called C<volgroup>
from the non-empty list of physical volumes C<physvols>.
+=head2 vgremove
+
+ vgremove vgname
+
+Remove an LVM volume group C<vgname>, (for example C<VG>).
+
+This also forcibly removes all logical volumes in the volume
+group (if any).
+
=head2 vgs
vgs
This returns a list of just the volume group names that were
detected (eg. C<VolGroup00>).
-See also C<vgs_full>.
+See also C<vgs-full>.
=head2 vgs-full
of somewhere between 2MB and 4MB. To transfer large files you should use
FTP.
+=head2 zero
+
+ zero device
+
+This command writes zeroes over the first few blocks of C<device>.
+
+How many blocks are zeroed isn't specified (but it's I<not> enough
+to securely wipe the device). It should be sufficient to remove
+any partition tables, filesystem superblocks and so on.
+