xref: /netbsd-src/usr.sbin/vnconfig/vnconfig.8 (revision a5a68ff5f29de57339ca14f6c671c0a87714f1f8)
1.\"	$NetBSD: vnconfig.8,v 1.11 1997/10/01 01:32:59 enami 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 BSD 4
78.Sh NAME
79.Nm vnconfig
80.Nd configure vnode disks
81.Sh SYNOPSIS
82.Nm vnconfig Op Fl c
83.Op Fl t Ar typename
84.Op Fl v
85.Ar vnode_disk
86.Ar regular_file
87.Op Ar geomspec
88.Nm vnconfig Fl u
89.Op Fl v
90.Ar vnode_disk
91.Sh DESCRIPTION
92The
93.Nm vnconfig
94command configures vnode pseudo disk devices.
95It will associate the vnode disk
96.Ar vnode_disk
97with the regular file
98.Ar regular_file
99allowing the latter to be accessed as though it were a disk.
100Hence a regular file within the filesystem can be used for swapping
101or can contain a filesystem that is mounted in the name space.
102The
103.Ar vnode_disk
104is a special file of raw partition or name of vnode disk like
105.Pa vnd0 .
106.Pp
107Options indicate an action to be performed:
108.Bl -tag -width indent
109.It Fl c
110Configures the device.
111If successful, references to
112.Ar vnode_disk
113will access the contents of
114.Ar regular_file .
115If
116.Op Ar geomspec
117is specified, the vnode device will emulate the specified disk geometry.
118The format of the
119.Op Ar geomspec
120argument is
121.Dq secsize/nsectors/ntracks/ncylinders .
122If geometry is not specified, the kernel will choose a default based on 1MB
123cylinders.
124.Dq secsize
125is the number of bytes per sector.  It must be an even multiple of 512.
126.Dq nsectors
127is the number of sectors per track.
128.Dq ntracks
129is the number of tracks per cylinder.
130.Dq ncylinders
131is the number of cylinders in the device.
132.It Fl t Ar typename
133If configuring the device, look up
134.Ar typename
135in
136.Pa /etc/disktab
137and use the geometry specified in the entry.  This option is mutually
138exclusive the
139.Ar geomspec
140argument.
141.It Fl u
142Unconfigures the device.
143.It Fl v
144Print messages to stdout describing actions taken.
145.El
146.Pp
147If no action option is given,
148.Fl c
149is assumed.
150.Sh FILES
151.Bl -tag -width /etc/disktab -compact
152.It Pa /dev/rvnd??
153.It Pa /dev/vnd??
154.It Pa /etc/disktab
155.El
156.Sh EXAMPLES
157.Pp
158.Dl vnconfig /dev/vnd0c /tmp/diskimage
159or
160.Dl vnconfig vnd0 /tmp/diskimage
161.Pp
162Configures the vnode disk
163.Pa vnd0 .
164.Pp
165.Dl vnconfig /dev/vnd0c /tmp/floppy.img 512/18/2/80
166.Pp
167Configures the vnode disk
168.Pa vnd0
169emulating the geometry of 512 bytes per sector, 18 sectors per track,
1702 tracks per cylinder, and 80 cylinders total.
171.Pp
172.Pp
173.Dl vnconfig -t floppy /dev/vnd0c /tmp/floppy.img
174.Pp
175Configures the vnode disk
176.Pa vnd0
177using the geometry specified in the
178.Pa floppy
179entry in
180.Pa /etc/disktab .
181.Pp
182.Dl vnconfig -u /dev/vnd0c
183.Pp
184Unconfigures the
185.Pa vnd0
186device.
187.Sh BUGS
188This command should really be named
189.Nm vndconfig .
190.Sh SEE ALSO
191.Xr opendisk 3 ,
192.Xr swapctl 8 ,
193.Xr mount 8 ,
194.Xr umount 8 ,
195.Xr vnd 4 .
196