xref: /openbsd/sbin/mount_vnd/mount_vnd.8 (revision e5dd7070)
1.\"	$OpenBSD: mount_vnd.8,v 1.24 2020/04/23 21:33:04 jmc 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 23 2020 $
53.Dt MOUNT_VND 8
54.Os
55.Sh NAME
56.Nm mount_vnd
57.Nd mount vnode disks
58.Sh SYNOPSIS
59.Nm mount_vnd
60.Op Fl k
61.Op Fl K Ar rounds
62.Op Fl o Ar options
63.Op Fl S Ar saltfile
64.Op Fl t Ar disktype
65.Ar image vnd_dev
66.Sh DESCRIPTION
67.Nm mount_vnd
68works similarly to
69.Xr vnconfig 8 ,
70but it provides an interface that can be used by the
71.Xr fstab 5
72infrastructure, so that an
73.Ar image
74file can be configured to a device
75.Ar vnd_dev
76while booting.
77.Pp
78For
79.Xr fstab 5
80lines with type
81.Dq ffs ,
82the
83.Dq noauto
84option must be set to prevent a
85.Xr mount 8
86of the FFS partitions
87before the necessary vnd devices are configured.
88Also, the
89.Dq fs_passno
90field has to be set to 0 to prevent
91.Xr fsck 8
92from checking the file system for the same reasons.
93.Pp
94.Nm mount_vnd
95is invoked by
96.Xr mount 8
97when using the following syntax:
98.Bd -ragged -offset 4n
99.Nm mount Op options
100-t vnd
101.Ar image vnd_dev
102.Ed
103.Pp
104The options are as follows:
105.Bl -tag -width Ds
106.It Fl K Ar rounds
107Associate an encryption key with the device.
108All data will be encrypted using the Blowfish cipher before it is
109written to the disk.
110The user is asked for both a passphrase and the name of a salt file.
111The salt file can also be specified on the command line using the
112.Fl S
113option.
114The passphrase and salt are combined according to PKCS #5 PBKDF2 for the
115specified number of
116rounds to generate the actual key used.
117.Ar rounds
118is a number between 1000 and
119.Dv INT_MAX .
120DO NOT LOSE THE SALT FILE.
121.It Fl k
122Associate an encryption key with the device.
123All data will be encrypted using the Blowfish cipher before it is
124written to the disk.
125.It Fl o Ar options
126Options are specified with a
127.Fl o
128flag followed by a comma separated string of options.
129See the
130.Xr mount 8
131man page for possible options and their meanings.
132.Pp
133At the moment,
134.Fl o
135is only here for compatibility reasons, but no use is made of supplied
136options.
137.It Fl S Ar saltfile
138When
139.Fl K
140is used, specify the
141.Pa saltfile .
142.It Fl t Ar disktype
143Specify a
144.Ar disktype
145entry from the
146.Xr disktab 5
147database.
148The
149.Ar vnd_dev
150will have the sector size, sectors per track, and tracks per cylinder values
151of the specified
152.Ar disktype .
153The defaults are 512-byte sectors, 100 sectors per track and 1 track per
154cylinder.
155.El
156.Sh FILES
157.Bl -tag -width /etc/rvnd?? -compact
158.It Pa /dev/{,r}vnd*
159.El
160.Sh EXAMPLES
161An example
162.Xr fstab 5
163entry is:
164.Bd -literal -offset indent
165/tmp/cryptimg /dev/vnd0c vnd rw,noauto,-k       0 0
166/dev/vnd0a   /mnt        ffs rw,noauto          0 0
167.Ed
168.Pp
169Mounting images during the first pass of
170.Xr fsck 8
171and
172.Xr mount 8
173is not possible, because the image to be configured to a vnd itself
174resides on a file system that first has to be checked and mounted.
175.Sh SEE ALSO
176.Xr vnd 4 ,
177.Xr disktab 5 ,
178.Xr fstab 5 ,
179.Xr mount 8 ,
180.Xr swapon 8 ,
181.Xr umount 8
182.Sh HISTORY
183The
184.Nm
185command first appeared in
186.Ox 4.2 .
187