1 .\" Copyright (c) 1993 University of Utah.
2 .\" Copyright (c) 1980, 1989, 1991, 1993
3 .\" The Regents of the University of California. All rights reserved.
5 .\" This code is derived from software contributed to Berkeley by
6 .\" the Systems Programming Group of the University of Utah Computer
7 .\" Science Department.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" @(#)vnconfig.8 8.1 (Berkeley) 6/5/93
34 .\" $FreeBSD: src/usr.sbin/vnconfig/vnconfig.8,v 1.14.2.8 2003/01/04 22:35:53 keramida Exp $
41 .Nd configure and enable vnode disks
48 .Ar special_file Op Ar regular_file
55 .Op Fl f Ar config_file
58 .Op Ar special_file Ar ...
62 command configures, enables and lists vnode pseudo disk devices.
63 The first form of the command will associate the special file
67 allowing the latter to be accessed as though it were a disk.
68 Hence a regular file within the filesystem can be used for swapping
69 or can contain a filesystem that is mounted in the name space.
70 If you want to use swap backing store for your device instead of a file,
73 out and specify the size of the block device
78 Options indicate an action to be performed:
79 .Bl -tag -width indent
81 Read a command file and performs the
82 specified actions for each device/file pair.
85 If successful, references to
87 will access the contents of
92 device is autocloned if
96 the name of the resulting device is printed on stdout.
98 Disable (if possible) the specified feature.
100 Configure the device and enables any
103 If no feature was specified,
107 .It Fl f Ar config_file
108 Specify configuration file.
112 Fiddle global options.
113 .It Fl l Ar special_file Ar ...
116 devices and indicate which ones are in use.
119 list is given, only those devices will be described.
123 which is a comma separated string of options.
124 The list of allowed options and their meanings are:
125 .Bl -tag -width "reserve"
127 Pre-reserve the blocks underlying the file or swap backing store.
128 Currently only works for swap backing store.
129 This option also disables on-the-fly freeing of
130 the underlying backing store (for example, when you remove a large file).
131 Use this option if you wish to avoid long-term fragmentation of the backing
133 Also note that when this option is used, the initial contents of the
134 backing store may contain garbage rather than zeros.
135 It may even be possible to
136 recover the prior contents of a swap-backed
138 across a reboot if the
141 is configured before any swap is allocated by the system.
159 Turn off all options.
164 which is a comma separated string of options.
165 The list of allowed options and their meanings are the same as for the
171 .Brq Cm k , m , g , t
174 If no regular file is specified,
176 will use swap for backing store.
177 This option specifies the size of the device.
182 In the absence of a size modifier,
187 device will round the size up to a machine page boundary.
188 Filesystems up to 7.9 terabytes are supported.
189 When specified along with
190 a regular file, this option overrides the regular file's size insofar as
194 When a regular file is specified,
198 the file to length 0 first.
199 Normally you should also specify the
201 option to set the size of the file.
202 This option also creates the file if it did not previously exist.
203 This option is only meaningful if the
205 option has been specified.
207 When a regular file is specified,
209 will zero the contents of the file to
210 ensure that all blocks have been allocated by the filesystem.
211 This option is only meaningful if the
213 option has been specified.
215 Disable and ``unconfigure'' the device.
217 Print messages to stdout describing actions taken.
220 If no action option is given,
226 argument specifies a feature that can be enabled via the
229 .Bl -tag -width indent
231 Swapping is enabled on the special file.
234 .It Cm mountro= Ns Ar mount_point
235 The special file is mounted read-only on
239 .It Cm mountrw= Ns Ar mount_point
240 The special file is mounted read-write on
244 .It Cm mount= Ns Ar mount_point
246 .Cm mountrw= Ns Ar mount_point .
249 A configuration file contains one line per device/file pair in the form:
251 special_file regular_file [feature]
254 where fields are separated by white space.
258 The previously described action options serve to configure, enable,
259 disable or unconfigure all devices in the configuration file.
261 .Bl -tag -width /etc/vntab -compact
263 default configuration file for
268 .Dl vnconfig vn /tmp/diskimage
270 Configures an autocloned vnode disk,
271 the name of the resulting device is printed, e.g.\&
274 .Dl vnconfig vn0 /tmp/diskimage
276 Configures the vnode disk
279 .Dl vnconfig -e vn0 /var/swapfile swap
283 and enables swapping on it.
285 .Dl vnconfig -c -v /dev/vn0 cdimage.iso
286 .Dl mount -t cd9660 -o ro /dev/vn0 /mnt
288 Mount an ISO9660 CD image file.
293 Unmount the CD image file.
295 .Dl vnconfig -d vn0 myfilesystem mount=/mnt
302 Configures and enables all devices specified in
305 .Dl vnconfig -c vn0 somebackingfile
306 .Dl disklabel -r -w vn0s0 auto
307 .Dl disklabel -e vn0s0
309 Is an example of how to configure a file-backed
311 disk with a disk label
312 and to initialize and then edit the label.
313 Once you create the label, you
316 disk and, for example, create a filesystem on one of the partitions.
317 If you are using a file as backing store, it may be possible
320 disk after a crash by
322 the same file again and using the
324 configuration already stored in the file rather than
325 relabeling and recreating the filesystem.
326 It is even possible to
330 partitions that previously contained filesystems.
332 .Dl vnconfig -e -s reserve -S 400m vn1
333 .Dl disklabel -r -w vn1s0 auto
335 .Dl mount /dev/vn1s0 /usr/obj
337 Is an example of a swap-backed
341 that you have at least 400 megabytes of swap free (and hopefully much more).
342 The swap space is pre-reserved in order to maintain maximum performance.
343 We then label the disk, newfs it, and mount it as
347 devices are recoverable after a crash if you (A) use the
350 (B) the same swap is reserved as was the last time, meaning that such
352 would have to be run in your
354 In general, though, you only use swap-backed
356 devices to hold information you don't mind losing on every reboot.