'\" te .\" Copyright 1989 AT&T Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH fmthard 1M "25 Sep 2008" "SunOS 5.11" "System Administration Commands" .SH NAME fmthard \- populate label on hard disks .SH SYNOPSIS .SS "SPARC" .LP .nf \fBfmthard\fR \fB-d\fR \fIdata\fR | \fB-n\fR \fIvolume_name\fR | \fB-s\fR \fIdatafile\fR [\fB-i\fR] /dev/rdsk/c? [t?] d?s2 .fi .SS "x86" .LP .nf \fBfmthard\fR \fB-d\fR \fIdata\fR | \fB-n\fR \fIvolume_name\fR | \fB-s\fR \fIdatafile\fR [\fB-i\fR] /dev/rdsk/c? [t?] d?s2 .fi .SH DESCRIPTION .sp .LP The \fBfmthard\fR command updates the \fBVTOC\fR (Volume Table of Contents) on hard disks and, on x86 systems, adds boot information to the Solaris \fBfdisk\fR partition. One or more of the options \fB-s\fR \fIdatafile\fR, \fB-d\fR \fIdata\fR, or \fB-n\fR \fIvolume_name\fR must be used to request modifications to the disk label. To print disk label contents, see \fBprtvtoc\fR(1M). The \fB/dev/rdsk/c\fR\fI?\fR[\fBt\fR\fI?\fR]\fBd\fR\fI?\fR\fBs2\fR file must be the character special file of the device where the new label is to be installed. On x86 systems, \fBfdisk\fR(1M) must be run on the drive before \fBfmthard\fR. .sp .LP If you are using an x86 system, note that the term ``partition'' in this page refers to \fIslices\fR within the x86 \fBfdisk\fR partition on x86 machines. Do not confuse the partitions created by \fBfmthard\fR with the partitions created by \fBfdisk\fR. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-d\fR \fIdata\fR\fR .ad .sp .6 .RS 4n The \fIdata\fR 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 \fIpart:tag:flag:start:size\fR where \fIpart\fR is the partition number, \fItag\fR is the \fBID\fR TAG of the partition, \fIflag\fR is the set of permission flags, \fIstart\fR is the starting sector number of the partition, and \fIsize\fR is the number of sectors in the partition. See the description of the \fIdatafile\fR below for more information on these fields. .RE .sp .ne 2 .mk .na \fB\fB-i\fR\fR .ad .sp .6 .RS 4n This option allows the command to create the desired \fBVTOC\fR table, but prints the information to standard output instead of modifying the \fBVTOC\fR on the disk. .RE .sp .ne 2 .mk .na \fB\fB-n\fR \fIvolume_name\fR\fR .ad .sp .6 .RS 4n This option is used to give the disk a \fIvolume_name\fR up to 8 characters long. .RE .sp .ne 2 .mk .na \fB\fB-s\fR \fIdatafile\fR\fR .ad .sp .6 .RS 4n This option is used to populate the \fBVTOC\fR according to a \fIdatafile\fR created by the user. If the \fIdatafile\fR is \fB\(mi\fR (a hyphen), \fBfmthard\fR reads from standard input. The \fIdatafile\fR format is described below. This option causes all of the disk partition timestamp fields to be set to zero. .sp Every \fBVTOC\fR generated by \fBfmthard\fR will also have partition 2, by convention, that corresponds to the whole disk. If the input in \fIdatafile\fR does not specify an entry for partition 2, a default partition 2 entry will be created automatically in \fBVTOC\fR with the tag \fBV_BACKUP\fR and size equal to the full size of the disk. .sp The \fIdatafile\fR contains one specification line for each partition, starting with partition 0. Each line is delimited by a new-line character (\fB\en\fR). 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: .sp \fIpartition tag flag starting_sector size_in_sectors\fR .sp where the entries have the following values: .sp .ne 2 .mk .na \fB\fIpartition\fR\fR .ad .sp .6 .RS 4n The partition number. Currently, for Solaris SPARC, a disk can have up to 8 partitions, \fB0\fR\(mi\fB7\fR. Even though the \fIpartition\fR field has 4 bits, only 3 bits are currently used. For x86, all 4 bits are used to allow slices \fB0\fR\(mi\fB15\fR. Each Solaris \fBfdisk\fR partition can have up to 16 slices. .RE .sp .ne 2 .mk .na \fB\fItag\fR\fR .ad .sp .6 .RS 4n The partition tag: a decimal number. The following are reserved codes: \fB0\fR (\fBV_UNASSIGNED\fR), \fB1\fR (\fBV_BOOT\fR), \fB2\fR (\fBV_ROOT\fR), \fB3\fR (\fBV_SWAP\fR), \fB4\fR (\fBV_USR\fR), \fB5\fR (\fBV_BACKUP\fR), \fB6\fR (\fBV_STAND\fR), \fB7\fR (\fBV_VAR\fR), and \fB8\fR (\fBV_HOME\fR). .RE .sp .ne 2 .mk .na \fB\fIflag\fR\fR .ad .sp .6 .RS 4n The flag allows a partition to be flagged as unmountable or read only, the masks being: \fBV_UNMNT 0x01\fR, and \fBV_RONLY 0x10\fR. For mountable partitions use \fB0x00\fR. .RE .sp .ne 2 .mk .na \fB\fIstarting_sector\fR\fR .ad .sp .6 .RS 4n The sector number (decimal) on which the partition starts. .RE .sp .ne 2 .mk .na \fB\fIsize_in_sectors\fR\fR .ad .sp .6 .RS 4n The number (decimal) of sectors occupied by the partition. .RE You can save the output of a \fBprtvtoc\fR command to a file, edit the file, and use it as the \fIdatafile\fR argument to the \fB-s\fR option. .RE .SH SEE ALSO .sp .LP \fBuname\fR(1), \fBformat\fR(1M), \fBprtvtoc\fR(1M), \fBattributes\fR(5) .SS "x86 Only" .sp .LP \fBfdisk\fR(1M), \fBinstallgrub\fR(1M) .SH NOTES .sp .LP Special care should be exercised when overwriting an existing \fBVTOC\fR, as incorrect entries could result in current data being inaccessible. As a precaution, save the old \fBVTOC\fR. .sp .LP For disks under two terabytes, \fBfmthard\fR cannot write a \fBVTOC\fR on an unlabeled disk. Use \fBformat\fR(1M) for this purpose.