NetBSD-5.0.2/share/man/man8/man8.atari/ahdilabel.8

Compare this file to the similar file:
Show the results in this format:

.\"	$NetBSD: ahdilabel.8,v 1.11 2008/04/30 13:10:57 martin Exp $
.\"
.\"
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Julian Coleman and Leo Weppelman.
.\"
.\" 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.
.\"
.\" 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.
.Dd July 29, 2000
.Dt AHDILABEL 8 atari
.Os
.Sh NAME
.Nm ahdilabel
.Nd modify AHDI partitions
.Sh SYNOPSIS
.Nm
.Ar disk
.Sh DESCRIPTION
.Nm
allows you to modify the AHDI partition table on a disk partitioned with
AHDI or an AHDI compatible formatter.  The AHDI partition format is usually
only present on disks shared between
.Nx
and some other OS. The partition identifiers are used by
.Nx
as a guideline to emulate a disklabel on such a disk.
.Pp
.Nm
supports the following options:
.Pp
.Bl -tag -width disk
.It Ar disk
The name of the disk you want to edit.
.Nm
will first try to open a disk of this name.  If this cannot
be opened, it will attempt to open
.Ar r Ns \*[Lt]disk\*[Gt] Ns Ar c .
Finally, if this also cannot be opened, it will attempt to open
.Ar /dev/r Ns \*[Lt]disk\*[Gt] Ns Ar c .
.El
.Pp
.Nm
will display information about the number of sectors, tracks
and sectors on the disk, as well as the current AHDI partition information.
It will then prompt for input.  The input choices are:
.Pp
.Bl -tag -width a-p
.It Ar a-p
Modify a partition.  You will be prompted for a partition id, root, start
and size.
.Nx
recognises the following partition id's:
.Pp
.Bl -tag -width "GEM or BGM" -compact
.It NBD
Partition is reserved for
.Nx .
This can be either a root or an user partition. The first NBD
partition on a disk will be mapped to
.Nx
partition letter
.Em a .
The following NBD partitions will be mapped from letter
.Em d
up.
The filesystem type is ffs by default.
.It SWP
The first SWP partition is mapped to partition
.Em b .
.It GEM or BGM
These partitions are mapped from
.Em d
up. The filesystem type is msdos.
.El
.Pp
The root, start and size parameters can be entered using sector,
cylinder/track/sector or megabyte notations.  Whole numbers of cylinders can
be entered using the shorthand \*[Lt]cylinder\*[Gt]/.  Likewise, whole numbers of tracks
can be entered using the shorthand \*[Lt]cylinder\*[Gt]/\*[Lt]track\*[Gt]/.  Megabytes are entered
using the suffix
.Em M .
.Pp
The following can also be used to enter partition parameters:
.Pp
.Bl -tag -width "-N (start)" -compact
.It \-N (root)
Position the root sector for this partition immediately after partition N.
.It \-N (start)
Make this partition start after partition N (leaving a gap of 1 sector for a
root sector, if necessary).
.It \-N (size)
Make this partition end immediately before partition N.
.It -1 (size)
Make this partition extend to the end of the disk.
.El
.Pp
The sector holding the primary AHDI partition table only has space for four
partitions.  Thus, if a disk has more than four partitions, the extra
partition information is held in auxiliary root sectors.  There is one
auxiliary root for each additional partition (and also for the fourth
partition, if the disk has more than four partitions).
.It Ar r
Recalculate the root sectors.  This will automatically assign auxiliary
root sectors if the disk has more than 4 partitions.  The auxiliary root
sectors will be positioned in a default location preceding the relevant
partition.
.It Ar s
Show the current partition information.
.It Ar u
Toggle the unit display between sector and cylinder/track/sector notation.
.It Ar w
Write the AHDI partition table to the disk.
.It Ar z
Options for zero'ing the boot sector and bad sector lists.  The default is to
preserve them both.
.It Ar q
Quit
.El
.Sh EXAMPLES
.Dl ahdilabel sd0
Edit the AHDI label for disk sd0.
.Sh SEE ALSO
.Xr bootpref 8 ,
.Xr disklabel 8 ,
.Xr installboot 8
.Sh HISTORY
The
.Nm
command first appeared in
.Nx 1.5 .
.Sh BUGS
The changes made to the AHDI partitions will become active on the next
.Em first open
of the disk. You are advised to use
.Nm
only on a disk without any mounted or otherwise active partitions. This
is not enforced by
.Nm .
.Pp
Because of way
.Nx
interprets AHDI partition tables to create the
.Nx
disklabel, the
.Nx
partition ordering may change if partitions labelled NBD are created or
removed.
.Pp
Creating an AHDI partition table on a disk that previously did not have
one will almost certainly overwrite any existing partition information
and/or data on that disk.  This is especially the case if auxiliary root
sectors are needed for the AHDI partition table.
.Pp
As soon as a disk contains at least one NBD partition, you are allowed to
write
.Nx
disklabels and install bootstraps.