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