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