Fix dependencies in perl so it doesn't always rebuild
[libguestfs.git] / guestfish-actions.pod
index 4403cb0..d4f4930 100644 (file)
@@ -6,6 +6,11 @@ This function adds a virtual CD-ROM disk image to the guest.
 
 This is equivalent to the qemu parameter C<-cdrom filename>.
 
 
 This is equivalent to the qemu parameter C<-cdrom filename>.
 
+Note that this call checks for the existence of C<filename>.  This
+stops you from specifying other types of drive which are supported
+by qemu such as C<nbd:> and C<http:> URLs.  To specify those, use
+the general C<config> call instead.
+
 =head2 add-drive | add
 
  add-drive filename
 =head2 add-drive | add
 
  add-drive filename
@@ -21,7 +26,33 @@ for whatever operations you want to perform (ie. read access if you
 just want to read the image or write access if you want to modify the
 image).
 
 just want to read the image or write access if you want to modify the
 image).
 
-This is equivalent to the qemu parameter C<-drive file=filename>.
+This is equivalent to the qemu parameter C<-drive file=filename,cache=off>.
+
+Note that this call checks for the existence of C<filename>.  This
+stops you from specifying other types of drive which are supported
+by qemu such as C<nbd:> and C<http:> URLs.  To specify those, use
+the general C<config> call instead.
+
+=head2 add-drive-ro | add-ro
+
+ add-drive-ro filename
+
+This adds a drive in snapshot mode, making it effectively
+read-only.
+
+Note that writes to the device are allowed, and will be seen for
+the duration of the guestfs handle, but they are written
+to a temporary file which is discarded as soon as the guestfs
+handle is closed.  We don't currently have any method to enable
+changes to be committed, although qemu can support this.
+
+This is equivalent to the qemu parameter
+C<-drive file=filename,snapshot=on>.
+
+Note that this call checks for the existence of C<filename>.  This
+stops you from specifying other types of drive which are supported
+by qemu such as C<nbd:> and C<http:> URLs.  To specify those, use
+the general C<config> call instead.
 
 =head2 aug-close
 
 
 =head2 aug-close
 
@@ -29,7 +60,7 @@ This is equivalent to the qemu parameter C<-drive file=filename>.
 
 Close the current Augeas handle and free up any resources
 used by it.  After calling this, you have to call
 
 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
 Augeas functions.
 
 =head2 aug-defnode
@@ -40,7 +71,7 @@ Defines a variable C<name> whose value is the result of
 evaluating C<expr>.
 
 If C<expr> evaluates to an empty nodeset, a node is created,
 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
 C<name> will be the nodeset containing that single node.
 
 On success this returns a pair containing the
@@ -73,7 +104,7 @@ Create a new Augeas handle for editing configuration files.
 If there was any previous Augeas handle associated with this
 guestfs session, then it is closed.
 
 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,
 commands.
 
 C<root> is the filesystem root.  C<root> must not be NULL,
@@ -108,11 +139,11 @@ Make save a no-op, just record what would have been changed.
 
 =item C<AUG_NO_LOAD> = 32
 
 
 =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
 
 
 =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/>.
 
 
 To find out more about Augeas, see L<http://augeas.net/>.
 
