Added notes to the 'fsck' command documentation.
[libguestfs.git] / guestfish-actions.pod
index 7cf78d0..44d86f2 100644 (file)
@@ -29,7 +29,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
-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
@@ -40,7 +40,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,
-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
@@ -73,7 +73,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.
 
-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,
@@ -108,11 +108,11 @@ Make save a no-op, just record what would have been changed.
 
 =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/>.
 
@@ -141,7 +141,7 @@ details.
 
  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
@@ -173,7 +173,7 @@ On success this returns the number of entries which were removed.
 
 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
@@ -217,7 +217,7 @@ This uses the L<blockdev(8)> command.
 
 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.
 
@@ -228,7 +228,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.
 
-(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.
@@ -240,8 +240,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).
 
-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.
@@ -403,6 +403,18 @@ The first character of C<param> string must be a C<-> (dash).
 
 C<value> can be NULL.
 
+=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 download
 
  download remotefilename (filename|-)
@@ -423,7 +435,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.
 
-See also C<is_file>, C<is_dir>, C<stat>.
+See also C<is-file>, C<is-dir>, C<stat>.
 
 =head2 file
 
@@ -437,12 +449,58 @@ 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).
 
+=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
@@ -617,6 +675,16 @@ and physical volumes.
 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
@@ -627,7 +695,7 @@ of the L<lvs(8)> command.
 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
 
@@ -718,6 +786,17 @@ 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>.
 
+=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
@@ -728,7 +807,7 @@ of the L<pvs(8)> command.
 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
 
@@ -748,7 +827,7 @@ 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
-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
@@ -776,9 +855,36 @@ Remove the single directory C<path>.
  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
@@ -881,7 +987,7 @@ closing the handle.
 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.
 
@@ -892,7 +998,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>.
 
-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.
 
@@ -903,7 +1009,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>.
 
-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.
 
@@ -914,7 +1020,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>.
 
-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.
 
@@ -930,8 +1036,8 @@ to create a new zero-length file.
 
  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
@@ -974,6 +1080,15 @@ Use C<-> instead of a filename to read/write from stdin/stdout.
 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
@@ -984,7 +1099,7 @@ of the L<vgs(8)> command.
 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
 
@@ -1009,3 +1124,13 @@ 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.
+