From owner-man-jp-reviewer@jp.freebsd.org  Sat Jan 15 00:06:37 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id AAA35247;
	Sat, 15 Jan 2000 00:06:37 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from smtp8.dti.ne.jp (smtp8.dti.ne.jp [202.216.228.43])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id AAA35237
	for <man-jp-reviewer@jp.freebsd.org>; Sat, 15 Jan 2000 00:06:32 +0900 (JST)
	(envelope-from takaha@eurus.dti.ne.jp)
Received: from rynex (PPP404.tama-ap5.dti.ne.jp [210.170.194.36]) by smtp8.dti.ne.jp (8.9.3/3.7W) with SMTP id AAA15865 for <man-jp-reviewer@jp.freebsd.org>; Sat, 15 Jan 2000 00:06:25 +0900 (JST)
Date: Sat, 15 Jan 2000 00:06:25 +0900 (JST)
Message-Id: <200001141506.AAA15865@smtp8.dti.ne.jp>
From: takaha@eurus.dti.ne.jp (Daisuke Takahashi)
To: man-jp-reviewer@jp.freebsd.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
X-Mailer: mnews [version 1.21] 1997-12/23(Tue)
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: man-jp-reviewer 1920
Subject: [man-jp-reviewer 1920] vnconfig.8 (3.4R -> 20000105-HEAD)
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org
X-Originator: takaha@eurus.dti.ne.jp


$B9b66$G$9!#(B

vnconfig.8 $B$G$9!#(B

$BLu$r$d$k$3$H<+BN=i$a$F$G$9$N$G(B
$B$_$J$5$s$?$?$$$F$/$@$5$$!#(B

---
Daisuke Takahashi / $b$7$+$7$F2K$G$9$+!)


--- vnconfig.8.orig	Fri Jan 14 23:48:13 2000
+++ vnconfig.8	Fri Jan 14 23:57:18 2000
@@ -35,6 +35,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)vnconfig.8	8.1 (Berkeley) 6/5/93
+.\" %FreeBSD: src/usr.sbin/vnconfig/vnconfig.8,v 1.12 1999/09/21 01:03:10 dillon Exp %
 .\"
 .\" Original Revision: 1.6
 .\" jpman %Id: vnconfig.8,v 1.2 1997/05/03 13:45:51 horikawa Stab %
