From 5d9f10c31297c5f6bfe261717dfc5c841722a4c2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 15 Nov 2012 09:01:15 +0000 Subject: recipes: Add sections about hexdumping, hexediting sectors. --- examples/guestfs-recipes.pod | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/guestfs-recipes.pod b/examples/guestfs-recipes.pod index 0b86e7c4..1a1e51c4 100644 --- a/examples/guestfs-recipes.pod +++ b/examples/guestfs-recipes.pod @@ -123,7 +123,7 @@ one which is encrypted or buried inside an LV or RAID device): To download to stdout, replace the filename with a C<-> character: - guestfish --ro -a disk.img run : download /dev/sda1 - | hexdump -C + guestfish --ro -a disk.img run : download /dev/sda1 - | gzip > sda1.gz To list the filesystems in a disk image, use L. @@ -317,6 +317,19 @@ This might give you a clue as to what program is running. =back +=head1 Hex-dumping sectors from the guest + +Hex-dump the boot partition: + + guestfish --ro -a disk.img run : pread-device /dev/sda 0x200 0 | + hexdump -C + +=head1 Hex-editing sectors in the guest + +Hex-edit the first sector (boot partition): + + guestfish --rw -a disk.img run : hexedit /dev/sda 0x200 + =head1 Install RPMs in a guest The link below contains a method to install RPMs in a guest. In fact -- cgit