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