xref: /original-bsd/usr.sbin/diskpart/diskpart.8 (revision 93ab02a6)
1.\" Copyright (c) 1983, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)diskpart.8	6.6 (Berkeley) 03/16/91
7.\"
8.Dd
9.Dt DISKPART 8
10.Os BSD 4
11.Sh NAME
12.Nm diskpart
13.Nd calculate default disk partition sizes
14.Sh SYNOPSIS
15.Nm diskpart
16.Op Fl p
17.Op Fl d
18.Op Fl s Ar size
19.Ar disk-type
20.Sh DESCRIPTION
21.Nm Diskpart
22is used to calculate the disk partition sizes based on the
23default rules used at Berkeley.
24.Pp
25Available options and operands:
26.Bl -tag -width Fl
27.It Fl p
28Tables suitable for inclusion in a device driver
29are produced.
30.It Fl d
31An entry suitable for inclusion in the disk
32description file
33.Pa /etc/disktab
34is generated; for example,
35.Xr disktab 5 .
36.It Fl s Ar size
37The size of the disk may be limited to
38.Ar size
39with the
40.Fl s
41option.
42.El
43.Pp
44On disks that use
45.Xr bad144 8
46type of
47bad-sector forwarding,
48space is normally left in the last partition on the disk
49for a bad sector forwarding table, although this space
50is not reflected in the tables produced.  The space reserved
51is one track for the replicated copies of the table and
52sufficient tracks to hold a pool of 126 sectors to which bad sectors
53are mapped.  For more information, see
54.Xr bad144 8 .
55The
56.Fl s
57option is intended for other controllers which reserve some space at the end
58of the disk for bad-sector replacements or other control areas,
59even if not a multiple of cylinders.
60.Pp
61The disk partition sizes are based on the total amount of
62space on the disk as given in the table below (all values
63are supplied in units of sectors).  The
64.Ql c
65partition
66is, by convention, used to access the entire physical disk.
67The device driver tables include
68the space reserved for the bad sector forwarding table in the
69.Ql c
70partition;
71those used in the disktab and default formats exclude reserved tracks.
72In normal operation, either the
73.Ql g
74partition is used, or the
75.Ql d ,
76.Ql e ,
77and
78.Ql f
79partitions are used.  The
80.Ql g
81and
82.Ql f
83partitions
84are variable-sized, occupying whatever space remains after allocation
85of the fixed sized partitions.
86If the disk is smaller than 20 Megabytes, then
87.Nm diskpart
88aborts with the message
89.Dq Li disk too small, calculate by hand .
90.Bl -column Partition 20-60\ MB 61-205\ MB 206-355\ MB 356+\ MB
91Partition	20-60 MB	61-205 MB	206-355 MB	356+ MB
92a	15884	15884	15884	15884
93b	10032	33440	33440	66880
94d	15884	15884	15884	15884
95e	unused	55936	55936	307200
96h	unused	unused	291346	291346
97.El
98.Pp
99If an unknown disk type is specified,
100.Nm diskpart
101will prompt for the required disk geometry information.
102.Sh SEE ALSO
103.Xr disktab 5 ,
104.Xr bad144 8
105.Sh BUGS
106Most default partition sizes are based on historical artifacts
107(like the RP06), and may result in unsatisfactory layouts.
108.Pp
109When using the
110.Fl d
111flag, alternate disk names are not included
112in the output.
113.Sh HISTORY
114The
115.Nm
116command appeared in
117.Bx 4.2 .
118