1 .\" $NetBSD: sunlabel.8,v 1.5 2003/02/25 10:36:19 wiz Exp $
3 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Thomas Klausner.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd read or modify a SunOS disk label
50 hardware to find partitions to boot from.
52 only reads/writes the first 512 bytes of
55 The supported options are:
56 .Bl -tag -width 4n -offset indent
58 Ignore an incorrect magic number in the disk label.
60 Synthesize a new label rather than reading what is there.
62 Quiet mode - don't print unnecessary babble (currently
67 Ignore checksum errors when reading the label.
72 is dangerous, especially when combined with
74 since it will then happily believe whatever garbage it may
75 find in the label. When using these flags, all values should be
76 checked carefully, both those printed by
78 and the partition table printed by
85 The following commands are understood:
86 .Bl -tag -width 16n -offset indent
88 Show a short help message.
89 .It Ic [abcdefghijklmnop] Ar \*[Lt]cylno\*[Gt] Ar \*[Lt]size\*[Gt]
90 Change partition (see below).
92 Print label, except for the partition table.
94 Print the partition table.
96 Quit program (error if no write since last change).
98 Quit program (unconditionally) [EOF also quits].
100 Set label in the kernel (orthogonal to
102 .It Ic V Ar \*[Lt]name\*[Gt] Ar \*[Lt]value\*[Gt]
103 Change a non-partition label value.
105 Write (possibly modified) label out.
112 commands will accept, for the
120 familiar with this syntax,
128 sectors. For example, if the disk has 16 tracks of 32 sectors,
130 means (3*16*32)+(4*32)+5=1669. This calculation always uses the
134 values as printed by the
136 command; in particular, if they are zero (which they will initially be
139 is used), this syntax is not very useful. Some additional strings are
141 .Ar \*[Lt]cylno\*[Gt]
146 is a partition letter) indicates that the partition should start with
147 the first free cylinder after partition
150 indicates that the partition should start at the same place as
157 indicates that the partition should end at the same place as partition
161 ends partway through a cylinder);
163 indicates that the partition should end with the last cylinder before
168 means that the partition's size should exactly match partition
174 supports 16 partitions.
184 .Ar offset=0 size=0 ,
187 labels. If any of the
189 partitions are nontrivial, information about them is tucked into some
190 otherwise unused space in the
196 command changes fields printed by the
202 .Bd -literal -offset indent
203 ascii: ST15230N cyl 5657 alt 2 hd 19 sec 78
204 rpm: 0 pcyl: 0 apc: 0 obs1: 0
205 obs2: 0 intrlv: 1 ncyl: 5657 acyl: 0
206 nhead: 19 nsect: 78 obs3: 0 obs4: 0
215 .Ar "ascii Seagate ST15230N cyl 5657 hd 19 sec varying"
216 would set the ascii-label string to that string.
218 performs very few consistency checks on the values you supply, and the
219 ones it does perform never generate errors, only warnings.
221 .An der Mouse Aq mouse@rodents.montreal.qc.ca
223 It may be that the space in the label where the information for the
224 extended partitions is saved is used by
227 Not very many consistency checks are done on the
229 arguments, and those only produce warnings.
232 doesn't support 16 partitions in a