2 .\" Copyright 1989 AT&T Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH FMTHARD 1M "Sep 25, 2008"
8 fmthard \- populate label on hard disks
13 \fBfmthard\fR \fB-d\fR \fIdata\fR | \fB-n\fR \fIvolume_name\fR | \fB-s\fR \fIdatafile\fR [\fB-i\fR] /dev/rdsk/c?
20 \fBfmthard\fR \fB-d\fR \fIdata\fR | \fB-n\fR \fIvolume_name\fR | \fB-s\fR \fIdatafile\fR [\fB-i\fR] /dev/rdsk/c?
27 The \fBfmthard\fR command updates the \fBVTOC\fR (Volume Table of Contents) on
28 hard disks and, on x86 systems, adds boot information to the Solaris
29 \fBfdisk\fR partition. One or more of the options \fB-s\fR \fIdatafile\fR,
30 \fB-d\fR \fIdata\fR, or \fB-n\fR \fIvolume_name\fR must be used to request
31 modifications to the disk label. To print disk label contents, see
32 \fBprtvtoc\fR(1M). The
33 \fB/dev/rdsk/c\fR\fI?\fR[\fBt\fR\fI?\fR]\fBd\fR\fI?\fR\fBs2\fR file must be the
34 character special file of the device where the new label is to be installed. On
35 x86 systems, \fBfdisk\fR(1M) must be run on the drive before \fBfmthard\fR.
38 If you are using an x86 system, note that the term ``partition'' in this page
39 refers to \fIslices\fR within the x86 \fBfdisk\fR partition on x86 machines. Do
40 not confuse the partitions created by \fBfmthard\fR with the partitions created
45 The following options are supported:
49 \fB\fB-d\fR \fIdata\fR\fR
53 The \fIdata\fR argument of this option is a string representing the information
54 for a particular partition in the current VTOC. The string must be of the
55 format \fIpart:tag:flag:start:size\fR where \fIpart\fR is the partition number,
56 \fItag\fR is the \fBID\fR TAG of the partition, \fIflag\fR is the set of
57 permission flags, \fIstart\fR is the starting sector number of the partition,
58 and \fIsize\fR is the number of sectors in the partition. See the description
59 of the \fIdatafile\fR below for more information on these fields.
69 This option allows the command to create the desired \fBVTOC\fR table, but
70 prints the information to standard output instead of modifying the \fBVTOC\fR
77 \fB\fB-n\fR \fIvolume_name\fR\fR
81 This option is used to give the disk a \fIvolume_name\fR up to 8 characters
88 \fB\fB-s\fR \fIdatafile\fR\fR
92 This option is used to populate the \fBVTOC\fR according to a \fIdatafile\fR
93 created by the user. If the \fIdatafile\fR is \fB\(mi\fR (a hyphen),
94 \fBfmthard\fR reads from standard input. The \fIdatafile\fR format is described
95 below. This option causes all of the disk partition timestamp fields to be set
98 Every \fBVTOC\fR generated by \fBfmthard\fR will also have partition 2, by
99 convention, that corresponds to the whole disk. If the input in \fIdatafile\fR
100 does not specify an entry for partition 2, a default partition 2 entry will be
101 created automatically in \fBVTOC\fR with the tag \fBV_BACKUP\fR and size equal
102 to the full size of the disk.
104 The \fIdatafile\fR contains one specification line for each partition, starting
105 with partition 0. Each line is delimited by a new-line character (\fB\en\fR).
106 If the first character of a line is an asterisk (*), the line is treated as a
107 comment. Each line is composed of entries that are position-dependent,
108 separated by white space and having the following format:
110 \fIpartition tag flag starting_sector size_in_sectors\fR
112 where the entries have the following values:
116 \fB\fIpartition\fR\fR
120 The partition number. Currently, for Solaris SPARC, a disk can have up to 8
121 partitions, \fB0\fR\(mi\fB7\fR. Even though the \fIpartition\fR field has 4
122 bits, only 3 bits are currently used. For x86, all 4 bits are used to allow
123 slices \fB0\fR\(mi\fB15\fR. Each Solaris \fBfdisk\fR partition can have up to
134 The partition tag: a decimal number. The following are reserved codes: \fB0\fR
135 (\fBV_UNASSIGNED\fR), \fB1\fR (\fBV_BOOT\fR), \fB2\fR (\fBV_ROOT\fR), \fB3\fR
136 (\fBV_SWAP\fR), \fB4\fR (\fBV_USR\fR), \fB5\fR (\fBV_BACKUP\fR), \fB6\fR
137 (\fBV_STAND\fR), \fB7\fR (\fBV_VAR\fR), and \fB8\fR (\fBV_HOME\fR).
147 The flag allows a partition to be flagged as unmountable or read only, the
148 masks being: \fBV_UNMNT 0x01\fR, and \fBV_RONLY 0x10\fR. For mountable
149 partitions use \fB0x00\fR.
155 \fB\fIstarting_sector\fR\fR
159 The sector number (decimal) on which the partition starts.
165 \fB\fIsize_in_sectors\fR\fR
169 The number (decimal) of sectors occupied by the partition.
172 You can save the output of a \fBprtvtoc\fR command to a file, edit the file,
173 and use it as the \fIdatafile\fR argument to the \fB-s\fR option.
179 \fBuname\fR(1), \fBformat\fR(1M), \fBprtvtoc\fR(1M), \fBattributes\fR(5)
183 \fBfdisk\fR(1M), \fBinstallgrub\fR(1M)
187 Special care should be exercised when overwriting an existing \fBVTOC\fR, as
188 incorrect entries could result in current data being inaccessible. As a
189 precaution, save the old \fBVTOC\fR.
192 For disks under two terabytes, \fBfmthard\fR cannot write a \fBVTOC\fR on an
193 unlabeled disk. Use \fBformat\fR(1M) for this purpose.