-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvbig.1
198 lines (198 loc) · 6.28 KB
/
vbig.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
.\"
.\" This file is part of vbig.
.\" Copyright (C) 2011, 2013-2015, 2019 Richard Kettlewell
.\" Copyright (C) 2013 Ian Jackson
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
.\"
.TH vbig 1
.SH NAME
vbig \- create or verify a large but pseudo-random file
.SH SYNOPSIS
\fBvbig \fR[\fB--seed \fRSEED\fR] [\fB--both\fR|\fB--create\fR|\fB--verify\fR] \fIPATH \fR[\fISIZE\fR]
.br
\fBvbig \-\-help
.br
\fBvbig \-\-version
.SH DESCRIPTION
\fBvbig\fR creates a file of specified size full of predictable
pseudo-random data, and/or verifies that it has the expected contents.
The intended use is to test whether storage media really do what they
say on the tin.
.PP
By default \fBvbig\fR will:
.IP 1.
Generate a new random seed.
.IP 2.
Write data to the specified file or device until the device is full.
.IP 3.
Read the data back to check that everything written was properly stored.
.IP 4.
Report the device's size.
.PP
If you have privilege to do so, you should specify
\fB--flush\fR to flush the operating system disk cache between the write
and read.
Normally you would also specify \fB--progress\fR.
.SS Files
\fIPATH\fR can refer to an ordinary file on a mounted file system,
which vbig will create or truncate as necessary, or a block device.
Note that if it's a file, vbig won't delete it after it's done.
.PP
vbig has some platform-dependent sanity checks but you should
nevertheless be cautious when using it; it is as dangerous as \fBdd\fR(1).
.SS Sizes
\fISIZE\fR may end with \fBK\fR, \fBM\fR or \fBG\fR to select (binary)
kilobytes, megabytes or gigabytes.
The size is mandatory when creating a file but optional when verifying
it, unless \fB\-\-entire\fR is specified.
If \fISIZE\fR is not specified when writing-then-verifying, it is as if
\fB\-\-entire\fR was specified.
.PP
In \fB--both\fR mode (the default):
.IP \(bu
If no size is specified, the whole device will be written until it is full.
.IP \(bu
If a size is specified then the device is expected to have the specified size
and an error is reported if it is bigger or smaller.
.IP \(bu
The \fB--entire\fR option has no additional effect.
.PP
In \fB--create\fR mode:
.IP \(bu
If a size is specified then the device is expected to have the specified size
and an error is reported if it is smaller.
The real size will be printed to stdout.
No error is reported if it is bigger.
.IP \(bu
If no size is specified then \fB--entire\fR must be specified.
The whole device is written until it is full.
.PP
In \fB--verify\fR mode:
.IP \(bu
If a size is specified then the device is expected to have the specified size
and an error is reported if it is bigger or smaller.
.IP \(bu
If no size is specified but \fB--entire\fR is specified
then the whole device is read until end of file.
.IP \(bu
If no size is specified and \fB--entire\fR is not specified
then \fBstat\fR(2) is used to discover the advertized device size.
.SS Random Seeds
If neither \fB--seed\fR nor \fB--seed-file\fR are specified:
.IP \(bu
In \fB--both\fR mode a fresh random seed is read from the system's
random number generator
.IP \(bu
In other modes a fixed default seed is used.
.SH OPTIONS
.TP
.B --seed\fR, \fB-s \fISEED
Specifies the random seed to use.
Optional.
.TP
.B --seed-file\fR, \fB-S \fISEED-FILE
Specifies where the random seed should be read from.
The first \fISEED-LENGTH\fR bytes will be used, or the whole file if
it is shorter.
.TP
.B --seed-length\fR, \fB-L \fISEED-LENGTH
Specifies the (maximum) seed length in bytes.
Optional; default is 256.
.TP
.B --both\fR, \fB-b
Selects both mode.
\fIPATH\fR will be filled with \fISIZE\fR pseudo-random bytes and
then read to check that it contains the data just written.
This is the default.
.TP
.B --create\fR, \fB-c
Selects create mode.
\fIPATH\fR will be filled with \fISIZE\fR pseudo-random bytes.
.TP
.B --verify\fR, \fB-v
Selects verify mode.
Checks that \fIPATH\fR has exactly the contents that would be produced
by the equivalent \fB--create\fR call.
.TP
.B --flush\fR, \fB-f
Flush cached data after creating the file or before verifying it.
On some platforms, only root can use this option.
.TP
.B --progress\fR, \fB-p
Show the progress (in bytes) on stdout.
.TP
.B --entire\fR, \fB-e
When writing, keep going until the device is full (No space left
on device).
When reading, keep going until the end of the file or device.
\fISIZE\fR should not be specified.
The actual size written or verified will be printed to stdout.
.TP
.B --rng\fR, \fB-r \fIRNG
Selects the PRNG to use.
The options are:
.RS
.TP
.B arcfour-drop-3072
RC4 is keyed with the seed and used to produce a stream of bytes.
The first 3072 bytes are dropped.
.TP
.B aes-ctr-drbg-128
CTR_DRBG with the AES-128 block cipher.
The entropy input is 0 and the seed is used as the personalization string.
This is the default.
.TP
.B aes-ctr-drbg-192
CTR_DRBG with the AES-192 block cipher.
The entropy input is 0 and the seed is used as the personalization string.
.TP
.B aes-ctr-drbg-256
CTR_DRBG with the AES-256 block cipher.
The entropy input is 0 and the seed is used as the personalization string.
.RE
.TP
.B --force\fR, \fB-F
Override warnings.
.TP
.B --help\fR, \fB-h
Displays a usage message.
.TP
.B --version\fR, \fB-V
Displays the version strings.
.SH EXAMPLES
To test a storage device,
make sure that it has nothing of value on it
(since it will be overwritten)
and then:
.PP
.nf
vbig --flush --progress /dev/sde
.fi
.PP
The real size will be reported at the end.
You will need to (re-)establish a partition table.
.PP
If you want to verify that the device has a particular size,
in this example 1 gigabyte,
you can specify it on the command line:
.PP
.nf
vbig --flush --progress /dev/sde 1G
.fi
.PP
If the device is bigger or smaller than the specified size
then an error will be reported.
.SH AUTHOR
Richard Kettlewell <[email protected]>