xref: /netbsd/usr.sbin/vnconfig/vnconfig.8 (revision 6550d01e)
1.\"	$NetBSD: vnconfig.8,v 1.34 2008/05/02 18:11:06 martin Exp $
2.\"
3.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Jason R. Thorpe.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
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.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.\" Copyright (c) 1980, 1989, 1991, 1993
31.\"	The Regents of the University of California.  All rights reserved.
32.\"
33.\" This code is derived from software contributed to Berkeley by
34.\" the Systems Programming Group of the University of Utah Computer
35.\" Science Department.
36.\"
37.\" Redistribution and use in source and binary forms, with or without
38.\" modification, are permitted provided that the following conditions
39.\" are met:
40.\" 1. Redistributions of source code must retain the above copyright
41.\"    notice, this list of conditions and the following disclaimer.
42.\" 2. Redistributions in binary form must reproduce the above copyright
43.\"    notice, this list of conditions and the following disclaimer in the
44.\"    documentation and/or other materials provided with the distribution.
45.\" 3. Neither the name of the University nor the names of its contributors
46.\"    may be used to endorse or promote products derived from this software
47.\"    without specific prior written permission.
48.\"
49.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59.\" SUCH DAMAGE.
60.\"
61.\" Copyright (c) 1993 University of Utah.
62.\"
63.\" This code is derived from software contributed to Berkeley by
64.\" the Systems Programming Group of the University of Utah Computer
65.\" Science Department.
66.\"
67.\" Redistribution and use in source and binary forms, with or without
68.\" modification, are permitted provided that the following conditions
69.\" are met:
70.\" 1. Redistributions of source code must retain the above copyright
71.\"    notice, this list of conditions and the following disclaimer.
72.\" 2. Redistributions in binary form must reproduce the above copyright
73.\"    notice, this list of conditions and the following disclaimer in the
74.\"    documentation and/or other materials provided with the distribution.
75.\" 3. All advertising materials mentioning features or use of this software
76.\"    must display the following acknowledgement:
77.\"	This product includes software developed by the University of
78.\"	California, Berkeley and its contributors.
79.\" 4. Neither the name of the University nor the names of its contributors
80.\"    may be used to endorse or promote products derived from this software
81.\"    without specific prior written permission.
82.\"
83.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
84.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
85.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
86.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
87.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
88.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
89.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
90.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
91.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
92.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
93.\" SUCH DAMAGE.
94.\"
95.\"     @(#)vnconfig.8	8.1 (Berkeley) 6/5/93
96.\"
97.Dd July 16, 2005
98.Dt VNCONFIG 8
99.Os
100.Sh NAME
101.Nm vnconfig
102.Nd configure vnode disks
103.Sh SYNOPSIS
104.Nm
105.Op Fl crvz
106.Op Fl f Ar disktab
107.Op Fl t Ar typename
108.Ar vnode_disk
109.Ar regular_file
110.Op Ar geomspec
111.Nm
112.Fl u
113.Op Fl Fv
114.Ar vnode_disk
115.Nm
116.Fl l
117.Op Ar vnode_disk
118.Sh DESCRIPTION
119The
120.Nm
121command configures vnode pseudo disk devices.
122It will associate the vnode disk
123.Ar vnode_disk
124with the regular file
125.Ar regular_file
126allowing the latter to be accessed as though it were a disk.
127Hence a regular file within the filesystem can be used for swapping
128or can contain a filesystem that is mounted in the name space.
129The
130.Ar vnode_disk
131is a special file of raw partition or name of vnode disk like
132.Pa vnd0 .
133.Pp
134Options indicate an action to be performed:
135.Bl -tag -width indent
136.It Fl c
137Configures the device.
138If successful, references to
139.Ar vnode_disk
140will access the contents of
141.Ar regular_file .
142.Pp
143If
144.Ar geomspec
145is specified, the vnode device will emulate the specified disk geometry.
146The format of the
147.Ar geomspec
148argument is:
149.Bd -ragged -offset indent
150.Sm off
151.Xo Ar secsize Li / Ar nsectors Li /
152.Ar ntracks Li / Ar ncylinders Xc
153.Sm on
154.Ed
155.Pp
156If geometry is not specified, the kernel will choose a default based on 1MB
157cylinders.
158.Ar secsize
159is the number of bytes per sector.  It must be an even multiple of 512.
160.Ar nsectors
161is the number of sectors per track.
162.Ar ntracks
163is the number of tracks per cylinder.
164.Ar ncylinders
165is the number of cylinders in the device.
166.It Fl F
167Force unconfiguration if the device is in use.
168Does not imply
169.Fl u .
170.It Fl f Ar disktab
171Specifies that the
172.Fl t
173option should look up in
174.Ar disktab
175instead of in
176.Pa /etc/disktab .
177.It Fl l
178List the vnd devices and indicate which ones are in use.  If a specific
179.Ar vnode_disk
180is given, then only that will be described.
181.It Fl t Ar typename
182If configuring the device, look up
183.Ar typename
184in
185.Pa /etc/disktab
186and use the geometry specified in the entry.  This option and the
187.Ar geomspec
188argument are mutually exclusive.
189.It Fl r
190Configure the device as read-only.
191.It Fl u
192Unconfigures the device.
193.It Fl v
194Print messages to stdout describing actions taken.
195.It Fl z
196Assume that
197.Ar regular_file
198is a compressed disk image in cloop2 format, and configure it
199read-only.
200See the
201.Xr vndcompress 1
202manpage on how to create such an image.
203.El
204.Pp
205If no action option is given,
206.Fl c
207is assumed.
208.Sh FILES
209.Bl -tag -width /etc/disktab -compact
210.It Pa /dev/rvnd??
211.It Pa /dev/vnd??
212.It Pa /etc/disktab
213.El
214.Sh EXAMPLES
215.Dl vnconfig vnd0 /tmp/diskimage
216or
217.Dl vnconfig /dev/rvnd0c /tmp/diskimage
218.Pp
219Configures the vnode disk
220.Pa vnd0 .
221Please note that use of the second form of the command is discouraged because
222it requires knowledge of the raw partition which varies between architectures.
223.Pp
224.Dl vnconfig vnd0 /tmp/floppy.img 512/18/2/80
225.Pp
226Configures the vnode disk
227.Pa vnd0
228emulating the geometry of 512 bytes per sector, 18 sectors per track,
2292 tracks per cylinder, and 80 cylinders total.
230.Pp
231.Dl vnconfig -t floppy vnd0 /tmp/floppy.img
232.Pp
233Configures the vnode disk
234.Pa vnd0
235using the geometry specified in the
236.Pa floppy
237entry in
238.Pa /etc/disktab .
239.Pp
240.Dl vnconfig -u vnd0
241.Pp
242Unconfigures the
243.Pa vnd0
244device.
245.Sh SEE ALSO
246.Xr opendisk 3 ,
247.Xr vnd 4 ,
248.Xr mount 8 ,
249.Xr swapctl 8 ,
250.Xr umount 8
251.Sh HISTORY
252The
253.Nm
254command appeared in
255.Nx 1.0 .
256.Sh BUGS
257This command should really be named
258.Nm vndconfig .
259