xref: /netbsd/share/man/man8/man8.atari/ahdilabel.8 (revision bf9ec67e)
1.\"	$NetBSD: ahdilabel.8,v 1.8 2002/02/13 08:18:27 ross Exp $
2.\"
3.\"
4.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
5.\" All rights reserved.
6.\"
7.\" This code is derived from software contributed to The NetBSD Foundation
8.\" by Julian Coleman and Leo Weppelman.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\" 3. All advertising materials mentioning features or use of this software
19.\"    must display the following acknowledgement:
20.\"        This product includes software developed by the NetBSD
21.\"        Foundation, Inc. and its contributors.
22.\" 4. Neither the name of The NetBSD Foundation nor the names of its
23.\"    contributors may be used to endorse or promote products derived
24.\"    from this software without specific prior written permission.
25.\"
26.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36.\" POSSIBILITY OF SUCH DAMAGE.
37.Dd July 29, 2000
38.Dt AHDILABEL 8 atari
39.Os
40.Sh NAME
41.Nm ahdilabel
42.Nd modify AHDI partitions
43.Sh SYNOPSIS
44.Nm
45.Ar disk
46.Sh DESCRIPTION
47.Nm
48allows you to modify the AHDI partition table on a disk partitioned with
49AHDI or an AHDI compatible formatter.  The AHDI partition format is usually
50only present on disks shared between
51.Nx
52and some other OS. The partition identifiers are used by
53.Nx
54as a guideline to emulate a disklabel on such a disk.
55.Pp
56.Nm
57supports the following options:
58.Pp
59.Bl -tag -width disk
60.It Ar disk
61The name of the disk you want to edit.
62.Nm
63will first try to open a disk of this name.  If this cannot
64be opened, it will attempt to open
65.Ar r Ns \*[Lt]disk\*[Gt] Ns Ar c .
66Finally, if this also cannot be opened, it will attempt to open
67.Ar /dev/r Ns \*[Lt]disk\*[Gt] Ns Ar c .
68.El
69.Pp
70.Nm
71will display information about the number of sectors, tracks
72and sectors on the disk, as well as the current AHDI partition information.
73It will then prompt for input.  The input choices are:
74.Pp
75.Bl -tag -width a-p
76.It Ar a-p
77Modify a partition.  You will be prompted for a partition id, root, start
78and size.
79.Nx
80recognises the following partition id's:
81.Pp
82.Bl -tag -width "GEM or BGM" -compact
83.It NBD
84Partition is reserved for
85.Nx .
86This can be either a root or an user partition. The first NBD
87partition on a disk will be mapped to
88.Nx partition
89letter
90.Em a .
91The following NBD partitions will be mapped from letter
92.Em d
93up.
94The filesystem type is ffs by default.
95.It SWP
96The first SWP partition is mapped to partition
97.Em b .
98.It GEM or BGM
99These partitions are mapped from
100.Em d
101up. The filesystem type is msdos.
102.El
103.Pp
104The root, start and size parameters can be entered using sector,
105cylinder/track/sector or megabyte notations.  Whole numbers of cylinders can
106be entered using the shorthand \*[Lt]cylinder\*[Gt]/.  Likewise, whole numbers of tracks
107can be entered using the shorthand \*[Lt]cylinder\*[Gt]/\*[Lt]track\*[Gt]/.  Megabytes are entered
108using the suffix
109.Em M .
110.Pp
111The following can also be used to enter partition parameters:
112.Pp
113.Bl -tag -width "-N (start)" -compact
114.It \-N (root)
115Position the root sector for this partition immediately after partition N.
116.It \-N (start)
117Make this partition start after partition N (leaving a gap of 1 sector for a
118root sector, if necessary).
119.It \-N (size)
120Make this partition end immediately before partition N.
121.It -1 (size)
122Make this partition extend to the end of the disk.
123.El
124.Pp
125The sector holding the primary AHDI partition table only has space for four
126partitions.  Thus, if a disk has more than four partitions, the extra
127partition information is held in auxiliary root sectors.  There is one
128auxiliary root for each additional partition (and also for the fourth
129partition, if the disk has more than four partitions).
130.It Ar r
131Recalculate the root sectors.  This will automatically assign auxiliary
132root sectors if the disk has more than 4 partitions.  The auxiliary root
133sectors will be positioned in a default location preceding the relevant
134partition.
135.It Ar s
136Show the current partition information.
137.It Ar u
138Toggle the unit display between sector and cylinder/track/sector notation.
139.It Ar w
140Write the AHDI partition table to the disk.
141.It Ar z
142Options for zero'ing the boot sector and bad sector lists.  The default is to
143preserve them both.
144.It Ar q
145Quit
146.El
147.Sh EXAMPLES
148.Dl ahdilabel sd0
149Edit the AHDI label for disk sd0.
150.Sh SEE ALSO
151.Xr bootpref 8 ,
152.Xr disklabel 8 ,
153.Xr installboot 8
154.Sh HISTORY
155The
156.Nm
157command first appeared in
158.Nx 1.5 .
159.Sh BUGS
160The changes made to the AHDI partitions will become active on the next
161.Em first open
162of the disk. You are advised to use
163.Nm
164only on a disk without any mounted or otherwise active partitions. This
165is not enforced by
166.Nm "" .
167.Pp
168Because of way
169.Nx
170interprets AHDI partition tables to create the
171.Nx
172disklabel, the
173.Nx
174partition ordering may change if partitions labelled NBD are created or
175removed.
176.Pp
177Creating an AHDI partition table on a disk that previously did not have
178one will almost certainly overwrite any existing partition information
179and/or data on that disk.  This is especially the case if auxiliary root
180sectors are needed for the AHDI partition table.
181.Pp
182As soon as a disk contains at least one NBD partition, you are allowed to
183write
184.Nx
185disklabels and install bootstraps.
186