.\" $Aero: util/diskprep/diskprep.8,v 1.4 2005/08/05 23:29:26 brooks Exp $ .\" .Dd July 10, 2003 .Dt DISKPREP 8 .Os .Sh NAME .Nm diskprep .Nd a program to prepare disks for use based on a config file .Sh SYNOPSIS .Nm .Op Fl -config Ar configfile .Op Fl -label Ar label .Ar disk .Sh DESCRIPTION The .Nm program prepares a disk for use. The .Ar disk is specified as the device name relative to .Pa /dev . For example .Pa /dev/ad0 would become .Pa ad0 . If no .Fl -config option is given, the disk is partitioned with one slice containing a .Xr disklabel with a single UFS file system occupying the entire disk. If the .Fl -label option is given or a label is specified in the config file, .Xr glabel 8 is used to label the device. .Sh CONFIGURATION FILE When the .Fl config option is given, the disk's configuration is given the values in the .Ar configfile . The file is a .Xr perl 1 fragment defining a hash named .Va %slices . Each element of .Va %slices is a slice number from 1 to 4. For each slice, A .Va size in blocks and .Va type should be defined. The .Va type is the MBR partition type. One slice may have a size of .Ql * which designates that it will consume all space left by the others. For .Fx the type is 165 or .Va $fbsd_type . .Pp A .Va label may also be defined. For UFS partitions, the label will be a UFS label. For other types an .Xr glabel 8 label will be applied. Additionally, an .Va action may be defined to prepare the slice. The .Va action is a command to be executed. Before execution, all instances of .Ql __DEVICE__ in the .Va action are replaced with the path to the slice. If no action is given and the slice is a FreeBSD partition, the slices a-h .Pq excluding c may be defined by .Va type and .Va size variables. The .Va size argument is in blocks and allows on partition to specify a size of .Ql * . The .Va type is the .Ar fstype as used by .Xr disklabel 8 . In addtion to the slices hash, the .Va $label variable may be set to set the drive's label. .Pp The following config file produces the same result as calling .Nm without the .Fl config option: .Bd -literal $slices{1}{type} = $fbsd_type; $slices{1}{size} = '*'; $slices{1}{'a'}{type} = "4.2BSD"; $slices{1}{'a'}{size} = "*"; .Ed .Sh FILES .Pa share/examples/diskprep .Sh SEE ALSO .Xr disklabel 8 , .Xr fdisk 8 , .Xr newfs 8 .Sh AUTHORS The original version of .Nm was written by .An M. Warner Losh Aq imp@FreeBSD.org based on the .Ic prep.fla.sh script by .An Poul-Henning Kamp Aq phk@FreeBSD.org . This version of .Nn was enhanced to support multiple/non-bsdlabel slices and documented in this manual page by .An Brooks Davis Aq brooks@FreeBSD.org for The Aerospace Corporation.