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