summaryrefslogtreecommitdiff
path: root/sys/man/8/disksim
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
commitb41b9034225ab3e49980d9de55c141011b6383b0 (patch)
tree891014b4c2e803e01ac7a1fd2b60819fbc5a6e73 /sys/man/8/disksim
parentc558a99e0be506a9abdf677f0ca4490644e05fc1 (diff)
Import sources from 2011-03-30 iso image - sys/man
Diffstat (limited to 'sys/man/8/disksim')
-rwxr-xr-xsys/man/8/disksim99
1 files changed, 99 insertions, 0 deletions
diff --git a/sys/man/8/disksim b/sys/man/8/disksim
new file mode 100755
index 000000000..cd76609e6
--- /dev/null
+++ b/sys/man/8/disksim
@@ -0,0 +1,99 @@
+.TH DISKSIM 8
+.SH NAME
+disksim \- disk simulator
+.SH SYNOPSIS
+.B aux/disksim
+[
+.B -r
+]
+[
+.B -f
+.I file
+]
+[
+.B -s
+.I srvname
+]
+[
+.B -m
+.I mtpt
+]
+[
+.I diskname
+]
+.SH DESCRIPTION
+.I Disksim
+presents an in-memory disk in the manner of the
+.IR sd (3)
+device on
+.IB mtpt / diskname
+(default
+.BR /dev/sdXX ).
+The disk is initialized to zeros;
+non-zeroed blocks written to the disk are kept in memory.
+.PP
+When setting disk geometry with the
+.B geometry
+control message,
+the arguments are
+sectors, sector size, cylinders, heads, and sectors per track.
+The last three may be zero for LBA disk simulations,
+but must be present.
+.PP
+The
+.B -f
+option causes
+.I disksim
+to use
+.I file
+as the initial contents of the disk rather than a zeroed image.
+Changes made to the disk are written back to
+.I file
+unless the
+.B -r
+option is given.
+.PP
+The
+.B -s
+option causes
+.I disksim
+to post its 9P service at
+.BI /srv/ service \fR.
+.SH EXAMPLES
+.I Disksim
+can be used to test programs such as
+.I fdisk
+and
+.IR prep (8)
+that expect
+.IR sd (3)
+disks:
+.IP
+.EX
+aux/disksim
+echo geometry 40000 512 0 0 0 >/dev/sdXX/ctl # 20MB
+disk/mbr /dev/sdXX/data
+disk/fdisk -baw /dev/sdXX/data
+disk/prep /dev/sdXX/plan9
+.EE
+.PP
+.I Disksim
+is useful for creating very large but mostly zeroed files
+for testing other programs.
+Test
+.IR tar (1)'s
+handling of large files:
+.IP
+.EX
+for(i in sdXX sdYY sdZZ) aux/disksim $i
+echo geometry 40000000 512 0 0 0 >/dev/sdXX/ctl # 20GB
+echo geometry 10000000 512 0 0 0 >/dev/sdYY/ctl # 5GB
+echo geometry 20000000 512 0 0 0 >/dev/sdZZ/ctl # 10GB
+tar cf /dev/sdXX/data /dev/sdYY/data /dev/sdZZ/data
+tar tvf /dev/sdXX/data
+.EE
+.SH SOURCE
+.B /sys/src/cmd/aux/disksim.c
+.SH SEE ALSO
+.IR sd (3),
+.IR prep (8)