xref: /netbsd-src/usr.sbin/vnconfig/vnconfig.8 (revision 11a6dbe72840351315e0652b2fc6663628c84cad)
$NetBSD: vnconfig.8,v 1.33 2005/09/11 23:49:58 wiz Exp $

Copyright (c) 1997 The NetBSD Foundation, Inc.
All rights reserved.

This code is derived from software contributed to The NetBSD Foundation
by Jason R. Thorpe.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the NetBSD
Foundation, Inc. and its contributors.
4. Neither the name of The NetBSD Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Copyright (c) 1980, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

This code is derived from software contributed to Berkeley by
the Systems Programming Group of the University of Utah Computer
Science Department.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

Copyright (c) 1993 University of Utah.

This code is derived from software contributed to Berkeley by
the Systems Programming Group of the University of Utah Computer
Science Department.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

@(#)vnconfig.8 8.1 (Berkeley) 6/5/93

.Dd July 16, 2005 .Dt VNCONFIG 8 .Os .Sh NAME .Nm vnconfig .Nd configure vnode disks .Sh SYNOPSIS .Nm .Op Fl crvz .Op Fl f Ar disktab .Op Fl t Ar typename .Ar vnode_disk .Ar regular_file .Op Ar geomspec .Nm .Fl u .Op Fl Fv .Ar vnode_disk .Nm .Fl l .Op Ar vnode_disk .Sh DESCRIPTION The .Nm command configures vnode pseudo disk devices. It will associate the vnode disk .Ar vnode_disk with the regular file .Ar regular_file allowing the latter to be accessed as though it were a disk. Hence a regular file within the filesystem can be used for swapping or can contain a filesystem that is mounted in the name space. The .Ar vnode_disk is a special file of raw partition or name of vnode disk like

a vnd0 .

p Options indicate an action to be performed: l -tag -width indent t Fl c Configures the device. If successful, references to .Ar vnode_disk will access the contents of .Ar regular_file .

p If .Ar geomspec is specified, the vnode device will emulate the specified disk geometry. The format of the .Ar geomspec argument is: d -ragged -offset indent .Sm off .Xo Ar secsize Li / Ar nsectors Li / .Ar ntracks Li / Ar ncylinders Xc .Sm on .Ed

p If geometry is not specified, the kernel will choose a default based on 1MB cylinders. .Ar secsize is the number of bytes per sector. It must be an even multiple of 512. .Ar nsectors is the number of sectors per track. .Ar ntracks is the number of tracks per cylinder. .Ar ncylinders is the number of cylinders in the device. t Fl F Force unconfiguration if the device is in use. Does not imply .Fl u . t Fl f Ar disktab Specifies that the .Fl t option should look up in .Ar disktab instead of in

a /etc/disktab . t Fl l List the vnd devices and indicate which ones are in use. If a specific .Ar vnode_disk is given, then only that will be described. t Fl t Ar typename If configuring the device, look up .Ar typename in

a /etc/disktab and use the geometry specified in the entry. This option and the .Ar geomspec argument are mutually exclusive. t Fl r Configure the device as read-only. t Fl u Unconfigures the device. t Fl v Print messages to stdout describing actions taken. t Fl z Assume that .Ar regular_file is a compressed disk image in cloop2 format, and configure it read-only. See the .Xr vndcompress 1 manpage on how to create such an image. .El

p If no action option is given, .Fl c is assumed. .Sh FILES l -tag -width /etc/disktab -compact t Pa /dev/rvnd?? t Pa /dev/vnd?? t Pa /etc/disktab .El .Sh EXAMPLES .Dl vnconfig vnd0 /tmp/diskimage or .Dl vnconfig /dev/rvnd0c /tmp/diskimage

p Configures the vnode disk

a vnd0 . Please note that use of the second form of the command is discouraged because it requires knowledge of the raw partition which varies between architectures.

p .Dl vnconfig vnd0 /tmp/floppy.img 512/18/2/80

p Configures the vnode disk

a vnd0 emulating the geometry of 512 bytes per sector, 18 sectors per track, 2 tracks per cylinder, and 80 cylinders total.

p .Dl vnconfig -t floppy vnd0 /tmp/floppy.img

p Configures the vnode disk

a vnd0 using the geometry specified in the

a floppy entry in

a /etc/disktab .

p .Dl vnconfig -u vnd0

p Unconfigures the

a vnd0 device. .Sh SEE ALSO .Xr opendisk 3 , .Xr vnd 4 , .Xr mount 8 , .Xr swapctl 8 , .Xr umount 8 .Sh HISTORY The .Nm command appeared in .Nx 1.0 . .Sh BUGS This command should really be named .Nm vndconfig .