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