FMTHARD(8) Maintenance Commands and Procedures FMTHARD(8)

fmthardpopulate label on hard disks

fmthard -d data | -n volume_name | -s datafile [-i] /dev/rdsk/c?[t?]d?s2

The fmthard command updates the VTOC (Volume Table of Contents) on hard disks. One or more of the options -s datafile, -d data, or -n volume_name must be used to request modifications to the disk label. To print disk label contents, see prtvtoc(8). The /dev/rdsk/c?[t?]d?s2 file must be the character special file of the device where the new label is to be installed. On x86 systems, fdisk(8) must be run on the drive before fmthard.

If you are using an x86 system, note that the term ‘partition’ in this page refers to within the x86 fdisk partition on x86 machines. Do not confuse the partitions created by fmthard with the partitions created by fdisk(8).

The following options are supported:

The data 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 where is the partition number, tag is the TAG of the partition, flag is the set of permission flags, is the starting sector number of the partition, and is the number of sectors in the partition. See the description of the datafile below for more information on these fields.
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.
This option is used to give the disk a volume_name up to 8 characters long.
This option is used to populate the VTOC according to a datafile created by the user. If the datafile is (a hyphen), fmthard reads from standard input. The datafile format is described below. This option causes all of the disk partition timestamp fields to be set to zero.

Every VTOC generated by fmthard will also have partition 2, by convention, that corresponds to the whole disk. If the input in datafile does not specify an entry for partition 2, a default partition 2 entry will be created automatically in VTOC with the tag V_BACKUP and size equal to the full size of the disk.

The datafile contains one specification line for each partition, starting with partition 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, separated by white space and having the following format:

partition tag flag starting_sector size_in_sectors

where the entries have the following values:

The partition number. Currently, for Solaris SPARC, a disk can have up to 8 partitions, 0−7. Even though the partition field has 4 bits, only 3 bits are currently used. For x86, all 4 bits are used to allow slices 0−15. Each Solaris fdisk partition can have up to 16 slices.
The partition tag: a decimal number. The following are reserved codes: 0 (), (), (), (), (), (V_BACKUP), (), (), and ().
The flag allows a partition to be flagged as unmountable or read only, the masks being: , and . For mountable partitions use .
The sector number (decimal) on which the partition starts.
The number (decimal) of sectors occupied by the partition.

You can save the output of a prtvtoc(8) command to a file, edit the file, and use it as the datafile argument to the -s option.

uname(1), attributes(7), format(8), installboot(8), prtvtoc(8)


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.

For disks under two terabytes, fmthard cannot write a VTOC on an unlabeled disk. Use format(8) for this purpose.

March 30, 2022 OmniOS