xref: /netbsd/usr.sbin/diskpart/diskpart.8 (revision 326b2259)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     from: @(#)diskpart.8	8.1 (Berkeley) 6/6/93
29.\"	$NetBSD: diskpart.8,v 1.8 2003/08/07 11:25:18 agc Exp $
30.\"
31.Dd June 6, 1993
32.Dt DISKPART 8
33.Os
34.Sh NAME
35.Nm diskpart
36.Nd calculate default disk partition sizes
37.Sh SYNOPSIS
38.Nm
39.Op Fl d
40.Op Fl p
41.Op Fl s Ar size
42.Ar disk-type
43.Sh DESCRIPTION
44.Nm
45is used to calculate the disk partition sizes based on the
46default rules used at Berkeley.
47.Pp
48Available options and operands:
49.Bl -tag -width Fl
50.It Fl d
51An entry suitable for inclusion in the disk
52description file
53.Pa /etc/disktab
54is generated; for example,
55.Xr disktab 5 .
56.It Fl p
57Tables suitable for inclusion in a device driver
58are produced.
59.It Fl s Ar size
60The size of the disk may be limited to
61.Ar size
62with the
63.Fl s
64option.
65.El
66.Pp
67On disks that use
68.Xr bad144 8
69type of
70bad-sector forwarding,
71space is normally left in the last partition on the disk
72for a bad sector forwarding table, although this space
73is not reflected in the tables produced.  The space reserved
74is one track for the replicated copies of the table and
75sufficient tracks to hold a pool of 126 sectors to which bad sectors
76are mapped.  For more information, see
77.Xr bad144 8 .
78The
79.Fl s
80option is intended for other controllers which reserve some space at the end
81of the disk for bad-sector replacements or other control areas,
82even if not a multiple of cylinders.
83.Pp
84The disk partition sizes are based on the total amount of
85space on the disk as given in the table below (all values
86are supplied in units of sectors).  The
87.Ql c
88partition
89is, by convention, used to access the entire physical disk.
90The device driver tables include
91the space reserved for the bad sector forwarding table in the
92.Ql c
93partition;
94those used in the disktab and default formats exclude reserved tracks.
95In normal operation, either the
96.Ql g
97partition is used, or the
98.Ql d ,
99.Ql e ,
100and
101.Ql f
102partitions are used.  The
103.Ql g
104and
105.Ql f
106partitions
107are variable-sized, occupying whatever space remains after allocation
108of the fixed sized partitions.
109If the disk is smaller than 20 Megabytes, then
110.Nm
111aborts with the message
112.Dq Li disk too small, calculate by hand .
113.Bl -column Partition 20-60\ MB 61-205\ MB 206-355\ MB 356+\ MB
114Partition	20-60 MB	61-205 MB	206-355 MB	356+ MB
115a	15884	15884	15884	15884
116b	10032	33440	33440	66880
117d	15884	15884	15884	15884
118e	unused	55936	55936	307200
119h	unused	unused	291346	291346
120.El
121.Pp
122If an unknown disk type is specified,
123.Nm
124will prompt for the required disk geometry information.
125.Sh SEE ALSO
126.Xr disktab 5 ,
127.Xr bad144 8
128.Sh HISTORY
129The
130.Nm
131command appeared in
132.Bx 4.2 .
133.Sh BUGS
134Most default partition sizes are based on historical artifacts
135(like the RP06), and may result in unsatisfactory layouts.
136.Pp
137When using the
138.Fl d
139flag, alternative disk names are not included
140in the output.
141