2003-02-25 13:34:36 +03:00
|
|
|
.\" $NetBSD: sunlabel.8,v 1.5 2003/02/25 10:36:19 wiz Exp $
|
2002-01-15 03:57:27 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Thomas Klausner.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2002-12-21 11:11:28 +03:00
|
|
|
.Dd December 21, 2002
|
2002-01-15 03:57:27 +03:00
|
|
|
.Dt SUNLABEL 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm sunlabel
|
|
|
|
.Nd read or modify a SunOS disk label
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2002-01-15 04:58:45 +03:00
|
|
|
.Op Fl mnqs
|
2002-12-21 11:11:28 +03:00
|
|
|
.Ar device
|
2002-01-15 03:57:27 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
reads or modifies a
|
2002-12-21 11:11:28 +03:00
|
|
|
.Tn SunOS
|
|
|
|
disk label on
|
|
|
|
.Ar device ,
|
|
|
|
which is used by the
|
|
|
|
.Tn PROM
|
|
|
|
on
|
|
|
|
.Nx Ns /sparc
|
|
|
|
hardware to find partitions to boot from.
|
2002-01-15 03:57:27 +03:00
|
|
|
.Nm
|
|
|
|
only reads/writes the first 512 bytes of
|
|
|
|
.Ar device .
|
|
|
|
.Pp
|
|
|
|
The supported options are:
|
2002-12-21 11:11:28 +03:00
|
|
|
.Bl -tag -width 4n -offset indent
|
2002-01-15 04:58:45 +03:00
|
|
|
.It Fl m
|
2002-01-15 03:57:27 +03:00
|
|
|
Ignore an incorrect magic number in the disk label.
|
2002-01-15 04:58:45 +03:00
|
|
|
.It Fl n
|
2002-01-15 03:57:27 +03:00
|
|
|
Synthesize a new label rather than reading what is there.
|
|
|
|
.It Fl q
|
|
|
|
Quiet mode - don't print unnecessary babble (currently
|
|
|
|
this suppresses the
|
2002-02-08 04:36:18 +03:00
|
|
|
.Dq sunlabel\*[Gt]
|
2002-01-15 03:57:27 +03:00
|
|
|
prompt).
|
2002-01-15 04:58:45 +03:00
|
|
|
.It Fl s
|
|
|
|
Ignore checksum errors when reading the label.
|
2002-01-15 03:57:27 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Note that
|
2002-01-15 04:58:45 +03:00
|
|
|
.Fl m
|
2002-01-15 03:57:27 +03:00
|
|
|
is dangerous, especially when combined with
|
2002-01-15 04:58:45 +03:00
|
|
|
.Fl s ,
|
2002-01-15 03:57:27 +03:00
|
|
|
since it will then happily believe whatever garbage it may
|
|
|
|
find in the label. When using these flags, all values should be
|
|
|
|
checked carefully, both those printed by
|
|
|
|
.Ic L
|
|
|
|
and the partition table printed by
|
|
|
|
.Ic P .
|
|
|
|
.Pp
|
|
|
|
.Nm
|
|
|
|
prints a prompt
|
2002-02-08 04:36:18 +03:00
|
|
|
.Dq sunlabel\*[Gt]
|
2002-01-15 03:57:27 +03:00
|
|
|
and expects commands.
|
|
|
|
The following commands are understood:
|
2002-12-21 11:11:28 +03:00
|
|
|
.Bl -tag -width 16n -offset indent
|
2002-01-15 03:57:27 +03:00
|
|
|
.It \&?
|
|
|
|
Show a short help message.
|
2002-02-08 04:36:18 +03:00
|
|
|
.It Ic [abcdefghijklmnop] Ar \*[Lt]cylno\*[Gt] Ar \*[Lt]size\*[Gt]
|
2002-01-15 03:57:27 +03:00
|
|
|
Change partition (see below).
|
|
|
|
.It Ic L
|
|
|
|
Print label, except for the partition table.
|
|
|
|
.It Ic P
|
|
|
|
Print the partition table.
|
|
|
|
.It Ic Q
|
|
|
|
Quit program (error if no write since last change).
|
|
|
|
.It Ic Q!
|
|
|
|
Quit program (unconditionally) [EOF also quits].
|
|
|
|
.It Ic S
|
|
|
|
Set label in the kernel (orthogonal to
|
|
|
|
.Ic W ) .
|
2002-02-08 04:36:18 +03:00
|
|
|
.It Ic V Ar \*[Lt]name\*[Gt] Ar \*[Lt]value\*[Gt]
|
2002-01-15 03:57:27 +03:00
|
|
|
Change a non-partition label value.
|
|
|
|
.It Ic W
|
|
|
|
Write (possibly modified) label out.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Ic a
|
|
|
|
through
|
|
|
|
.Ic p
|
|
|
|
commands will accept, for the
|
2002-02-08 04:36:18 +03:00
|
|
|
.Ar \*[Lt]size\*[Gt]
|
2002-01-15 03:57:27 +03:00
|
|
|
parameter, the
|
|
|
|
.Ar nnn/nnn/nnn
|
|
|
|
syntax used by
|
|
|
|
.Tn SunOS 4.x
|
|
|
|
.Ic format .
|
|
|
|
(For those not
|
|
|
|
familiar with this syntax,
|
|
|
|
.Ar a/b/c
|
|
|
|
means
|
|
|
|
.Ar a
|
|
|
|
cylinders +
|
|
|
|
.Ar b
|
|
|
|
tracks +
|
|
|
|
.Ar c
|
|
|
|
sectors. For example, if the disk has 16 tracks of 32 sectors,
|
|
|
|
.Ar 3/4/5
|
|
|
|
means (3*16*32)+(4*32)+5=1669. This calculation always uses the
|
|
|
|
.Ar nsect
|
|
|
|
and
|
|
|
|
.Ar ntrack
|
|
|
|
values as printed by the
|
|
|
|
.Ic L
|
|
|
|
command; in particular, if they are zero (which they will initially be
|
|
|
|
if
|
2002-01-15 04:58:45 +03:00
|
|
|
.Fl n
|
2002-01-15 03:57:27 +03:00
|
|
|
is used), this syntax is not very useful. Some additional strings are
|
|
|
|
accepted. For the
|
2002-02-08 04:36:18 +03:00
|
|
|
.Ar \*[Lt]cylno\*[Gt]
|
2002-01-15 03:57:27 +03:00
|
|
|
parameter,
|
|
|
|
.Dq end-X
|
|
|
|
(where
|
|
|
|
.Ar X
|
|
|
|
is a partition letter) indicates that the partition should start with
|
|
|
|
the first free cylinder after partition
|
|
|
|
.Ar X ;
|
|
|
|
.Dq start-X
|
|
|
|
indicates that the partition should start at the same place as
|
|
|
|
partition
|
|
|
|
.Ar X .
|
|
|
|
For the
|
2002-02-08 04:36:18 +03:00
|
|
|
.Ar \*[Lt]size\*[Gt]
|
2002-01-15 03:57:27 +03:00
|
|
|
parameter,
|
|
|
|
.Dq end-X
|
|
|
|
indicates that the partition should end at the same place as partition
|
|
|
|
.Ar X
|
|
|
|
(even if partition
|
|
|
|
.Ar X
|
|
|
|
ends partway through a cylinder);
|
|
|
|
.Dq start-X
|
|
|
|
indicates that the partition should end with the last cylinder before
|
|
|
|
partition
|
|
|
|
.Ar X ;
|
|
|
|
and
|
|
|
|
.Dq size-X
|
|
|
|
means that the partition's size should exactly match partition
|
|
|
|
.Ar X Ns No 's
|
|
|
|
size.
|
|
|
|
.Pp
|
|
|
|
Note that
|
|
|
|
.Nm
|
|
|
|
supports 16 partitions.
|
|
|
|
.Tn SunOS
|
|
|
|
supports only 8.
|
|
|
|
Labels written by
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm ,
|
2002-01-15 03:57:27 +03:00
|
|
|
when partitions
|
|
|
|
.Ar i
|
|
|
|
through
|
|
|
|
.Ar p
|
|
|
|
are all set
|
|
|
|
.Ar offset=0 size=0 ,
|
|
|
|
are identical to
|
|
|
|
.Tn Sun
|
|
|
|
labels. If any of the
|
|
|
|
.Dq extended
|
|
|
|
partitions are nontrivial, information about them is tucked into some
|
|
|
|
otherwise unused space in the
|
|
|
|
.Tn Sun
|
|
|
|
label format.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Ic V
|
|
|
|
command changes fields printed by the
|
|
|
|
.Ic L
|
|
|
|
command.
|
|
|
|
For example, if the
|
|
|
|
.Ic L
|
|
|
|
command prints
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
ascii: ST15230N cyl 5657 alt 2 hd 19 sec 78
|
|
|
|
rpm: 0 pcyl: 0 apc: 0 obs1: 0
|
|
|
|
obs2: 0 intrlv: 1 ncyl: 5657 acyl: 0
|
|
|
|
nhead: 19 nsect: 78 obs3: 0 obs4: 0
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
then
|
|
|
|
.Ic V Ar ncyl 6204
|
|
|
|
would set the
|
|
|
|
.Ar ncyl
|
|
|
|
value to 6204, or
|
|
|
|
.Ic V
|
|
|
|
.Ar "ascii Seagate ST15230N cyl 5657 hd 19 sec varying"
|
|
|
|
would set the ascii-label string to that string.
|
|
|
|
.Nm
|
|
|
|
performs very few consistency checks on the values you supply, and the
|
|
|
|
ones it does perform never generate errors, only warnings.
|
|
|
|
.Sh AUTHORS
|
|
|
|
.An der Mouse Aq mouse@rodents.montreal.qc.ca
|
|
|
|
.Sh BUGS
|
|
|
|
It may be that the space in the label where the information for the
|
|
|
|
extended partitions is saved is used by
|
|
|
|
.Tn SunOS .
|
|
|
|
.Pp
|
|
|
|
Not very many consistency checks are done on the
|
|
|
|
.Ic V
|
|
|
|
arguments, and those only produce warnings.
|
|
|
|
.Pp
|
|
|
|
.Nx
|
|
|
|
doesn't support 16 partitions in a
|
|
|
|
.Tn Sun
|
|
|
|
disk label yet.
|