Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
VNCONFIG(8)             FreeBSD System Manager's Manual            VNCONFIG(8)

     vnconfig -- configure and enable vnode disks

     vnconfig [-cdeguvTZ] [-s option[,option...]] [-r option[,option...]]
              [-S value] special_file [regular_file] [feature]
     vnconfig -a [-cdeguv] [-s option] [-r option] [-f config_file]

     The vnconfig command configures and enables vnode pseudo disk devices.
     The first form of the command will associate the special file
     special_file with the regular file 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.  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.

     Options indicate an action to be performed:

     -a      Read a command file and performs the specified actions for each
             device/file pair.

     -c      Configure the device.  If successful, references to special_file
             will access the contents of regular_file.

     -d      Disable (if possible) the specified feature.

     -e      Configure the device and enables any feature that was specified.
             If no feature was specified, -e is the same as -c.

     -f config_file
             Use config_file as an alternate config file.

     -g      Fiddle global options.

     -r flag
             Reset flag.  The list of allowed flags and their meanings are:

             labels  use disk/slice labels.

                     Pre-reserve the blocks underlying the file or swap back-
                     ing 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 con-
                     figured before any swap is allocated by the system.

             follow  debug flow in the vn(4) driver.

             debug   debug data in the vn(4) driver.

             io      debug I/O in the vn(4) driver.

             all     turn on all flags.

             none    turn off all flags.

     -s flag
             Set flag.  The list of allowed flags and their meanings are the
             same as for the -r option.

     -S 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 exam-
             ple, '23m' for 23 megabytes.  The VN device will round the size
             up to a machine page boundary.  Filesystems up to 7.9 terabytes
             are supported.  When specified along with a regular file, this
             option overrides the regular file's size insofar as VN is con-

     -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.

     -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.

     -u      Disable and ``unconfigure'' the device.

     -v      Print messages to stdout describing actions taken.

     If no action option is given, -c is assumed.

     The feature argument specifies a feature that can be enabled via the -e

     swap    Swapping is enabled on the special file.  See swapon(2).

             The special file is mounted read-only on mount_point.  See

             The special file is mounted read-write on mount_point.  See

             Same as ``mountrw=''.

     A configuration file contains one line per device/file pair in the form:

             special_file    regular_file    [ feature ]

     where fields are separated by white space.  The previously described
     action options serve to configure, enable, disable or unconfigure all
     devices in the configuration file.

     /etc/vntab  default configuration file for -a option

           vnconfig vn0c /tmp/diskimage

     Configures the vnode disk vn0c.

           vnconfig -e vn0c /var/swapfile swap

     Configures vn0c and enables swapping on it.

           vnconfig -c -v /dev/vn0 cdimage.iso
           mount -t cd9660 -o ro /dev/vn0 /mnt

     Mount an ISO9660 CD image file.

           umount /mnt
           vnconfig -u vn0c

     Unmount the CD image file.

           vnconfig -d vn0c myfilesystem mount=/mnt

     Unmounts (disables) vn0c.

           vnconfig -ae

     Configures and enables all devices specified in /etc/vntab.

           vnconfig -s labels -c vn0 somebackingfile
           disklabel -r -w vn0 auto
           disklabel -e vn0

     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 possi-
     ble to fsck the VN partitions that previously contained filesystems.

           vnconfig -e -s labels,reserve -S 400m vn1
           disklabel -r -w vn1 auto
           newfs /dev/vn1c
           mount /dev/vn1c /usr/obj

     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.

     mount(2), swapon(2), unmount(2), vn(4)

FreeBSD 4.10                     July 8, 1993                     FreeBSD 4.10


Want to link to this manual page? Use this URL:

home | help