summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-02 16:26:09 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-02 16:33:59 +0100
commitb799bc58a84e155783afae23f64f27e23ddd06dd (patch)
tree47e3130deb1a2872d756f049d39325598559c9d1 /examples
parenta1d981edeae120a0523d0974c703f1a956202415 (diff)
downloadlibguestfs-b799bc58a84e155783afae23f64f27e23ddd06dd.tar.gz
libguestfs-b799bc58a84e155783afae23f64f27e23ddd06dd.tar.xz
libguestfs-b799bc58a84e155783afae23f64f27e23ddd06dd.zip
recipes: Checksum file/device. Download to stdout.
Diffstat (limited to 'examples')
-rw-r--r--examples/guestfs-recipes.pod26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/guestfs-recipes.pod b/examples/guestfs-recipes.pod
index 90b1c2f7..2071b3a9 100644
--- a/examples/guestfs-recipes.pod
+++ b/examples/guestfs-recipes.pod
@@ -30,6 +30,28 @@ Windows.
L<https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html>
L<https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html>
+=head1 Checksum a file or device within a disk image
+
+To checksum a whole device, or a partition, LV etc within a disk image:
+
+ guestfish --ro -a disk.img run : checksum-device md5 /dev/sda1
+
+Replace C<md5> with the type of checksum you want. See
+L<guestfs(3)/guestfs_checksum_device> for a list of supported types.
+
+C</dev/sda1> means "the first partition". You could use C</dev/sda>
+to checksum the whole disk image, or the name of a logical volume or
+RAID device.
+
+To checksum a single file:
+
+ guestfish --ro -a disk.img -i checksum sha256 /etc/passwd
+
+or for a Windows guest:
+
+ guestfish --ro -a disk.img -i \
+ checksum sha256 'win:\windows\system32\config\SOFTWARE'
+
=head1 Cloning a virtual machine
Use a combination of tools like L<cp(1)>, L<dd(1)>, and
@@ -89,6 +111,10 @@ one which is encrypted or buried inside an LV or RAID device):
guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img
+To download to stdout, replace the filename with a C<-> character:
+
+ guestfish --ro -a disk.img run : download /dev/sda1 - | hexdump -C
+
To list the filesystems in a disk image, use L<virt-filesystems(1)>.
=head1 Edit grub configuration in a VM