Reamove grub support.
[unleashed.git] / usr / src / man / man1m / fmthard.1m
blob4e60b8b5ae3fc503c6f1ad9828ec3af11b6e6914
1 '\" te
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 "Nov 23, 2016"
7 .SH NAME
8 fmthard \- populate label on hard disks
9 .SH SYNOPSIS
10 .SS "SPARC"
11 .LP
12 .nf
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?
14      [t?] d?s2
15 .fi
17 .SS "x86"
18 .LP
19 .nf
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?
21      [t?] d?s2
22 .fi
24 .SH DESCRIPTION
25 .sp
26 .LP
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.
36 .sp
37 .LP
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
41 by \fBfdisk\fR.
42 .SH OPTIONS
43 .sp
44 .LP
45 The following options are supported:
46 .sp
47 .ne 2
48 .na
49 \fB\fB-d\fR \fIdata\fR\fR
50 .ad
51 .sp .6
52 .RS 4n
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.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fB\fB-i\fR\fR
66 .ad
67 .sp .6
68 .RS 4n
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
71 on the disk.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fB-n\fR \fIvolume_name\fR\fR
78 .ad
79 .sp .6
80 .RS 4n
81 This option is used to give the disk a \fIvolume_name\fR up to 8 characters
82 long.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fB-s\fR \fIdatafile\fR\fR
89 .ad
90 .sp .6
91 .RS 4n
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
96 to zero.
97 .sp
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:
114 .ne 2
116 \fB\fIpartition\fR\fR
118 .sp .6
119 .RS 4n
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
124 16 slices.
128 .ne 2
130 \fB\fItag\fR\fR
132 .sp .6
133 .RS 4n
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).
141 .ne 2
143 \fB\fIflag\fR\fR
145 .sp .6
146 .RS 4n
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.
153 .ne 2
155 \fB\fIstarting_sector\fR\fR
157 .sp .6
158 .RS 4n
159 The sector number (decimal) on which the partition starts.
163 .ne 2
165 \fB\fIsize_in_sectors\fR\fR
167 .sp .6
168 .RS 4n
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.
176 .SH SEE ALSO
179 \fBuname\fR(1), \fBformat\fR(1M), \fBprtvtoc\fR(1M), \fBattributes\fR(5)
180 .SS "x86 Only"
183 \fBfdisk\fR(1M), \fBinstallboot\fR(1M)
184 .SH NOTES
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.