xref: /freebsd/sbin/fdisk/fdisk.8 (revision 255d2d9bbc3756c940462c61d3cd6fb7753aab2c)
126721a89SRobert Nordier.\"
2e67d220bSSevan Janiyan.Dd October 5, 2016
35b81b6b3SRodney W. Grimes.Dt FDISK 8
49fe48c6eSRuslan Ermilov.Os
55b81b6b3SRodney W. Grimes.Sh NAME
65b81b6b3SRodney W. Grimes.Nm fdisk
792dcf6faSRuslan Ermilov.Nd PC slice table maintenance utility
85b81b6b3SRodney W. Grimes.Sh SYNOPSIS
97c7fb079SRuslan Ermilov.Nm
10a61d9186SDavid E. O'Brien.Op Fl BIaipqstu
1126721a89SRobert Nordier.Op Fl b Ar bootcode
124ddd60b9SBrian Somers.Op Fl 1234
13f46af505SJordan K. Hubbard.Op Ar disk
147c7fb079SRuslan Ermilov.Nm
1526721a89SRobert Nordier.Fl f Ar configfile
1626721a89SRobert Nordier.Op Fl itv
17f46af505SJordan K. Hubbard.Op Ar disk
18*255d2d9bSEd Maste.Sh DEPRECATION NOTICE
19*255d2d9bSEd Maste.Nm
20*255d2d9bSEd Masteis deprecated and is not available in
21*255d2d9bSEd Maste.Fx 15.0
22*255d2d9bSEd Masteor later.
23*255d2d9bSEd MasteUse
24*255d2d9bSEd Maste.Xr gpart 8
25*255d2d9bSEd Masteinstead
26*255d2d9bSEd Maste.Po
27*255d2d9bSEd Mastewith the
28*255d2d9bSEd Maste.Cm MBR
29*255d2d9bSEd Mastepartitioning scheme
30*255d2d9bSEd Maste.Pc ,
31*255d2d9bSEd Masteor install the
32*255d2d9bSEd Maste.Pa freebsd-fdisk
33*255d2d9bSEd Masteport or package.
345b81b6b3SRodney W. Grimes.Sh PROLOGUE
355b81b6b3SRodney W. GrimesIn order for the BIOS to boot the kernel,
365b81b6b3SRodney W. Grimescertain conventions must be adhered to.
375b81b6b3SRodney W. GrimesSector 0 of the disk must contain boot code,
3805a213f1STom Rhodesa slice table,
395b81b6b3SRodney W. Grimesand a magic number.
4005a213f1STom RhodesBIOS slices can be used to break the disk up into several pieces.
4192dcf6faSRuslan ErmilovThe BIOS brings in sector 0 and verifies the magic number.
4292dcf6faSRuslan ErmilovThe sector
4305a213f1STom Rhodes0 boot code then searches the slice table to determine which
4405a213f1STom Rhodesslice is marked
4592dcf6faSRuslan Ermilov.Dq active .
4626721a89SRobert NordierThis boot code then brings in the bootstrap from the
4792dcf6faSRuslan Ermilovactive slice and, if marked bootable, runs it.
4892dcf6faSRuslan ErmilovUnder
4992dcf6faSRuslan Ermilov.Tn DOS ,
5092dcf6faSRuslan Ermilovyou can have one or more slices with one active.
5192dcf6faSRuslan ErmilovThe
5292dcf6faSRuslan Ermilov.Tn DOS
535b81b6b3SRodney W. Grimes.Nm
5492dcf6faSRuslan Ermilovutility can be used to divide space on the disk into slices and set one
5592dcf6faSRuslan Ermilovactive.
565b81b6b3SRodney W. Grimes.Sh DESCRIPTION
57b8c19fd7SEdward Tomasz Napierala.Bf -symbolic
58b8c19fd7SEdward Tomasz NapieralaThis command is obsolete.
59b8c19fd7SEdward Tomasz NapieralaUsers are advised to use
60b8c19fd7SEdward Tomasz Napierala.Xr gpart 8
61b8c19fd7SEdward Tomasz Napieralainstead.
62b8c19fd7SEdward Tomasz Napierala.Ef
63b8c19fd7SEdward Tomasz Napierala.Pp
64d98b1668SPhilippe CharnierThe
65b5c508fbSRuslan Ermilov.Fx
6692dcf6faSRuslan Ermilovutility,
6705a213f1STom Rhodes.Nm ,
6892dcf6faSRuslan Ermilovserves a similar purpose to the
6992dcf6faSRuslan Ermilov.Tn DOS
7092dcf6faSRuslan Ermilovutility.
7192dcf6faSRuslan ErmilovThe first form is used to
7205a213f1STom Rhodesdisplay slice information or to interactively edit the slice
7392dcf6faSRuslan Ermilovtable.
7492dcf6faSRuslan ErmilovThe second is used to write a slice table using a
7592dcf6faSRuslan Ermilov.Ar configfile ,
76f46af505SJordan K. Hubbardand is designed to be used by other scripts/programs.
77f46af505SJordan K. Hubbard.Pp
78f46af505SJordan K. HubbardOptions are:
7992dcf6faSRuslan Ermilov.Bl -tag -width indent
80f46af505SJordan K. Hubbard.It Fl a
8192dcf6faSRuslan ErmilovChange the active slice only.
8292dcf6faSRuslan ErmilovIgnored if
83f46af505SJordan K. Hubbard.Fl f
84f46af505SJordan K. Hubbardis given.
8526721a89SRobert Nordier.It Fl b Ar bootcode
8626721a89SRobert NordierGet the boot code from the file
8726721a89SRobert Nordier.Ar bootcode .
88504dd5eaSRuslan ErmilovDefault is
89504dd5eaSRuslan Ermilov.Pa /boot/mbr .
90e6fb3ddeSPoul-Henning Kamp.It Fl B
9192dcf6faSRuslan ErmilovReinitialize the boot code contained in sector 0 of the disk.
9292dcf6faSRuslan ErmilovIgnored if
93e6fb3ddeSPoul-Henning Kamp.Fl f
94e6fb3ddeSPoul-Henning Kampis given.
95f46af505SJordan K. Hubbard.It Fl f Ar configfile
9605a213f1STom RhodesSet slice values using the file
97f46af505SJordan K. Hubbard.Ar configfile .
98f46af505SJordan K. HubbardThe
99f46af505SJordan K. Hubbard.Ar configfile
10075cb6f3dSRuslan Ermilovonly modifies explicitly specified slices, unless
101f46af505SJordan K. Hubbard.Fl i
10205a213f1STom Rhodesis also given, in which case all existing slices are deleted (marked
10392dcf6faSRuslan Ermilovas
10492dcf6faSRuslan Ermilov.Dq unused )
10592dcf6faSRuslan Ermilovbefore the
106f46af505SJordan K. Hubbard.Ar configfile
10792dcf6faSRuslan Ermilovis read.
10892dcf6faSRuslan ErmilovThe
109f46af505SJordan K. Hubbard.Ar configfile
11092dcf6faSRuslan Ermilovcan be
11192dcf6faSRuslan Ermilov.Sq Fl ,
11292dcf6faSRuslan Ermilovin which case standard input is read.
11392dcf6faSRuslan ErmilovSee
114d98b1668SPhilippe Charnier.Sx CONFIGURATION FILE ,
115f46af505SJordan K. Hubbardbelow, for file syntax.
116f46af505SJordan K. Hubbard.Pp
117d0353b83SRuslan Ermilov.Em WARNING :
118f46af505SJordan K. Hubbardwhen
119f46af505SJordan K. Hubbard.Fl f
12005a213f1STom Rhodesis used, you are not asked if you really want to write the slices
12192dcf6faSRuslan Ermilovtable (as you are in the interactive mode).
12292dcf6faSRuslan ErmilovUse with caution!
12326721a89SRobert Nordier.It Fl i
12492dcf6faSRuslan ErmilovInitialize sector 0 of the disk.
12575cb6f3dSRuslan ErmilovExisting slice entries will be cleared
12675cb6f3dSRuslan Ermilov(marked as unused) before editing.
12775cb6f3dSRuslan Ermilov(Compare with
12875cb6f3dSRuslan Ermilov.Fl u . )
1297b0070fcSSheldon Hearn.It Fl I
13075cb6f3dSRuslan ErmilovInitialize sector 0 slice table
13105a213f1STom Rhodesfor one
1327b0070fcSSheldon Hearn.Fx
1337b0070fcSSheldon Hearnslice covering the entire disk.
1347914c60fSMaxim Konovalov.It Fl p
1357914c60fSMaxim KonovalovPrint a slice table in
1367914c60fSMaxim Konovalov.Nm
1377914c60fSMaxim Konovalovconfiguration file format and exit; see
1387914c60fSMaxim Konovalov.Sx CONFIGURATION FILE ,
1397914c60fSMaxim Konovalovbelow.
140a61d9186SDavid E. O'Brien.It Fl q
141a61d9186SDavid E. O'BrienBe quiet.
142a61d9186SDavid E. O'BrienBenign warnings (such as "GEOM not found") are suppressed.
14310b0ee93SWarner Losh.It Fl s
14410b0ee93SWarner LoshPrint summary information and exit.
145f46af505SJordan K. Hubbard.It Fl t
14692dcf6faSRuslan ErmilovTest mode; do not write slice values.
14792dcf6faSRuslan ErmilovGenerally used with the
148f46af505SJordan K. Hubbard.Fl f
14992dcf6faSRuslan Ermilovoption to see what would be written to the slice table.
15092dcf6faSRuslan ErmilovImplies
151f46af505SJordan K. Hubbard.Fl v .
15226721a89SRobert Nordier.It Fl u
15375cb6f3dSRuslan ErmilovUpdate (edit) the disk's sector 0 slice table.
15492dcf6faSRuslan ErmilovIgnored if
15526721a89SRobert Nordier.Fl f
15626721a89SRobert Nordieris given.
157f46af505SJordan K. Hubbard.It Fl v
15892dcf6faSRuslan ErmilovBe verbose.
15992dcf6faSRuslan ErmilovWhen
160f46af505SJordan K. Hubbard.Fl f
161f46af505SJordan K. Hubbardis used,
162f46af505SJordan K. Hubbard.Nm
16305a213f1STom Rhodesprints out the slice table that is written to the disk.
16426721a89SRobert Nordier.It Fl 1234
16592dcf6faSRuslan ErmilovOperate on a single slice table entry only.
16692dcf6faSRuslan ErmilovIgnored if
16726721a89SRobert Nordier.Fl f
16826721a89SRobert Nordieris given.
169f46af505SJordan K. Hubbard.El
170f46af505SJordan K. Hubbard.Pp
171f46af505SJordan K. HubbardThe final disk name can be provided as a
17292dcf6faSRuslan Ermilov.Dq bare
17357e4378bSRuslan Ermilovdisk name only, e.g.\&
17492dcf6faSRuslan Ermilov.Pa da0 ,
175df77f711SJoerg Wunschor as a full pathname.
176df77f711SJoerg WunschIf omitted,
177df77f711SJoerg Wunsch.Nm
178df77f711SJoerg Wunschtries to figure out the default disk device name from the
179df77f711SJoerg Wunschmounted root device.
180f46af505SJordan K. Hubbard.Pp
18192dcf6faSRuslan ErmilovWhen called with no arguments, it prints the sector 0 slice table.
1825b81b6b3SRodney W. GrimesAn example follows:
1835b81b6b3SRodney W. Grimes.Bd -literal
18405d98029SSergey Kandaurov	******* Working on device /dev/ada0 *******
1855b81b6b3SRodney W. Grimes	parameters extracted from in-core disklabel are:
1865b81b6b3SRodney W. Grimes	cylinders=769 heads=15 sectors/track=33 (495 blks/cyl)
1875b81b6b3SRodney W. Grimes
1885b81b6b3SRodney W. Grimes	parameters to be used for BIOS calculations are:
1895b81b6b3SRodney W. Grimes	cylinders=769 heads=15 sectors/track=33 (495 blks/cyl)
1905b81b6b3SRodney W. Grimes
1915b81b6b3SRodney W. Grimes	Warning: BIOS sector numbering starts with sector 1
1925b81b6b3SRodney W. Grimes	Information from DOS bootblock is:
1934ddd60b9SBrian Somers	The data for partition 1 is:
194e3038c6eSJoerg Wunsch	sysid 165,(FreeBSD/NetBSD/386BSD)
1955b81b6b3SRodney W. Grimes           start 495, size 380160 (185 Meg), flag 0
1965b81b6b3SRodney W. Grimes		beg: cyl 1/ sector 1/ head 0;
1975b81b6b3SRodney W. Grimes		end: cyl 768/ sector 33/ head 14
1984ddd60b9SBrian Somers	The data for partition 2 is:
1995b81b6b3SRodney W. Grimes	sysid 164,(unknown)
2005b81b6b3SRodney W. Grimes           start 378180, size 2475 (1 Meg), flag 0
2015b81b6b3SRodney W. Grimes		beg: cyl 764/ sector 1/ head 0;
2025b81b6b3SRodney W. Grimes		end: cyl 768/ sector 33/ head 14
2035b81b6b3SRodney W. Grimes	The data for partition 3 is:
2044ddd60b9SBrian Somers	<UNUSED>
2054ddd60b9SBrian Somers	The data for partition 4 is:
2065b81b6b3SRodney W. Grimes	sysid 99,(ISC UNIX, other System V/386, GNU HURD or Mach)
2075b81b6b3SRodney W. Grimes           start 380656, size 224234 (109 Meg), flag 80
2085b81b6b3SRodney W. Grimes		beg: cyl 769/ sector 2/ head 0;
2095b81b6b3SRodney W. Grimes		end: cyl 197/ sector 33/ head 14
2105b81b6b3SRodney W. Grimes.Ed
2115b81b6b3SRodney W. Grimes.Pp
21205a213f1STom RhodesThe disk is divided into three slices that happen to fill the disk.
21305a213f1STom RhodesThe second slice overlaps the end of the first.
21405a213f1STom Rhodes(Used for debugging purposes.)
21592dcf6faSRuslan Ermilov.Bl -tag -width ".Em cyl , sector No and Em head"
21692dcf6faSRuslan Ermilov.It Em sysid
21705a213f1STom Rhodesis used to label the slice.
218b5c508fbSRuslan Ermilov.Fx
219d98b1668SPhilippe Charnierreserves the
2205b81b6b3SRodney W. Grimesmagic number 165 decimal (A5 in hex).
22192dcf6faSRuslan Ermilov.It Xo
22292dcf6faSRuslan Ermilov.Em start
22392dcf6faSRuslan Ermilovand
22492dcf6faSRuslan Ermilov.Em size
22592dcf6faSRuslan Ermilov.Xc
2265b81b6b3SRodney W. Grimesfields provide the start address
22705a213f1STom Rhodesand size of a slice in sectors.
2285b81b6b3SRodney W. Grimes.It Em "flag 80"
22905a213f1STom Rhodesspecifies that this is the active slice.
23092dcf6faSRuslan Ermilov.It Xo
23192dcf6faSRuslan Ermilov.Em cyl , sector
23292dcf6faSRuslan Ermilovand
23392dcf6faSRuslan Ermilov.Em head
23492dcf6faSRuslan Ermilov.Xc
23505a213f1STom Rhodesfields are used to specify the beginning and end addresses of the slice.
23692dcf6faSRuslan Ermilov.El
23792dcf6faSRuslan Ermilov.Pp
23892dcf6faSRuslan Ermilov.Em Note :
2395b81b6b3SRodney W. Grimesthese numbers are calculated using BIOS's understanding of the disk geometry
2405b81b6b3SRodney W. Grimesand saved in the bootblock.
2415b81b6b3SRodney W. Grimes.Pp
24205a213f1STom RhodesThe
2435b81b6b3SRodney W. Grimes.Fl i
24405a213f1STom Rhodesand
2455b81b6b3SRodney W. Grimes.Fl u
24605a213f1STom Rhodesflags are used to indicate that the slice data is to be updated.
24705a213f1STom RhodesUnless the
248f46af505SJordan K. Hubbard.Fl f
24905a213f1STom Rhodesoption is also given,
2505b81b6b3SRodney W. Grimes.Nm
25105a213f1STom Rhodeswill enter a conversational mode.
25205a213f1STom RhodesIn this mode, no changes will be written to disk unless you explicitly tell
25305a213f1STom Rhodes.Nm
25405a213f1STom Rhodesto.
2555b81b6b3SRodney W. Grimes.Pp
25692dcf6faSRuslan ErmilovThe
25792dcf6faSRuslan Ermilov.Nm
25892dcf6faSRuslan Ermilovutility will display each slice and ask whether you want to edit it.
2595b81b6b3SRodney W. GrimesIf you say yes,
2605b81b6b3SRodney W. Grimes.Nm
26105a213f1STom Rhodeswill step through each field, show you the old value,
26205a213f1STom Rhodesand ask you for a new one.
26305a213f1STom RhodesWhen you are done with the slice,
26405a213f1STom Rhodes.Nm
26505a213f1STom Rhodeswill display it and ask you whether it is correct.
26692dcf6faSRuslan ErmilovIt will then proceed to the next entry.
2675b81b6b3SRodney W. Grimes.Pp
2685b81b6b3SRodney W. GrimesGetting the
2695b81b6b3SRodney W. Grimes.Em cyl , sector ,
2705b81b6b3SRodney W. Grimesand
2715b81b6b3SRodney W. Grimes.Em head
27205a213f1STom Rhodesfields correct is tricky, so by default,
2735b81b6b3SRodney W. Grimesthey will be calculated for you;
27405a213f1STom Rhodesyou can specify them if you choose to though.
2755b81b6b3SRodney W. Grimes.Pp
27605a213f1STom RhodesAfter all the slices are processed,
2775b81b6b3SRodney W. Grimesyou are given the option to change the
27892dcf6faSRuslan Ermilov.Dq active
27905a213f1STom Rhodesslice.
28005a213f1STom RhodesFinally, when all the new data for sector 0 has been accumulated,
28105a213f1STom Rhodesyou are asked to confirm whether you really want to rewrite it.
2825b81b6b3SRodney W. Grimes.Pp
2835b81b6b3SRodney W. GrimesThe difference between the
2845b81b6b3SRodney W. Grimes.Fl u
28505a213f1STom Rhodesand
2865b81b6b3SRodney W. Grimes.Fl i
28705a213f1STom Rhodesflags is that
2885b81b6b3SRodney W. Grimesthe
2895b81b6b3SRodney W. Grimes.Fl u
29075cb6f3dSRuslan Ermilovflag edits (updates) the existing slice parameters
29105a213f1STom Rhodeswhile the
2925b81b6b3SRodney W. Grimes.Fl i
29392dcf6faSRuslan Ermilovflag is used to
29492dcf6faSRuslan Ermilov.Dq initialize
29575cb6f3dSRuslan Ermilovthem (old values will be ignored);
29675cb6f3dSRuslan Ermilovif you edit the first slice,
29775cb6f3dSRuslan Ermilov.Fl i
29875cb6f3dSRuslan Ermilovwill also set it up to use the whole disk for
29905a213f1STom Rhodes.Fx
3005b81b6b3SRodney W. Grimesand make it active.
3015b81b6b3SRodney W. Grimes.Sh NOTES
3029806e231SRuslan ErmilovThe automatic calculation of starting cylinder etc.\& uses
30305a213f1STom Rhodesa set of figures that represent what the BIOS thinks the
30405a213f1STom Rhodesgeometry of the drive is.
30505a213f1STom RhodesThese figures are taken from the in-core disklabel by default,
30605a213f1STom Rhodesbut
30705a213f1STom Rhodes.Nm
30805a213f1STom Rhodesinitially gives you an opportunity to change them.
30905a213f1STom RhodesThis allows you to create a bootblock that can work with drives
3105b81b6b3SRodney W. Grimesthat use geometry translation under the BIOS.
3115b81b6b3SRodney W. Grimes.Pp
3125b81b6b3SRodney W. GrimesIf you hand craft your disk layout,
313d98b1668SPhilippe Charnierplease make sure that the
314b5c508fbSRuslan Ermilov.Fx
31505a213f1STom Rhodesslice starts on a cylinder boundary.
3165b81b6b3SRodney W. Grimes.Pp
31705a213f1STom RhodesEditing an existing slice will most likely result in the loss of
31805a213f1STom Rhodesall data in that slice.
3195b81b6b3SRodney W. Grimes.Pp
32005a213f1STom RhodesYou should run
32105a213f1STom Rhodes.Nm
32205a213f1STom Rhodesinteractively once or twice to see how it works.
32305a213f1STom RhodesThis is completely safe as long as you answer the last question
32492dcf6faSRuslan Ermilovin the negative.
32592dcf6faSRuslan ErmilovThere are subtleties that
32605a213f1STom Rhodes.Nm
32705a213f1STom Rhodesdetects that are not fully explained in this manual page.
328f46af505SJordan K. Hubbard.Sh CONFIGURATION FILE
329f46af505SJordan K. HubbardWhen the
330f46af505SJordan K. Hubbard.Fl f
33105a213f1STom Rhodesoption is given, a disk's slice table can be written using values
332f46af505SJordan K. Hubbardfrom a
333f46af505SJordan K. Hubbard.Ar configfile .
33405a213f1STom RhodesThe syntax of this file is very simple;
33505a213f1STom Rhodeseach line is either a comment or a specification, as follows:
33692dcf6faSRuslan Ermilov.Bl -tag -width indent
33792dcf6faSRuslan Ermilov.It Ic # Ar comment ...
33892dcf6faSRuslan ErmilovLines beginning with a
339f46af505SJordan K. Hubbard.Ic #
34092dcf6faSRuslan Ermilovare comments and are ignored.
34192dcf6faSRuslan Ermilov.It Ic g Ar spec1 spec2 spec3
34292dcf6faSRuslan ErmilovSet the BIOS geometry used in slice calculations.
34392dcf6faSRuslan ErmilovThere must be
34485886416SSteve Pricethree values specified, with a letter preceding each number:
34592dcf6faSRuslan Ermilov.Bl -tag -width indent
34692dcf6faSRuslan Ermilov.It Cm c Ns Ar num
347f46af505SJordan K. HubbardSet the number of cylinders to
348f46af505SJordan K. Hubbard.Ar num .
34992dcf6faSRuslan Ermilov.It Cm h Ns Ar num
350f46af505SJordan K. HubbardSet the number of heads to
351f46af505SJordan K. Hubbard.Ar num .
35292dcf6faSRuslan Ermilov.It Cm s Ns Ar num
353f46af505SJordan K. HubbardSet the number of sectors/track to
354f46af505SJordan K. Hubbard.Ar num .
355f46af505SJordan K. Hubbard.El
356f46af505SJordan K. Hubbard.Pp
357f46af505SJordan K. HubbardThese specs can occur in any order, as the leading letter determines
358f46af505SJordan K. Hubbardwhich value is which; however, all three must be specified.
359f46af505SJordan K. Hubbard.Pp
36005a213f1STom RhodesThis line must occur before any lines that specify slice
361f46af505SJordan K. Hubbardinformation.
362f46af505SJordan K. Hubbard.Pp
363f46af505SJordan K. HubbardIt is an error if the following is not true:
364726b61abSRuslan Ermilov.Bd -literal -offset indent
365f46af505SJordan K. Hubbard1 <= number of cylinders
366f46af505SJordan K. Hubbard1 <= number of heads <= 256
367f46af505SJordan K. Hubbard1 <= number of sectors/track < 64
368726b61abSRuslan Ermilov.Ed
369f46af505SJordan K. Hubbard.Pp
370f46af505SJordan K. HubbardThe number of cylinders should be less than or equal to 1024, but this
37192dcf6faSRuslan Ermilovis not enforced, although a warning will be printed.
37292dcf6faSRuslan ErmilovNote that bootable
373b5c508fbSRuslan Ermilov.Fx
37492dcf6faSRuslan Ermilovslices (the
37592dcf6faSRuslan Ermilov.Dq Pa /
37692dcf6faSRuslan Ermilovfile system) must lie completely within the
377f46af505SJordan K. Hubbardfirst 1024 cylinders; if this is not true, booting may fail.
37805a213f1STom RhodesNon-bootable slices do not have this restriction.
379f46af505SJordan K. Hubbard.Pp
380f46af505SJordan K. HubbardExample (all of these are equivalent), for a disk with 1019 cylinders,
381f46af505SJordan K. Hubbard39 heads, and 63 sectors:
382726b61abSRuslan Ermilov.Bd -literal -offset indent
383f46af505SJordan K. Hubbardg       c1019   h39     s63
384f46af505SJordan K. Hubbardg       h39     c1019   s63
385f46af505SJordan K. Hubbardg       s63     h39     c1019
386726b61abSRuslan Ermilov.Ed
38792dcf6faSRuslan Ermilov.It Ic p Ar slice type start length
38805a213f1STom RhodesSet the slice given by
38905a213f1STom Rhodes.Ar slice
3904ddd60b9SBrian Somers(1-4) to type
391f46af505SJordan K. Hubbard.Ar type ,
392f46af505SJordan K. Hubbardstarting at sector
393f46af505SJordan K. Hubbard.Ar start
394f46af505SJordan K. Hubbardfor
395f46af505SJordan K. Hubbard.Ar length
396f46af505SJordan K. Hubbardsectors.
397d1c77156SBrian SomersIf the
398d1c77156SBrian Somers.Ar start
399d1c77156SBrian Somersor
400d1c77156SBrian Somers.Ar length
401d1c77156SBrian Somersis suffixed with a
402d1c77156SBrian Somers.Em K ,
403d1c77156SBrian Somers.Em M
404d1c77156SBrian Somersor
405d1c77156SBrian Somers.Em G ,
406d1c77156SBrian Somersit is taken as a
407d1c77156SBrian Somers.Em Kilobyte ,
408d1c77156SBrian Somers.Em Megabyte
409d1c77156SBrian Somersor
410d1c77156SBrian Somers.Em Gigabyte
411d1c77156SBrian Somersmeasurement respectively.
412d1c77156SBrian SomersIf the
413d1c77156SBrian Somers.Ar start
414d1c77156SBrian Somersis given as
415d1c77156SBrian Somers.Qq *
416d1c77156SBrian Somersit is set to the value of the previous partition end.
417d1c77156SBrian SomersIf the
418d1c77156SBrian Somers.Ar length
419d1c77156SBrian Somersis given as
420d1c77156SBrian Somers.Qq *
421d1c77156SBrian Somersthe partition end is set to the end of the disk.
422f46af505SJordan K. Hubbard.Pp
42305a213f1STom RhodesOnly those slices explicitly mentioned by these lines are modified;
42492dcf6faSRuslan Ermilovany slice not referenced by a
42592dcf6faSRuslan Ermilov.Ic p
42692dcf6faSRuslan Ermilovline will not be modified.
42705a213f1STom RhodesHowever, if an invalid slice table is present, or the
428f46af505SJordan K. Hubbard.Fl i
42905a213f1STom Rhodesoption is specified, all existing slice entries will be cleared
43092dcf6faSRuslan Ermilov(marked as unused), and these
43192dcf6faSRuslan Ermilov.Ic p
43292dcf6faSRuslan Ermilovlines will have to be used to
43392dcf6faSRuslan Ermilovexplicitly set slice information.
43492dcf6faSRuslan ErmilovIf multiple slices need to be
43592dcf6faSRuslan Ermilovset, multiple
43692dcf6faSRuslan Ermilov.Ic p
43792dcf6faSRuslan Ermilovlines must be specified; one for each slice.
438f46af505SJordan K. Hubbard.Pp
43905a213f1STom RhodesThese slice lines must occur after any geometry specification lines,
440f46af505SJordan K. Hubbardif one is present.
441f46af505SJordan K. Hubbard.Pp
442f46af505SJordan K. HubbardThe
443f46af505SJordan K. Hubbard.Ar type
444d98b1668SPhilippe Charnieris 165 for
445b5c508fbSRuslan Ermilov.Fx
44692dcf6faSRuslan Ermilovslices.
44792dcf6faSRuslan ErmilovSpecifying a slice type of zero is
44805a213f1STom Rhodesthe same as clearing the slice and marking it as unused; however,
44992dcf6faSRuslan Ermilovdummy values (such as
45092dcf6faSRuslan Ermilov.Dq 0 )
45192dcf6faSRuslan Ermilovmust still be specified for
452f46af505SJordan K. Hubbard.Ar start
453f46af505SJordan K. Hubbardand
454f46af505SJordan K. Hubbard.Ar length .
455f46af505SJordan K. Hubbard.Pp
456f46af505SJordan K. HubbardNote: the start offset will be rounded upwards to a head boundary if
457f46af505SJordan K. Hubbardnecessary, and the end offset will be rounded downwards to a cylinder
458f46af505SJordan K. Hubbardboundary if necessary.
459f46af505SJordan K. Hubbard.Pp
46005a213f1STom RhodesExample: to clear slice 4 and mark it as unused:
46192dcf6faSRuslan Ermilov.Pp
46292dcf6faSRuslan Ermilov.Dl "p       4       0       0       0"
463f46af505SJordan K. Hubbard.Pp
46405a213f1STom RhodesExample: to set slice 1 to a
465b5c508fbSRuslan Ermilov.Fx
46605a213f1STom Rhodesslice, starting at sector 1
467f46af505SJordan K. Hubbardfor 2503871 sectors (note: these numbers will be rounded upwards and
468f46af505SJordan K. Hubbarddownwards to correspond to head and cylinder boundaries):
469f46af505SJordan K. Hubbard.Pp
47092dcf6faSRuslan Ermilov.Dl "p       1       165     1       2503871"
471d1c77156SBrian Somers.Pp
472d1c77156SBrian SomersExample: to set slices 1, 2 and 4 to
473d1c77156SBrian Somers.Fx
474d1c77156SBrian Somersslices, the first being 2 Gigabytes, the second being 10 Gigabytes and the
4750a68b006SChih-Chun Wufourth being the remainder of the disk (again, numbers will be rounded
476d1c77156SBrian Somersappropriately):
477d1c77156SBrian Somers.Pp
478d1c77156SBrian Somers.Dl "p       1       165     63      2G"
479d1c77156SBrian Somers.Dl "p       2       165     *       10G"
480d1c77156SBrian Somers.Dl "p       3       0       0       0"
481d1c77156SBrian Somers.Dl "p       4       165     *       *"
48292dcf6faSRuslan Ermilov.It Ic a Ar slice
483f46af505SJordan K. HubbardMake
48405a213f1STom Rhodes.Ar slice
48592dcf6faSRuslan Ermilovthe active slice.
48692dcf6faSRuslan ErmilovCan occur anywhere in the config file, but only
487f46af505SJordan K. Hubbardone must be present.
488f46af505SJordan K. Hubbard.Pp
48905a213f1STom RhodesExample: to make slice 1 the active slice:
49092dcf6faSRuslan Ermilov.Pp
49192dcf6faSRuslan Ermilov.Dl "a       1"
492f46af505SJordan K. Hubbard.El
49326721a89SRobert Nordier.Sh FILES
49492dcf6faSRuslan Ermilov.Bl -tag -width ".Pa /boot/mbr" -compact
49526721a89SRobert Nordier.It Pa /boot/mbr
49692dcf6faSRuslan ErmilovThe default boot code.
49726721a89SRobert Nordier.El
4985b81b6b3SRodney W. Grimes.Sh SEE ALSO
499504dd5eaSRuslan Ermilov.Xr boot0cfg 8 ,
5008b23842dSMarc Fonvieille.Xr bsdlabel 8 ,
5019a5e36b8SAndrey V. Elsukov.Xr gpart 8 ,
50205a213f1STom Rhodes.Xr newfs 8
503e67d220bSSevan Janiyan.Sh HISTORY
504e67d220bSSevan JaniyanA version of
505e67d220bSSevan Janiyan.Nm
506e67d220bSSevan Janiyanfirst appeared in the Mach Operating System.
507e67d220bSSevan JaniyanIt was subsequently ported to
508e67d220bSSevan Janiyan.Bx 386 .
509e67d220bSSevan Janiyan.Sh AUTHORS
510e67d220bSSevan Janiyan.An -nosplit
511e67d220bSSevan Janiyan.Nm
512e67d220bSSevan Janiyanfor Mach Operating System was written by
513e67d220bSSevan Janiyan.An Robert Baron Aq Mt rvb@cs.cmu.edu .
514e67d220bSSevan JaniyanIt was ported to
515e67d220bSSevan Janiyan.Bx 386
516e67d220bSSevan Janiyanby
517e67d220bSSevan Janiyan.An Julian Elischer Aq Mt julian@tfs.com .
5185b81b6b3SRodney W. Grimes.Sh BUGS
51905a213f1STom RhodesThe default boot code will not necessarily handle all slice types
52092dcf6faSRuslan Ermilovcorrectly, in particular those introduced since
52192dcf6faSRuslan Ermilov.Tn MS-DOS
52292dcf6faSRuslan Ermilov6.x.
52326721a89SRobert Nordier.Pp
52492dcf6faSRuslan ErmilovThe entire utility should be made more user-friendly.
525e3038c6eSJoerg Wunsch.Pp
52605a213f1STom RhodesMost users new to
52705a213f1STom Rhodes.Fx
52805a213f1STom Rhodesdo not understand the difference between
52992dcf6faSRuslan Ermilov.Dq slice
53005a213f1STom Rhodesand
53192dcf6faSRuslan Ermilov.Dq partition ,
53205a213f1STom Rhodescausing difficulty to adjust.
533f46af505SJordan K. Hubbard.Pp
534d98b1668SPhilippe CharnierYou cannot use this command to completely dedicate a disk to
535b5c508fbSRuslan Ermilov.Fx .
536d98b1668SPhilippe CharnierThe
5378b23842dSMarc Fonvieille.Xr bsdlabel 8
538f46af505SJordan K. Hubbardcommand must be used for this.
539