1 .\" $NetBSD: ahdilabel.8,v 1.10 2003/06/26 11:57:49 wiz Exp $
4 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
7 .\" This code is derived from software contributed to The NetBSD Foundation
8 .\" by Julian Coleman and Leo Weppelman.
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
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.
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.
35 .Nd modify AHDI partitions
41 allows you to modify the AHDI partition table on a disk partitioned with
42 AHDI or an AHDI compatible formatter. The AHDI partition format is usually
43 only present on disks shared between
45 and some other OS. The partition identifiers are used by
47 as a guideline to emulate a disklabel on such a disk.
50 supports the following options:
54 The name of the disk you want to edit.
56 will first try to open a disk of this name. If this cannot
57 be opened, it will attempt to open
58 .Ar r Ns \*[Lt]disk\*[Gt] Ns Ar c .
59 Finally, if this also cannot be opened, it will attempt to open
60 .Ar /dev/r Ns \*[Lt]disk\*[Gt] Ns Ar c .
64 will display information about the number of sectors, tracks
65 and sectors on the disk, as well as the current AHDI partition information.
66 It will then prompt for input. The input choices are:
70 Modify a partition. You will be prompted for a partition id, root, start
73 recognises the following partition id's:
75 .Bl -tag -width "GEM or BGM" -compact
77 Partition is reserved for
79 This can be either a root or an user partition. The first NBD
80 partition on a disk will be mapped to
84 The following NBD partitions will be mapped from letter
87 The filesystem type is ffs by default.
89 The first SWP partition is mapped to partition
92 These partitions are mapped from
94 up. The filesystem type is msdos.
97 The root, start and size parameters can be entered using sector,
98 cylinder/track/sector or megabyte notations. Whole numbers of cylinders can
99 be entered using the shorthand \*[Lt]cylinder\*[Gt]/. Likewise, whole numbers of tracks
100 can be entered using the shorthand \*[Lt]cylinder\*[Gt]/\*[Lt]track\*[Gt]/. Megabytes are entered
104 The following can also be used to enter partition parameters:
106 .Bl -tag -width "-N (start)" -compact
108 Position the root sector for this partition immediately after partition N.
110 Make this partition start after partition N (leaving a gap of 1 sector for a
111 root sector, if necessary).
113 Make this partition end immediately before partition N.
115 Make this partition extend to the end of the disk.
118 The sector holding the primary AHDI partition table only has space for four
119 partitions. Thus, if a disk has more than four partitions, the extra
120 partition information is held in auxiliary root sectors. There is one
121 auxiliary root for each additional partition (and also for the fourth
122 partition, if the disk has more than four partitions).
124 Recalculate the root sectors. This will automatically assign auxiliary
125 root sectors if the disk has more than 4 partitions. The auxiliary root
126 sectors will be positioned in a default location preceding the relevant
129 Show the current partition information.
131 Toggle the unit display between sector and cylinder/track/sector notation.
133 Write the AHDI partition table to the disk.
135 Options for zero'ing the boot sector and bad sector lists. The default is to
142 Edit the AHDI label for disk sd0.
150 command first appeared in
153 The changes made to the AHDI partitions will become active on the next
155 of the disk. You are advised to use
157 only on a disk without any mounted or otherwise active partitions. This
163 interprets AHDI partition tables to create the
167 partition ordering may change if partitions labelled NBD are created or
170 Creating an AHDI partition table on a disk that previously did not have
171 one will almost certainly overwrite any existing partition information
172 and/or data on that disk. This is especially the case if auxiliary root
173 sectors are needed for the AHDI partition table.
175 As soon as a disk contains at least one NBD partition, you are allowed to
178 disklabels and install bootstraps.