@@ -141,7 +172,7 @@ details.
 
  aug-ls path
 
 
  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
 C<path/*> and sorting the resulting nodes into alphabetical order.
 
 =head2 aug-match
@@ -173,7 +204,7 @@ On success this returns the number of entries which were removed.
 
 This writes all pending changes to disk.
 
 
 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
 how files are saved.
 
 =head2 aug-set
@@ -217,7 +248,7 @@ This uses the L<blockdev(8)> command.
 
 This returns the size of the device in bytes.
 
 
 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 uses the L<blockdev(8)> command.
 
@@ -228,7 +259,7 @@ 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.
 
 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.
 for that).
 
 This uses the L<blockdev(8)> command.
@@ -240,8 +271,8 @@ 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).
 
 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.
 useful I<size in bytes>.
 
 This uses the L<blockdev(8)> command.
@@ -360,7 +391,7 @@ yourself (Augeas support makes this relatively easy).
 
 =head2 command
 
 
 =head2 command
 
- command arguments,...
+ command 'arguments ...'
 
 This call runs a command from the guest filesystem.  The
 filesystem must be mounted, and must contain a compatible
 
 This call runs a command from the guest filesystem.  The
 filesystem must be mounted, and must contain a compatible
@@ -370,7 +401,16 @@ or compatible processor architecture).
 The single parameter is an argv-style list of arguments.
 The first element is the name of the program to run.
 Subsequent elements are parameters.  The list must be
 The single parameter is an argv-style list of arguments.
 The first element is the name of the program to run.
 Subsequent elements are parameters.  The list must be
-non-empty (ie. must contain a program name).
+non-empty (ie. must contain a program name).  Note that
+the command runs directly, and is I<not> invoked via
+the shell (see C<sh>).
+
+The return value is anything printed to I<stdout> by
+the command.
+
+If the command returns a non-zero exit status, then
+this function returns an error message.  The error message
+string is the content of I<stderr> from the command.
 
 The C<$PATH> environment variable will contain at least
 C</usr/bin> and C</bin>.  If you require a program from
 
 The C<$PATH> environment variable will contain at least
 C</usr/bin> and C</bin>.  If you require a program from
@@ -383,13 +423,23 @@ correct places.  It is the caller's responsibility to ensure
 all filesystems that are needed are mounted at the right
 locations.
 
 all filesystems that are needed are mounted at the right
 locations.
 
+Because of the message protocol, there is a transfer limit 
+of somewhere between 2MB and 4MB.  To transfer large files you should use
+FTP.
+
 =head2 command-lines
 
 =head2 command-lines
 
- command-lines arguments,...
+ command-lines 'arguments ...'
 
 This is the same as C<command>, but splits the
 result into a list of lines.
 
 
 This is the same as C<command>, but splits the
 result into a list of lines.
 
+See also: C<sh-lines>
+
+Because of the message protocol, there is a transfer limit 
+of somewhere between 2MB and 4MB.  To transfer large files you should use
+FTP.
+
 =head2 config
 
  config qemuparam qemuvalue
 =head2 config
 
  config qemuparam qemuvalue
@@ -403,6 +453,45 @@ The first character of C<param> string must be a C<-> (dash).
 
 C<value> can be NULL.
 
 
 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|-)
 =head2 download
 
  download remotefilename (filename|-)
@@ -416,6 +505,40 @@ See also C<upload>, C<cat>.
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
 
 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 e2fsck-f
+
+ e2fsck-f device
+
+This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3
+filesystem checker on C<device>, noninteractively (C<-p>),
+even if the filesystem appears to be clean (C<-f>).
+
+This command is only needed because of C<resize2fs>
+(q.v.).  Normally you should use C<fsck>.
+
+=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
 =head2 exists
 
  exists path
@@ -423,7 +546,7 @@ Use C<-> instead of a filename to read/write from stdin/stdout.
 This returns C<true> if and only if there is a file, directory
 (or anything) with the given C<path> name.
 
 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
 
 
 =head2 file
 
@@ -437,12 +560,96 @@ The exact command which runs is C<file -bsL path>.  Note in
 particular that the filename is not prepended to the output
 (the C<-b> option).
 
 particular that the filename is not prepended to the output
 (the C<-b> option).
 
+=head2 find
+
+ find directory
+
+This command lists out all files and directories, recursively,
+starting at C<directory>.  It is essentially equivalent to
+running the shell command C<find directory -print> but some
+post-processing happens on the output, described below.
+
+This returns a list of strings I<without any prefix>.  Thus
+if the directory structure was:
+
+ /tmp/a
+ /tmp/b
+ /tmp/c/d
+
+then the returned list from C<find> C</tmp> would be
+4 elements:
+
+ a
+ b
+ c
+ c/d
+
+If C<directory> is not a directory, then this command returns
+an error.
+
+The returned list is sorted.
+
+=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-append
+
+ get-append
+
+Return the additional kernel options which are added to the
+guest kernel command line.
+
+If C<NULL> then no options are added.
+
 =head2 get-autosync
 
  get-autosync
 
 Get the autosync flag.
 
 =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
 =head2 get-path
 
  get-path
@@ -476,6 +683,39 @@ For more information on states, see L<guestfs(3)>.
 
 This returns the verbose messages flag.
 
 
 This returns the verbose messages flag.
 
+=head2 glob-expand
+
+ glob-expand pattern
+
+This command searches for all the pathnames matching
+C<pattern> according to the wildcard expansion rules
+used by the shell.
+
+If no paths match, then this returns an empty list
+(note: not an error).
+
+It is just a wrapper around the C L<glob(3)> function
+with flags C<GLOB_MARK|GLOB_BRACE>.
+See that manual page for more details.
+
+=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 hexdump
+
+ hexdump path
+
+This runs C<hexdump -C> on the given C<path>.  The result is
+the human-readable, canonical hex dump of the file.
+
+Because of the message protocol, there is a transfer limit 
+of somewhere between 2MB and 4MB.  To transfer large files you should use
+FTP.
+
 =head2 is-busy
 
  is-busy
 =head2 is-busy
 
  is-busy
@@ -617,6 +857,24 @@ and physical volumes.
 B<This command is dangerous.  Without careful use you
 can easily destroy all your data>.
 
 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 lvresize
+
+ lvresize device mbytes
+
+This resizes (expands or shrinks) an existing LVM logical
+volume to C<mbytes>.  When reducing, data in the reduced part
+is lost.
+
 =head2 lvs
 
  lvs
 =head2 lvs
 
  lvs
@@ -627,7 +885,7 @@ of the L<lvs(8)> command.
 This returns a list of the logical volume device names
 (eg. C</dev/VolGroup00/LogVol00>).
 
 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
 
 
 =head2 lvs-full
 
@@ -654,7 +912,7 @@ as necessary.  This is like the C<mkdir -p> shell command.
  mkfs fstype device
 
 This creates a filesystem on C<device> (usually a partition
  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
 example C<ext3>.
 
 =head2 mount
@@ -678,6 +936,29 @@ on the underlying device.
 The filesystem options C<sync> and C<noatime> are set with this
 call, in order to improve reliability.
 
 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
 =head2 mounts
 
  mounts
@@ -687,6 +968,38 @@ the list of devices (eg. C</dev/sda1>, C</dev/VG/LV>).
 
 Some internal mounts are not shown.
 
 
 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 ntfs-3g-probe
+
+ ntfs-3g-probe true|false device
+
+This command runs the L<ntfs-3g.probe(8)> command which probes
+an NTFS C<device> for mountability.  (Not all NTFS volumes can
+be mounted read-write, and some cannot be mounted at all).
+
+C<rw> is a boolean flag.  Set it to true if you want to test
+if the volume can be mounted read-write.  Set it to false if
+you want to test if the volume can be mounted read-only.
+
+The return value is an integer which C<0> if the operation
+would succeed, or some non-zero value documented in the
+L<ntfs-3g.probe(8)> manual page.
+
+=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
 =head2 pvcreate
 
  pvcreate device
@@ -695,6 +1008,24 @@ This creates an LVM physical volume on the named C<device>,
 where C<device> should usually be a partition name such
 as C</dev/sda1>.
 
 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 pvresize
+
+ pvresize device
+
+This resizes (expands or shrinks) an existing LVM physical
+volume to match the new size of the underlying device.
+
 =head2 pvs
 
  pvs
 =head2 pvs
 
  pvs
@@ -705,7 +1036,7 @@ of the L<pvs(8)> command.
 This returns a list of just the device names that contain
 PVs (eg. C</dev/sda2>).
 
 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
 
 
 =head2 pvs-full
 
@@ -725,9 +1056,22 @@ C<LF> and C<CRLF> character sequences are I<not> returned.
 
 Note that this function cannot correctly handle binary files
 (specifically, files containing C<\0> character which is treated
 
 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.
 
 function which has a more complex interface.
 
+=head2 resize2fs
+
+ resize2fs device
+
+This resizes an ext2 or ext3 filesystem to match the size of
+the underlying device.
+
+I<Note:> It is sometimes required that you run C<e2fsck-f>
+on the C<device> before calling this command.  For unknown reasons
+C<resize2fs> sometimes gives an error about this and sometimes not.
+In any case, it is always safe to call C<e2fsck-f> before
+calling this function.
+
 =head2 rm
 
  rm path
 =head2 rm
 
  rm path
@@ -748,14 +1092,92 @@ command.
 
 Remove the single directory C<path>.
 
 
 Remove the single directory C<path>.
 
+=head2 scrub-device
+
+ scrub-device device
+
+This command writes patterns over C<device> to make data retrieval
+more difficult.
+
+It is an interface to the L<scrub(1)> program.  See that
+manual page for more details.
+
+B<This command is dangerous.  Without careful use you
+can easily destroy all your data>.
+
+=head2 scrub-file
+
+ scrub-file file
+
+This command writes patterns over a file to make data retrieval
+more difficult.
+
+The file is I<removed> after scrubbing.
+
+It is an interface to the L<scrub(1)> program.  See that
+manual page for more details.
+
+=head2 scrub-freespace
+
+ scrub-freespace dir
+
+This command creates the directory C<dir> and then fills it
+with files until the filesystem is full, and scrubs the files
+as for C<scrub-file>, and deletes them.
+The intention is to scrub any free space on the partition
+containing C<dir>.
+
+It is an interface to the L<scrub(1)> program.  See that
+manual page for more details.
+
+=head2 set-append | append
+
+ set-append append
+
+This function is used to add additional options to the
+guest kernel command line.
+
+The default is C<NULL> unless overridden by setting
+C<LIBGUESTFS_APPEND> environment variable.
+
+Setting C<append> to C<NULL> means I<no> additional options
+are passed (libguestfs always adds a few of its own).
+
 =head2 set-autosync | autosync
 
  set-autosync true|false
 
 If C<autosync> is true, this enables autosync.  Libguestfs will make a
 =head2 set-autosync | autosync
 
  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).
 
 (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
 =head2 set-path | path
 
  set-path path
@@ -765,9 +1187,6 @@ Set the path that libguestfs searches for kernel and initrd.img.
 The default is C<$libdir/guestfs> unless overridden by setting
 C<LIBGUESTFS_PATH> environment variable.
 
 The default is C<$libdir/guestfs> unless overridden by setting
 C<LIBGUESTFS_PATH> environment variable.
 
-The string C<path> is stashed in the libguestfs handle, so the caller
-must make sure it remains valid for the lifetime of the handle.
-
 Setting C<path> to C<NULL> restores the default path.
 
 =head2 set-qemu | qemu
 Setting C<path> to C<NULL> restores the default path.
 
 =head2 set-qemu | qemu
@@ -782,9 +1201,6 @@ configure script.
 You can also override this by setting the C<LIBGUESTFS_QEMU>
 environment variable.
 
 You can also override this by setting the C<LIBGUESTFS_QEMU>
 environment variable.
 
-The string C<qemu> is stashed in the libguestfs handle, so the caller
-must make sure it remains valid for the lifetime of the handle.
-
 Setting C<qemu> to C<NULL> restores the default qemu binary.
 
 =head2 set-verbose | verbose
 Setting C<qemu> to C<NULL> restores the default qemu binary.
 
 =head2 set-verbose | verbose
@@ -798,7 +1214,7 @@ C<LIBGUESTFS_DEBUG> is defined and set to C<1>.
 
 =head2 sfdisk
 
 
 =head2 sfdisk
 
- sfdisk device cyls heads sectors lines,...
+ sfdisk device cyls heads sectors 'lines ...'
 
 This is a direct interface to the L<sfdisk(8)> program for creating
 partitions on block devices.
 
 This is a direct interface to the L<sfdisk(8)> program for creating
 partitions on block devices.
@@ -820,9 +1236,85 @@ To create a single partition occupying the whole disk, you would
 pass C<lines> as a single element list, when the single element being
 the string C<,> (comma).
 
 pass C<lines> as a single element list, when the single element being
 the string C<,> (comma).
 
+See also: C<sfdisk-l>, C<sfdisk-N>
+
 B<This command is dangerous.  Without careful use you
 can easily destroy all your data>.
 
 B<This command is dangerous.  Without careful use you
 can easily destroy all your data>.
 
+=head2 sfdisk-N
+
+ sfdisk-N device n cyls heads sectors line
+
+This runs L<sfdisk(8)> option to modify just the single
+partition C<n> (note: C<n> counts from 1).
+
+For other parameters, see C<sfdisk>.  You should usually
+pass C<0> for the cyls/heads/sectors parameters.
+
+B<This command is dangerous.  Without careful use you
+can easily destroy all your data>.
+
+=head2 sfdisk-disk-geometry
+
+ sfdisk-disk-geometry device
+
+This displays the disk geometry of C<device> read from the
+partition table.  Especially in the case where the underlying
+block device has been resized, this can be different from the
+kernel's idea of the geometry (see C<sfdisk-kernel-geometry>).
+
+The result is in human-readable format, and not designed to
+be parsed.
+
+=head2 sfdisk-kernel-geometry
+
+ sfdisk-kernel-geometry device
+
+This displays the kernel's idea of the geometry of C<device>.
+
+The result is in human-readable format, and not designed to
+be parsed.
+
+=head2 sfdisk-l
+
+ sfdisk-l device
+
+This displays the partition table on C<device>, in the
+human-readable output of the L<sfdisk(8)> command.  It is
+not intended to be parsed.
+
+=head2 sh
+
+ sh command
+
+This call runs a command from the guest filesystem via the
+guest's C</bin/sh>.
+
+This is like C<command>, but passes the command to:
+
+ /bin/sh -c "command"
+
+Depending on the guest's shell, this usually results in
+wildcards being expanded, shell expressions being interpolated
+and so on.
+
+All the provisos about C<command> apply to this call.
+
+=head2 sh-lines
+
+ sh-lines command
+
+This is the same as C<sh>, but splits the result
+into a list of lines.
+
+See also: C<command-lines>
+
+=head2 sleep
+
+ sleep secs
+
+Sleep for C<secs> seconds.
+
 =head2 stat
 
  stat path
 =head2 stat
 
  stat path
@@ -841,6 +1333,35 @@ C<path> should be a file or directory in the mounted file system
 
 This is the same as the C<statvfs(2)> system call.
 
 
 This is the same as the C<statvfs(2)> system call.
 
+=head2 strings
+
+ strings path
+
+This runs the L<strings(1)> command on a file and returns
+the list of printable strings found.
+
+Because of the message protocol, there is a transfer limit 
+of somewhere between 2MB and 4MB.  To transfer large files you should use
+FTP.
+
+=head2 strings-e
+
+ strings-e encoding path
+
+This is like the C<strings> command, but allows you to
+specify the encoding.
+
+See the L<strings(1)> manpage for the full list of encodings.
+
+Commonly useful encodings are C<l> (lower case L) which will
+show strings inside Windows/x86 files.
+
+The returned strings are transcoded to UTF-8.
+
+Because of the message protocol, there is a transfer limit 
+of somewhere between 2MB and 4MB.  To transfer large files you should use
+FTP.
+
 =head2 sync
 
  sync
 =head2 sync
 
  sync
@@ -858,7 +1379,7 @@ closing the handle.
 This command uploads and unpacks local file C<tarfile> (an
 I<uncompressed> tar file) into C<directory>.
 
 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.
 
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
@@ -869,7 +1390,7 @@ 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>.
 
 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.
 
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
@@ -880,7 +1401,7 @@ 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>.
 
 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.
 
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
@@ -891,7 +1412,7 @@ 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>.
 
 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.
 
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
@@ -907,8 +1428,8 @@ to create a new zero-length file.
 
  tune2fs-l device
 
 
  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
 
 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
@@ -944,13 +1465,49 @@ See also C<download>.
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
+=head2 vg-activate
+
+ vg-activate true|false 'volgroups ...'
+
+This command activates or (if C<activate> is false) deactivates
+all logical volumes in the listed volume groups C<volgroups>.
+If activated, then they are made known to the
+kernel, ie. they appear as C</dev/mapper> devices.  If deactivated,
+then those devices disappear.
+
+This command is the same as running C<vgchange -a y|n volgroups...>
+
+Note that if C<volgroups> is an empty list then B<all> volume groups
+are activated or deactivated.
+
+=head2 vg-activate-all
+
+ vg-activate-all true|false
+
+This command activates or (if C<activate> is false) deactivates
+all logical volumes in all volume groups.
+If activated, then they are made known to the
+kernel, ie. they appear as C</dev/mapper> devices.  If deactivated,
+then those devices disappear.
+
+This command is the same as running C<vgchange -a y|n>
+
 =head2 vgcreate
 
 =head2 vgcreate
 
- vgcreate volgroup physvols,...
+ vgcreate volgroup 'physvols ...'
 
 This creates an LVM volume group called C<volgroup>
 from the non-empty list of physical volumes C<physvols>.
 
 
 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
 =head2 vgs
 
  vgs
@@ -961,7 +1518,7 @@ of the L<vgs(8)> command.
 This returns a list of just the volume group names that were
 detected (eg. C<VolGroup00>).
 
 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
 
 
 =head2 vgs-full
 
@@ -982,7 +1539,39 @@ As a special case, if C<size> is C<0>
 then the length is calculated using C<strlen> (so in this case
 the content cannot contain embedded ASCII NULs).
 
 then the length is calculated using C<strlen> (so in this case
 the content cannot contain embedded ASCII NULs).
 
+I<NB.> Owing to a bug, writing content containing ASCII NUL
+characters does I<not> work, even if the length is specified.
+We hope to resolve this bug in a future version.  In the meantime
+use C<upload>.
+
 Because of the message protocol, there is a transfer limit 
 of somewhere between 2MB and 4MB.  To transfer large files you should use
 FTP.
 
 Because of the message protocol, there is a transfer limit 
 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.
+
+See also: C<scrub-device>.
+
+=head2 zerofree
+
+ zerofree device
+
+This runs the I<zerofree> program on C<device>.  This program
+claims to zero unused inodes and disk blocks on an ext2/3
+filesystem, thus making it possible to compress the filesystem
+more effectively.
+
+You should B<not> run this program if the filesystem is
+mounted.
+
+It is possible that using this program can damage the filesystem
+or data on the filesystem.
+