X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfish-actions.pod;h=ee3f6411c1a9918e40e6c6d5548ac38bc1f4580a;hp=7b5a4bed6d959d2aef75baad36e52dfd46ab5fdc;hb=8c637e1fb03d4a4ff36af770758671b3cabf9842;hpb=d901cc916102f1aaccfb73396b48aa303e5b8cd7 diff --git a/guestfish-actions.pod b/guestfish-actions.pod index 7b5a4be..ee3f641 100644 --- a/guestfish-actions.pod +++ b/guestfish-actions.pod @@ -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>. +Note that this call checks for the existence of C. This +stops you from specifying other types of drive which are supported +by qemu such as C and C URLs. To specify those, use +the general C call instead. + =head2 add-drive | add add-drive filename @@ -23,6 +28,32 @@ image). This is equivalent to the qemu parameter C<-drive file=filename>. +Note that this call checks for the existence of C. This +stops you from specifying other types of drive which are supported +by qemu such as C and C URLs. To specify those, use +the general C 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. This +stops you from specifying other types of drive which are supported +by qemu such as C and C URLs. To specify those, use +the general C call instead. + =head2 aug-close aug-close @@ -484,6 +515,17 @@ Setting C to 3 should drop everything. This automatically calls L before the operation, so that the maximum guest memory is freed. +=head2 e2fsck-f + + e2fsck-f device + +This runs C, ie. runs the ext2/ext3 +filesystem checker on C, noninteractively (C<-p>), +even if the filesystem appears to be clean (C<-f>). + +This command is only needed because of C +(q.v.). Normally you should use C. + =head2 equal equal file1 file2 @@ -514,6 +556,35 @@ The exact command which runs is C. Note in 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. It is essentially equivalent to +running the shell command C but some +post-processing happens on the output, described below. + +This returns a list of strings I. Thus +if the directory structure was: + + /tmp/a + /tmp/b + /tmp/c/d + +then the returned list from C C would be +4 elements: + + a + b + c + c/d + +If C is not a directory, then this command returns +an error. + +The returned list is sorted. + =head2 fsck fsck fstype device @@ -777,6 +848,14 @@ the path to the LV, such as C. You can also remove all LVs in a volume group by specifying the VG name, C. +=head2 lvresize + + lvresize device mbytes + +This resizes (expands or shrinks) an existing LVM logical +volume to C. When reducing, data in the reduced part +is lost. + =head2 lvs lvs @@ -877,6 +956,22 @@ Some internal mounts are not shown. This moves a file from C to C where C is either a destination filename or destination directory. +=head2 ntfs-3g-probe + + ntfs-3g-probe true|false device + +This command runs the L command which probes +an NTFS C for mountability. (Not all NTFS volumes can +be mounted read-write, and some cannot be mounted at all). + +C 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 manual page. + =head2 ping-daemon ping-daemon @@ -905,6 +1000,13 @@ The implementation uses the C 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 @@ -938,6 +1040,19 @@ Note that this function cannot correctly handle binary files as end of line). For those you need to use the C 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 It is sometimes required that you run C +on the C before calling this command. For unknown reasons +C sometimes gives an error about this and sometimes not. +In any case, it is always safe to call C before +calling this function. + =head2 rm rm path @@ -1064,9 +1179,59 @@ To create a single partition occupying the whole disk, you would pass C as a single element list, when the single element being the string C<,> (comma). +See also: C, C + B. +=head2 sfdisk-N + + sfdisk-N device n cyls heads sectors line + +This runs L option to modify just the single +partition C (note: C counts from 1). + +For other parameters, see C. You should usually +pass C<0> for the cyls/heads/sectors parameters. + +B. + +=head2 sfdisk-disk-geometry + + sfdisk-disk-geometry device + +This displays the disk geometry of C 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). + +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. + +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, in the +human-readable output of the L command. It is +not intended to be parsed. + +=head2 sleep + + sleep secs + +Sleep for C seconds. + =head2 stat stat path @@ -1217,6 +1382,33 @@ See also C. 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 is false) deactivates +all logical volumes in the listed volume groups C. +If activated, then they are made known to the +kernel, ie. they appear as C devices. If deactivated, +then those devices disappear. + +This command is the same as running C + +Note that if C is an empty list then B volume groups +are activated or deactivated. + +=head2 vg-activate-all + + vg-activate-all true|false + +This command activates or (if C 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 devices. If deactivated, +then those devices disappear. + +This command is the same as running C + =head2 vgcreate vgcreate volgroup 'physvols ...'