diff --git a/share/man/man4/vn.4 b/share/man/man4/vn.4 index 324cc8f5987f..8d0ab7c1bc0d 100644 --- a/share/man/man4/vn.4 +++ b/share/man/man4/vn.4 @@ -44,9 +44,15 @@ .Sh DESCRIPTION The .Nm -driver provides a disk-like interface to a file. This is useful for -a variety of applications, including swap files and building mini-root -or floppy disk images. +driver uses swap or a file as backing store to abstract-out a character and +block device which may then be used like a disk. The +.Nm +driver supports both labeled and unlabeled pseudo-disks and is useful for +a variety of applications, including swap files and building mini-root, +floppy, or CDRom disk images. +.Nm +may also be used to create temporary swap-backed filesystems, such as /tmp, +in a somewhat less memory-hungry manner then MFS. .Pp This document assumes that you're familiar with how to generate kernels, how to properly configure disks and pseudo-devices in a kernel @@ -67,6 +73,9 @@ argument is how many memory is allocated for a boot time. In this example, no more than 4 .Nm vn Ns 's may be configured. +.Nm +may also exist as a kernel module to be automatically loaded into the +system when you run the vnconfig command for the first time. .Pp There is a run-time utility that is used for configuring .Nm vn Ns 's . @@ -82,7 +91,8 @@ driver does not work if the file does not reside in a local filesystem. .Pp .Sh HISTORY The vnode disk driver was originally written at the University of -Utah. +Utah and was substantially modified by FreeBSD developers to add +swap-backed support. .Sh SEE ALSO .Xr config 8 , .Xr fsck 8 , diff --git a/usr.sbin/vnconfig/vnconfig.8 b/usr.sbin/vnconfig/vnconfig.8 index 7cfe517026c4..9b2e3c8a0c43 100644 --- a/usr.sbin/vnconfig/vnconfig.8 +++ b/usr.sbin/vnconfig/vnconfig.8 @@ -225,6 +225,34 @@ Unmounts (disables) .Pp Configures and enables all devices specified in .Pa /etc/vntab . +.Pp +.Dl vnconfig -s labels -c vn0 somebackingfile +.Dl disklabel -r -w vn0 auto +.Dl disklabel -e vn0 +.Pp +Is an example of how to configure a file-backed VN disk with a disk label +and to initialize and then edit the label. Once you create the label, you +can partition your VN disk and, for example, create a filesystem on one of +the partitions. If you are using a file as backing store, it may be possible +to recover your VN disk after a crash by vnconfig'ing the same file again +and using the VN configuration already stored in the file rather then +relabeling and recreating the filesystem. It is even possible to fsck the +VN partitions that previously contained filesystems. +.Pp +.Dl vnconfig -e -s labels,reserve -S 400m vn0 +.Dl disklabel -r -w vn1 auto +.Dl newfs /dev/rvn1c +.Dl mount /dev/vn1c /usr/obj +.Pp +Is an example of a swap-backed VN disk configuration. This example assumes +that you have at least 400 megabytes of swap free (and hopefully much more). +The swap space is pre-reserved in order to maintain maximum performance. +We then label the disk, newfs it, and mount it as /usr/obj. Swap-backed VN +devices are recoverable after a crash if you (A) use the reserve flag, and if +(B) the same swap is reserved as was the last time, meaning that such +vnconfig's would have to be run in your rc.local. In general, though, you +only use swap-backed VN devices to hold information you don't mind losing +on every reboot. .Sh SEE ALSO .Xr mount 2 , .Xr swapon 2 ,