16c94744372d49ba7be9a559a3724c61bd1fd716
[dragonfly.git] / usr.sbin / diskpart / diskpart.8
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. 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  8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD: src/usr.sbin/diskpart/diskpart.8,v 1.5.2.3 2001/08/16 15:55:54 ru Exp $
34 .\" $DragonFly: src/usr.sbin/diskpart/Attic/diskpart.8,v 1.2 2003/06/17 04:29:53 dillon Exp $
35 .\"
36 .Dd June 6, 1993
37 .Dt DISKPART 8
38 .Os
39 .Sh NAME
40 .Nm diskpart
41 .Nd calculate default disk partition sizes
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl p
45 .Op Fl d
46 .Op Fl s Ar size
47 .Ar disk-type
48 .Sh DESCRIPTION
49 .Nm Diskpart
50 is used to calculate the disk partition sizes based on the
51 default rules used at Berkeley.
52 .Pp
53 Available options and operands:
54 .Bl -tag -width Fl
55 .It Fl p
56 Tables suitable for inclusion in a device driver
57 are produced.
58 .It Fl d
59 An entry suitable for inclusion in the disk
60 description file
61 .Pa /etc/disktab
62 is generated; for example,
63 .Xr disktab 5 .
64 .It Fl s Ar size
65 The size of the disk may be limited to
66 .Ar size
67 with the
68 .Fl s
69 option.
70 .El
71 .Pp
72 On disks that use bad-sector forwarding,
73 space is normally left in the last partition on the disk
74 for a bad sector forwarding table, although this space
75 is not reflected in the tables produced.  The space reserved
76 is one track for the replicated copies of the table and
77 sufficient tracks to hold a pool of 126 sectors to which bad sectors
78 are mapped.
79 The
80 .Fl s
81 option is intended for other controllers which reserve some space at the end
82 of the disk for bad-sector replacements or other control areas,
83 even if not a multiple of cylinders.
84 .Pp
85 The disk partition sizes are based on the total amount of
86 space on the disk as given in the table below (all values
87 are supplied in units of sectors).  The
88 .Ql c
89 partition
90 is, by convention, used to access the entire physical disk.
91 The device driver tables include
92 the space reserved for the bad sector forwarding table in the
93 .Ql c
94 partition;
95 those used in the disktab and default formats exclude reserved tracks.
96 In normal operation, either the
97 .Ql g
98 partition is used, or the
99 .Ql d ,
100 .Ql e ,
101 and
102 .Ql f
103 partitions are used.  The
104 .Ql g
105 and
106 .Ql f
107 partitions
108 are variable-sized, occupying whatever space remains after allocation
109 of the fixed sized partitions.
110 If the disk is smaller than 20 Megabytes, then
111 .Nm
112 aborts with the message
113 .Dq Li disk too small, calculate by hand .
114 .Bl -column Partition 20-60\ MB 61-205\ MB 206-355\ MB 356+\ MB
115 Partition       20-60 MB        61-205 MB       206-355 MB      356+ MB
116 a       15884   15884   15884   15884
117 b       10032   33440   33440   66880
118 d       15884   15884   15884   15884
119 e       unused  55936   55936   307200
120 h       unused  unused  291346  291346
121 .El
122 .Pp
123 If an unknown disk type is specified,
124 .Nm
125 will prompt for the required disk geometry information.
126 .Sh SEE ALSO
127 .Xr disktab 5
128 .Sh BUGS
129 Most default partition sizes are based on historical artifacts
130 (like the RP06), and may result in unsatisfactory layouts.
131 .Pp
132 When using the
133 .Fl d
134 flag, alternate disk names are not included
135 in the output.
136 .Sh HISTORY
137 The
138 .Nm
139 command appeared in
140 .Bx 4.2 .