1.\" $NetBSD: ahdilabel.8,v 1.6 2001/09/10 23:32:30 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.\" 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 38.Dd July 29, 2000 39.Dt AHDILABEL 8 atari 40.Os 41.Sh NAME 42.Nm ahdilabel 43.Nd modify AHDI partitions 44.Sh SYNOPSIS 45.Nm 46.Ar disk 47.Sh DESCRIPTION 48.Nm 49allows you to modify the AHDI partition table on a disk partitioned with 50AHDI or an AHDI compatible formatter. The AHDI partition format is usually 51only present on disks shared between 52.Nx 53and some other OS. The partition identifiers are used by 54.Nx 55as a guideline to emulate a disklabel on such a disk. 56.Pp 57.Nm 58supports the following options: 59.Pp 60.Bl -tag -width disk 61.It Ar disk 62The name of the disk you want to edit. 63.Nm 64will first try to open a disk of this name. If this cannot 65be opened, it will attempt to open 66.Ar r Ns <disk> Ns Ar c . 67Finally, if this also cannot be opened, it will attempt to open 68.Ar /dev/r Ns <disk> Ns Ar c . 69.El 70.Pp 71.Nm 72will display information about the number of sectors, tracks 73and sectors on the disk, as well as the current AHDI partition information. 74It will then prompt for input. The input choices are: 75.Pp 76.Bl -tag -width a-p 77.It Ar a-p 78Modify a partition. You will be prompted for a partition id, root, start 79and size. 80.Nx 81recognises the following partition id's: 82.Pp 83.Bl -tag -width "GEM or BGM" -compact 84.It NBD 85Partition is reserved for 86.Nx . 87This can be either a root or an user partition. The first NBD 88partition on a disk will be mapped to 89.Nx partition 90letter 91.Em a . 92The following NBD partitions will be mapped from letter 93.Em d 94up. 95The filesystem type is ffs by default. 96.It SWP 97The first SWP partition is mapped to partition 98.Em b . 99.It GEM or BGM 100These partitions are mapped from 101.Em d 102up. The filesystem type is msdos. 103.El 104.Pp 105The root, start and size parameters can be entered using sector, 106cylinder/track/sector or megabyte notations. Whole numbers of cylinders can 107be entered using the shorthand <cylinder>/. Likewise, whole numbers of tracks 108can be entered using the shorthand <cylinder>/<track>/. Megabytes are entered 109using the suffix 110.Em M . 111.Pp 112The following can also be used to enter partition parameters: 113.Pp 114.Bl -tag -width "-N (start)" -compact 115.It \-N (root) 116Position the root sector for this partition immediately after partition N. 117.It \-N (start) 118Make this partition start after partition N (leaving a gap of 1 sector for a 119root sector, if necessary). 120.It \-N (size) 121Make this partition end immediately before partition N. 122.It -1 (size) 123Make this partition extend to the end of the disk. 124.El 125.Pp 126The sector holding the primary AHDI partition table only has space for four 127partitions. Thus, if a disk has more than four partitions, the extra 128partition information is held in auxiliary root sectors. There is one 129auxiliary root for each additional partition (and also for the fourth 130partition, if the disk has more than four partitions). 131.It Ar r 132Recalculate the root sectors. This will automatically assign auxiliary 133root sectors if the disk has more than 4 partitions. The auxiliary root 134sectors will be positioned in a default location preceding the relevant 135partition. 136.It Ar s 137Show the current partition information. 138.It Ar u 139Toggle the unit display between sector and cylinder/track/sector notation. 140.It Ar w 141Write the AHDI partition table to the disk. 142.It Ar z 143Options for zero'ing the boot sector and bad sector lists. The default is to 144preserve them both. 145.It Ar q 146Quit 147.El 148.Sh EXAMPLES 149.Dl ahdilabel sd0 150Edit the AHDI label for disk sd0. 151.Sh BUGS 152The changes made to the AHDI partitions will become active on the next 153.Em first open 154of the disk. You are advised to use 155.Nm 156only on a disk without any mounted or otherwise active partitions. This 157is not enforced by 158.Nm "" . 159.Pp 160Because of way 161.Nx 162interprets AHDI partition tables to create the 163.Nx 164disklabel, the 165.Nx 166partition ordering may change if partitions labelled NBD are created or 167removed. 168.Pp 169Creating an AHDI partition table on a disk that previously did not have 170one will almost certainly overwrite any existing partition information 171and/or data on that disk. This is especially the case if auxiliary root 172sectors are needed for the AHDI partition table. 173.Pp 174As soon as a disk contains at least one NBD partition, you are allowed to 175write 176.Nx 177disklabels and install bootstraps. 178.Sh SEE ALSO 179.Xr bootpref 8 , 180.Xr disklabel 8 , 181.Xr installboot 8 182.Sh HISTORY 183The 184.Nm 185command first appeared in 186.Nx 1.5 . 187