@@ -48,9 +49,10 @@
 .Sh $B=q<0(B
 .Nm vnconfig
 .Op Fl cdeguv
-.Op Fl s Ar option
-.Op Fl r Ar option
-.Ar special_file Ar regular_file
+.Op Fl s Ar option[,option...]
+.Op Fl r Ar option[,option...]
+.Op Fl S Ar value
+.Ar special_file Ar [regular_file]
 .Oo Ar feature Oc
 .Nm vnconfig
 .Fl a 
@@ -69,6 +71,9 @@
 $B8e$GDL>o%U%!%$%k$r%G%#%9%/$G$"$k$+$N$h$&$K%"%/%;%9$G$-$k$h$&$K$7$^$9!#(B
 $B$3$l$K$h$j%U%!%$%k%7%9%F%`Cf$NDL>o%U%!%$%k$r!"(B
 $B%9%o%C%W$d!"L>A06u4V$K%^%&%s%H$5$l$k%U%!%$%k%7%9%F%`$H=PMh$^$9!#(B
+$B$b$7%U%!%$%k$NBe$o$j$K%9%o%C%WNN0h$r;HMQ$7$?$$>l9g$K$O!"(B
+regular_file $B$r;XDj$;$:$K(B -S $B%*%W%7%g%s$rMQ$$$F%V%m%C%/%G%P%$%9$N(B
+$BBg$-$5$r;XDj$9$k$3$H$,$G$-$^$9!#(B
 .Pp
 $B%*%W%7%g%s$OF0:n$r;XDj$7$^$9(B:
 .Bl -tag -width indent
@@ -108,6 +113,21 @@
 .Bl -tag -width "follow"
 .It Ar labels 
 $B%G%#%9%/(B/$B%9%i%$%9%i%Y%k$r;HMQ$7$^$9!#(B
+.It Ar reserve
+$B%U%!%$%k$d%9%o%C%WNN0h$r$"$i$+$8$aM=Ls$7$^$9!#(B
+$B8=:_$N$H$3$m%9%o%C%WNN0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400m vn0
+.Dl disklabel -r -w vn1 auto
+.Dl newfs /dev/rvn1c
+.Dl mount /dev/vn1c /usr/obj
+.Pp
+$B%9%o%C%W$rMQ$$$?(B VN $B%G%#%9%/$N@_DjNc$G$9!#(B
+$B$3$NNc$G$O>/$J$/$H$b(B 400 $B%a%,%P%$%H(B($B$b$7$/$O$=$l0J>e$,K>$^$7$$(B)$B$N(B
+$B6u$-$,%9%o%C%W$K$"$k$H2>Dj$7$F$$$^$9!#(B
+$B%9%o%C%WNN0h$O:GBg$N%Q%U%)!<%^%s%9$rF@$k$?$a$K(B
+$B$"$i$+$8$aM=Ls$5$l$^$9!#(B
+$B$=$N8e%G%#%9%/$KBP$7$F%i%Y%k$r:n@.$7!"(B
+newfs $B$r<B9T$7!"(B /usr/obj $B$K%^%&%s%H$7$^$9!#(B
+$B%9%o%C%W$rMQ$$$?(B VN $B%G%P%$%9$O%/%i%C%7%e8e(B
+(A) reserve $B%U%i%0$r;XDj$7$F$$$k!"(B
+(B) $BA02s$HF1$8%9%o%C%W$,3NJ]$5$l$F$$$k!"$D$^$j(Bvnconfig $B$,(B rc.local $B$G5/F0$5$l$F$$$k>l9g2sI|2DG=$G$9!#(B
+$B$7$+$7$J$,$i0lHLE*$K%9%o%C%W$rMQ$$$?(B VN $B%G%P%$%9$O(B
+$B%j%V!<%H;~$K<:$o$l$F$b9=$o$J$$$h$&$J%G!<%?$rJ]B8$9$k$?$a$K(B
+$B;HMQ$7$^$9!#(B
 .Sh $B4XO"9`L\(B
 .Xr mount 2 ,
 .Xr swapon 2 ,

--- vnconfig.e.34	Fri Jan 14 23:48:13 2000
+++ vnconfig.e.40	Fri Jan 14 23:48:13 2000
@@ -35,6 +35,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)vnconfig.8	8.1 (Berkeley) 6/5/93
+.\" $FreeBSD: src/usr.sbin/vnconfig/vnconfig.8,v 1.12 1999/09/21 01:03:10 dillon Exp $
 .\"
 .Dd July 8, 1993
 .Dt VNCONFIG 8
@@ -45,9 +46,10 @@
 .Sh SYNOPSIS
 .Nm vnconfig
 .Op Fl cdeguv
-.Op Fl s Ar option
-.Op Fl r Ar option
-.Ar special_file Ar regular_file
+.Op Fl s Ar option[,option...]
+.Op Fl r Ar option[,option...]
+.Op Fl S Ar value
+.Ar special_file Ar [regular_file]
 .Op Ar feature
 .Nm vnconfig
 .Fl a 
@@ -65,7 +67,10 @@
 .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.
+or can contain a filesystem that is mounted in the name space.  If you
+want to use swap backing store for your device instead of a file, you
+can leave regular_file out and specify the size of the block device
+with the -S option.
 .Pp
 Options indicate an action to be performed:
 .Bl -tag -width indent
@@ -101,6 +106,15 @@
 .Bl -tag -width "follow"
 .It Ar labels 
 use disk/slice labels.
+.It Ar reserve 
+Pre-reserve the blocks underlying the file or swap backing store.  Currently only
+works for swap backing store.  This option also disables on-the-fly freeing of 
+the underlying backing store (for example, when you remove a large file). 
+Use this option if you wish to avoid long-term fragmentation of the backing
+store.  Also note that when this option is used, the initial contents of the
+backing store may contain garbage rather then zeros.  It may even be possible to
+recover the prior contents of a swap-backed VN across a reboot if the VN device
+is configured before any swap is allocated by the system.
 .It Ar follow 
 debug flow in the 
 .Xr vn 4
@@ -124,6 +138,22 @@
 The list of allowed flags and their meanings are the same as for the
 .Fl r
 option.
+.It Fl S Ar value{k,m,g,t}
+If no regular file is specified, VN will use swap for backing store.
+This option specifies the size of the device.  For example, '23m' for
+23 megabytes.  The VN device will round the size up to a machine page boundry.
+Filesystems up to 7.9 terrabytes are supported.  When specified along with
+a regular file, this option overrides the regular file's size insofar as
+VN is concerned.
+.It Fl T
+When a regular file is specified, VN will ftruncate() the file to 0 first.
+Normally you should also specify the -S option to set the size of the file.
+This option also creates the file if it did not previously exist.
+This option is only meaningful if the -S option has been specified.
+.It Fl Z
+When a regular file is specified, VN will zero the contents of the file to
+ensure that all blocks have been allocated by the filesystem.  This option is
+only meaningful if the -S option has been specified.
 .It Fl u
 Disable and ``unconfigure'' the device.
 .It Fl v
@@ -175,18 +205,18 @@
 .El
 .Sh EXAMPLES
 .Pp
-.Dl vnconfig /dev/vn0c /tmp/diskimage
+.Dl vnconfig vn0c /tmp/diskimage
 .Pp
 Configures the vnode disk
 .Pa vn0c .
 .Pp
-.Dl vnconfig -e /dev/vn0c /var/swapfile swap
+.Dl vnconfig -e vn0c /var/swapfile swap
 .Pp
 Configures
 .Pa vn0c
 and enables swapping on it.
 .Pp
-.Dl vnconfig -d /dev/vn0c myfilesystem mount=/mnt
+.Dl vnconfig -d vn0c myfilesystem mount=/mnt
 .Pp
 Unmounts (disables)
 .Pa vn0c .
@@ -195,6 +225,34 @@
 .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 ,
