fmthard(1M)
NAME
fmthard − populate VTOC on hard disks
SYNOPSIS
/usr/sbin/fmthard [ −d data ] [ −i ] [ −b bootblk ] [ −p pboot ]
−s datafile | −n volume_name /dev/rdsk/c? [ t? ] d?s?
AVAILABILITY
SUNWcsr
DESCRIPTION
The fmthard command updates the VTOC (Volume Table of Contents) on hard disks and adds boot information to the Solaris fdisk partition. Either the −s datafile option or the −n volume_name option must be used. The /dev/rdsk/c?[t?]d?s? file must be the character special file of the device where the new VTOC is to be installed. fdisk(1M) must be run on the drive before fmthard.
OPTIONS
The following options apply to fmthard:
−d data The data argument of this option is a string representing the information for a particular slice in the current VTOC. The string must be of the format part:tag:flag:start:size where part is the slice number, tag is the ID tag of the slice, flag is the set of permission flags, start is the starting sector number of the slice, and size is the number of sectors in the slice. See the description of the datafile below for more information on these fields.
−i This option allows the command to create the desired VTOC table, but prints the information to standard output instead of modifying the VTOC on the disk.
−p pboot This option allows the user to override the default partition boot file, which is /usr/lib/fs/ufs/pboot.
−b bootblk This option allows the user to override the default bootblk file, which is /usr/lib/fs/ufs/bootblk.
−n volume_name This option allows the disk to be given a volume_name of up to 8 characters.
−s datafile The VTOC is populated according to a datafile created by the user. If the datafile is "−", fmthard reads from standard input. The datafile format is described below. This option causes all of the disk slice timestamp fields to be set to zero.
Every VTOC generated by fmthard will also have slice 2 (the whole Solaris partition). Slice 2 is the only slice that can overlap other slices.
The datafile contains one specification line for each slice, starting with slice 0. Each line is delimited by a new-line character (\n). 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, are separated by "white space," and have the following format:
partition tag flag first_sector size_in_sectors last_sector
where the entries have the following values:
partition The slice number: 0-15 decimal or 0x0-0xf hexadecimal.
tag The slice 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).
flag The flag allows a slice to be flagged as unmountable or read only, the masks being: V_UNMNT 0x01, and V_RONLY 0x10. For mountable slices use 0x00.
first sector The sector number (decimal) on which the slice starts.
size in sectors The number (decimal) of sectors occupied by the slice.
last sector The sector number (decimal) on which the slice ends.
Note that you can save the output of a prtvtoc command to a file, edit the file, and use it as the datafile argument to the −s option.
SEE ALSO
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.
SunOS 5.1 — Last change: 31 May 1993