xref: /netbsd/usr.sbin/vnconfig/vnconfig.8 (revision bf9ec67e)
1.\"	$NetBSD: vnconfig.8,v 1.22 2002/03/05 15:11:54 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 July 8, 1993
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 c
84.Op Fl f Ar disktab
85.Op Fl t Ar typename
86.Op Fl v
87.Ar vnode_disk
88.Ar regular_file
89.Op Ar geomspec
90.Nm ""
91.Fl u
92.Op Fl v
93.Ar vnode_disk
94.Sh DESCRIPTION
95The
96.Nm
97command configures vnode pseudo disk devices.
98It will associate the vnode disk
99.Ar vnode_disk
100with the regular file
101.Ar regular_file
102allowing the latter to be accessed as though it were a disk.
103Hence a regular file within the filesystem can be used for swapping
104or can contain a filesystem that is mounted in the name space.
105The
106.Ar vnode_disk
107is a special file of raw partition or name of vnode disk like
108.Pa vnd0 .
109.Pp
110Options indicate an action to be performed:
111.Bl -tag -width indent
112.It Fl c
113Configures the device.
114If successful, references to
115.Ar vnode_disk
116will access the contents of
117.Ar regular_file .
118.Pp
119If
120.Ar geomspec
121is specified, the vnode device will emulate the specified disk geometry.
122The format of the
123.Ar geomspec
124argument is:
125.Bd -ragged -offset indent
126.Sm off
127.Xo Ar secsize Li / Ar nsectors Li /
128.Ar ntracks Li / Ar ncylinders Xc
129.Sm on
130.Ed
131.Pp
132If geometry is not specified, the kernel will choose a default based on 1MB
133cylinders.
134.Ar secsize
135is the number of bytes per sector.  It must be an even multiple of 512.
136.Ar nsectors
137is the number of sectors per track.
138.Ar ntracks
139is the number of tracks per cylinder.
140.Ar ncylinders
141is the number of cylinders in the device.
142.It Fl f Ar disktab
143Specifies that the
144.Fl t
145option should look up in
146.Ar disktab
147instead of in
148.Pa /etc/disktab .
149.It Fl t Ar typename
150If configuring the device, look up
151.Ar typename
152in
153.Pa /etc/disktab
154and use the geometry specified in the entry.  This option and the
155.Ar geomspec
156argument are mutually exclusive.
157.It Fl u
158Unconfigures the device.
159.It Fl v
160Print messages to stdout describing actions taken.
161.El
162.Pp
163If no action option is given,
164.Fl c
165is assumed.
166.Sh FILES
167.Bl -tag -width /etc/disktab -compact
168.It Pa /dev/rvnd??
169.It Pa /dev/vnd??
170.It Pa /etc/disktab
171.El
172.Sh EXAMPLES
173.Dl vnconfig vnd0 /tmp/diskimage
174or
175.Dl vnconfig /dev/rvnd0c /tmp/diskimage
176.Pp
177Configures the vnode disk
178.Pa vnd0 .
179Please note that use of the second form of the command is discouraged because
180it requires knowledge of the raw partition which varies between architectures.
181.Pp
182.Dl vnconfig vnd0 /tmp/floppy.img 512/18/2/80
183.Pp
184Configures the vnode disk
185.Pa vnd0
186emulating the geometry of 512 bytes per sector, 18 sectors per track,
1872 tracks per cylinder, and 80 cylinders total.
188.Pp
189.Dl vnconfig -t floppy vnd0 /tmp/floppy.img
190.Pp
191Configures the vnode disk
192.Pa vnd0
193using the geometry specified in the
194.Pa floppy
195entry in
196.Pa /etc/disktab .
197.Pp
198.Dl vnconfig -u vnd0
199.Pp
200Unconfigures the
201.Pa vnd0
202device.
203.Sh SEE ALSO
204.Xr opendisk 3 ,
205.Xr vnd 4 ,
206.Xr mount 8 ,
207.Xr swapctl 8 ,
208.Xr umount 8
209.Sh HISTORY
210The
211.Nm
212command appeared in
213.Nx 1.0 .
214.Sh BUGS
215This command should really be named
216.Nm vndconfig .
217