.\" $OpenBSD: vnconfig.8,v 1.30 2007/01/27 10:34:46 grunk Exp $ .\" .\" Copyright (c) 1993 University of Utah. .\" 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. .\" .\" @(#)vnconfig.8 8.1 (Berkeley) 6/5/93 .\" .Dd July 8, 1993 .Dt VNCONFIG 8 .Os .Sh NAME .Nm vnconfig .Nd "configure vnode disks for file swapping or pseudo file systems" .Sh SYNOPSIS .Nm .Op Fl ckluv .Op Fl K Ar rounds .Op Fl S Ar saltfile .Ar rawdev .Ar regular_file .Sh DESCRIPTION The .Nm command configures vnode pseudo disk devices. It will associate (or disassociate) the special file .Ar rawdev 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 file system can be used for swapping or can contain a file system that is mounted in the name space. .Pp Both traditional devices, .Xr vnd 4 , and the cache-coherent devices, .Pa svnd , are configured through .Nm vnconfig . .Pa svnd should be mounted with the .Xr mount 8 option .Dq sync if .Ar regular_file is being read from, to ensure consistency in the buffer cache. For normal operation this is not necessary. .Pp The options are as follows: .Bl -tag -width Ds .It Fl c Configures the device. If successful, references to .Ar rawdev will access the contents of .Ar regular_file . This is the default operation. .It Fl K Ar rounds Associate an encryption key with the device. All data will be encrypted using the Blowfish cipher before it is written to the disk. The user is asked for both a passphrase and the name of a salt file. The salt file can also be specified on the command line using the .Fl S option. The passphrase and salt are combined according to PKCS #5 PBKDF2 for the specified number of rounds to generate the actual key used. .Ar rounds is a number between 1000 and .Dv INT_MAX . DO NOT LOSE THE SALT FILE. Encryption only works with .Pa svnd . .It Fl k Associate an encryption key with the device. All data will be encrypted using the Blowfish cipher before it is written to the disk. Encryption only works with .Pa svnd . .It Fl l List the (s)vnd devices and indicate which ones are in use. If a specific .Ar rawdev is given, then only that one will be described. .It Fl S Ar saltfile When .Fl K is used, specify the .Pa saltfile . .It Fl u Unconfigures a .Ar rawdev . .It Fl v Print messages to stdout describing actions taken. .El .Sh FILES .Bl -tag -width /etc/rvnd?? -compact .It Pa /dev/{,r}{,s}vnd* .El .Sh EXAMPLES Configure a CD-ROM or DVD image file as vnode disk svnd0 and mount the ISO 9660 file system contained in it: .Bd -literal -offset indent # vnconfig svnd0 /tmp/diskimage # mount -t cd9660 /dev/svnd0c /mnt .Ed .Pp Configure an encrypted image file as vnode disk svnd0 and mount the FFS file system contained in it. The encryption key does not echo and must be entered every time the vnode disk is configured. .Bd -literal -offset indent # vnconfig -k svnd0 /tmp/cryptimg Encryption key: # mount /dev/svnd0c /mnt .Ed .Pp Same as above, but now configure the vnode using PKCS #5 PBKDF2 and a salt file with 20000 rounds: .Bd -literal -offset indent # vnconfig -K 20000 svnd0 /tmp/cryptimg Encryption key: Salt file: /tmp/cryptsalt # mount /dev/svnd0c /mnt .Ed .Pp Unmount the file system and unconfigure the vnode device: .Bd -literal -offset indent # umount /mnt # vnconfig -u svnd0 .Ed .Sh SEE ALSO .Xr vnd 4 , .Xr mount 8 , .Xr swapon 8 , .Xr umount 8 .Sh BUGS This command should really be named .Nm vndconfig .