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