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