'\"macro stdmacro
.if n .pH g1a.fmthard @(#)fmthard	40.11 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} fmthard 1M "Essential Utilities" "\&"
.if \nX=1 .ds x} fmthard 1M "Essential Utilities"
.if \nX=2 .ds x} fmthard 1M "" "\&"
.if \nX=3 .ds x} fmthard "" "" "\&"
.TH \*(x}
.SH NAME
\f4fmthard\f1 \- populate VTOC on hard disks
.SH SYNOPSIS
\f4/usr/sbin/fmthard\f1 [\f4\-c \f2core_disk_type\f1] [\f4\-d \f2data\f1]
[\f4\-i\f1] [\f4\-s \f2datafile\f1]
.br
[\f4\-n \f2volume_name\f1] \f4/dev/rdsk/\f1[\f4ct\f1]\f2?\f4d\f2?\f4s\f2?\f1
.SH DESCRIPTION
The
\f4fmthard\fP
command
creates (or updates) the VTOC (Volume Table of Contents) on
hard disks.
The \f4/dev/rdsk/\f1[\f4ct\f1]\f2?\f4d\f2?\f4s\f2?\f1
file must be the character special
file of the device where the new VTOC is to be installed.
.SH OPTIONS
.PP
The following options apply to \f4fmthard\fP:
.TP
\f4\-d \f2data\f1
The \f2data\f1 argument of this option is a string representing
the information for a particular partition in the current VTOC.
The string must be of the format \f2part:tag:flag:start:size\f1
where \f2part\f1 is the partition number, \f2tag\f1 is the ID
tag of the partition, \f2flag\f1 is the set of permission flags,
\f2start\f1 is the starting sector number of the partition, and
\f2size\f1 is the number of sectors in the partition.
See the description of the \f2datafile\f1 below for more information
on these fields.
.TP
\f4\-i\f1
Lets the command create the desired VTOC table, but prints the
information to standard output instead of modifying the VTOC
on the disk.
.TP
\f4\-n \f2volume_name\f1
Allows the disk to be given a \f2volume_name\f1 up to 8 characters long.
.TP
\f4\-c\f1 \f2core_disk_type\f1
The three core disk configurations are: "0" (single disk configuration),
"1" (first disk of a dual disk configuration), and
"2" (second disk of a dual disk configuration).
Core disk configuration requires disk size to be at least 32MB.
.sp .5
.ta .5i 1.5i 2.5i 3i
Disk Configuration	Partition	Used For
.sp .5
0		0	\f4root\f1
		1	\f4swap\f1
		2	\f4usr\f1
		8	\f4var\f1
		9	\f4home\f1 (remaining space)
.sp .5
1		0	\f4root\f1
		1	\f4swap\f1
		8	\f4home\f1 (remaining space)
.sp .5
2		2	\f4usr\f1
		8	\f4var\f1
		a	\f4home2\f1 (remaining space)
.TP
\f4\-s \f2datafile\f1
The VTOC is populated according to a
.I datafile\^
created by the user.
The
.I datafile\^
format is described below.
This option causes all of the disk partition timestamp fields to be
set to zero.
.PP
If no options are given, a default VTOC is created with partition
\f4a\f1 (see the description of the \f4\-c\fP option, above)
as the only mountable partition.
Every VTOC generated by \f4fmthard\fP will also have
partition 6 (the whole disk) and partition 7 (the boot partition).
Partition 6 is the only partition that can overlap others.
.PP
The
.I datafile\^
contains one specification line for each partition, starting with partition 0.
Each line is delimited by a new-line character (\f4\en\f1).
If the first character of a line is an asterisk (*), the line is
treated as a comment.
Each line is composed of entries that are position-dependent,
separated by "white space" and having the following format:
.PP
.RS
\f2partition  tag  flag  starting_sector  size_in_sectors\f1
.RE
.PP
where the entries have the following values.
.PP
.TP 17
.I partition
The partition number: 0-15 decimal or 0x0-0xf hexadecimal.
.TP
.I tag
The partition tag:
a two-digit hex number.
The following are reserved codes:  0x01 (V_BOOT),
0x02 (V_ROOT), 0x03 (V_SWAP), 0x04 (V_USR), 0x05 (V_BACKUP), 0x06
(V_STAND), 0x07 (V_VAR) and 0x08(V_HOME).
.TP
.I flag
The flag allows a partition to be flagged as unmountable or read
only, the masks being:
V_UNMNT 0x01, and V_RONLY 0x10.
For mountable partitions use 0x00.
.TP
.I starting sector
The sector number (decimal) on which the partition starts.
.TP
.I size in sectors
The number (decimal) of sectors occupied by the partition.
.P
Note that you can save the output of a \f4prtvtoc\f1 command to a
file, edit the file, and use it as the \f2datafile\f1 argument to the
\f4\-s\f1 option.
.SH SEE ALSO
\f4prtvtoc\fP(1M),
\f4newboot\f1(1M).
.SH NOTES
Special care should be exercised when overwriting an existing
VTOC, as incorrect entries could result in current data being
inaccessible.
As a precaution, save the old VTOC.
.PP
'\"MR is88-09232 (IW)
After using \f4fmthard\fP on a bootable drive, you must execute
\f4newboot\fP on that drive.
\f4newboot\fP should also be executed
after mirroring any partition on a bootable disk
(executing either \f4sysadm rootsetup\fP or \f4sysadm mirror\fP).
.P
If \f4newboot\fP is not executed after \f4fmthard\fP,
then the drive will become unbootable and may require a partial restore.
Do not do a partial restore while \f4root\fP and \f4/usr\fP are mirrored.
.\"	@(#)fmthard.1	1.1 of 2/20/84
.P
When using the \f4\-s\f1 option, the user must allocate
at least two sectors, beginning with sector 0, for the VTOC.
This is normally designated as partition 7.
Failure to allocate
space for the VTOC may result in overwriting the VTOC, thereby
destroying the disk partitioning information.
.Ee
