1.\" $OpenBSD: vnconfig.8,v 1.6 2019/04/30 18:05:11 espie Exp $ 2.\" 3.\" Copyright (c) 1993 University of Utah. 4.\" Copyright (c) 1980, 1989, 1991, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" This code is derived from software contributed to Berkeley by 8.\" the Systems Programming Group of the University of Utah Computer 9.\" Science Department. 10.\" 11.\" Redistribution and use in source and binary forms, with or without 12.\" modification, are permitted provided that the following conditions 13.\" are met: 14.\" 1. Redistributions of source code must retain the above copyright 15.\" notice, this list of conditions and the following disclaimer. 16.\" 2. Redistributions in binary form must reproduce the above copyright 17.\" notice, this list of conditions and the following disclaimer in the 18.\" documentation and/or other materials provided with the distribution. 19.\" 3. Neither the name of the University nor the names of its contributors 20.\" may be used to endorse or promote products derived from this software 21.\" without specific prior written permission. 22.\" 23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)vnconfig.8 8.1 (Berkeley) 6/5/93 36.\" 37.\" 38.\" Copyright (c) 2007 Alexander von Gernler <grunk@openbsd.org> 39.\" 40.\" Permission to use, copy, modify, and distribute this software for any 41.\" purpose with or without fee is hereby granted, provided that the above 42.\" copyright notice and this permission notice appear in all copies. 43.\" 44.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 45.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 46.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 47.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 48.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 49.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 50.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 51.\" 52.Dd $Mdocdate: April 30 2019 $ 53.Dt VNCONFIG 8 54.Os 55.Sh NAME 56.Nm vnconfig 57.Nd configure vnode disks 58.Sh SYNOPSIS 59.Nm vnconfig 60.Op Fl v 61.Oo 62.Fl k | K Ar rounds 63.Op Fl S Ar saltfile 64.Oc 65.Op Fl t Ar disktype 66.Op Ar vnd_dev 67.Ar image 68.Nm vnconfig 69.Fl l 70.Op Ar vnd_dev 71.Nm vnconfig 72.Fl u 73.Op Fl v 74.Ar vnd_dev 75.Sh DESCRIPTION 76The 77.Nm vnconfig 78command configures vnode pseudo disk devices. 79It will associate (or disassociate) the special file 80.Ar vnd_dev 81with the regular file 82.Ar image , 83allowing the latter to be accessed as though it were a disk. 84If 85.Ar vnd_dev 86is not specified, an unused one will be allocated and the name printed 87to 88.Va stdout . 89.Pp 90The options are as follows: 91.Bl -tag -width Ds 92.It Fl K Ar rounds 93Associate an encryption key with the device. 94All data will be encrypted using the Blowfish cipher before it is 95written to the disk. 96The user is asked for both a passphrase and the name of a salt file. 97The salt file can also be specified on the command line using the 98.Fl S 99option. 100The passphrase and salt are combined according to PKCS #5 PBKDF2 for the 101specified number of 102rounds to generate the actual key used. 103.Ar rounds 104is a number between 1000 and 105.Dv INT_MAX . 106DO NOT LOSE THE SALT FILE. 107.It Fl k 108Associate an encryption key with the device. 109The user is asked for the encryption key. 110All data will be encrypted using the Blowfish cipher before it is 111written to the disk. 112.It Fl l 113List the vnd devices and indicate which ones are in use. 114If a specific 115.Ar vnd_dev 116is given, then only that one will be described. 117.It Fl S Ar saltfile 118When 119.Fl K 120is used, specify the 121.Pa saltfile . 122.It Fl t Ar disktype 123Specify a 124.Ar disktype 125entry from the 126.Xr disktab 5 127database. 128The 129.Ar vnd_dev 130will have the sector size, sectors per track, and tracks per cylinder values 131of the specified 132.Ar disktype . 133The defaults are 512-byte sectors, 100 sectors per track and 1 track per 134cylinder. 135.It Fl u 136Unconfigure a 137.Ar vnd_dev . 138.It Fl v 139Print messages to stdout describing actions taken. 140.El 141.Sh FILES 142.Bl -tag -width /etc/rvnd?? -compact 143.It Pa /dev/{,r}vnd* 144.El 145.Sh EXAMPLES 146Configure a CD-ROM or DVD image file as vnode disk vnd0 147and mount the ISO 9660 file system contained in it: 148.Bd -literal -offset indent 149# vnconfig vnd0 /tmp/diskimage 150# mount -t cd9660 /dev/vnd0c /mnt 151.Ed 152.Pp 153Configure an encrypted image file as vnode disk vnd0 and mount the FFS 154file system contained in the 155.Sq a 156partition of the disklabel. 157Same as above, but now configure the vnode using PKCS #5 PBKDF2 and 158a salt file with 20000 rounds: 159.Bd -literal -offset indent 160# vnconfig -K 20000 vnd0 /tmp/cryptimg 161Encryption key: 162Salt file: /tmp/cryptsalt 163# mount /dev/vnd0a /mnt 164.Ed 165.Sh SEE ALSO 166.Xr vnd 4 , 167.Xr disktab 5 , 168.Xr fstab 5 , 169.Xr mount 8 , 170.Xr swapon 8 , 171.Xr umount 8 172.Sh HISTORY 173The 174.Nm 175command first appeared in 176.Ox 4.2 . 177