Deleted Added
full compact
fdisk.8 (79754) fdisk.8 (81449)
1.\" $FreeBSD: head/sbin/fdisk_pc98/fdisk.8 79754 2001-07-15 07:53:42Z dd $
1.\" $FreeBSD: head/sbin/fdisk_pc98/fdisk.8 81449 2001-08-10 13:45:36Z ru $
2.\"
3.Dd October 4, 1996
4.Dt FDISK 8
5.Os
6.Sh NAME
7.Nm fdisk
8.Nd PC partition table maintenance program
9.Sh SYNOPSIS
10.Nm
11.\" !PC98 .Op Fl BIaistu
12.Op Fl Bastu
13.Op Fl b Ar bootcode
14.Op Fl 1234
15.Op Ar disk
16.Bl -tag -width time
17.Nm
18.Fl f Ar configfile
19.Op Fl itv
20.Op Ar disk
21.Sh PROLOGUE
22In order for the BIOS to boot the kernel,
23certain conventions must be adhered to.
24Sector 0 of the disk must contain boot code,
25a partition table,
26and a magic number.
27BIOS partitions can be used to break the disk up into several pieces.
28The BIOS brings in sector 0 and verifies the magic number. The sector
290 boot code then searches the partition table to determine which
30partition is marked
31.Em active .
32This boot code then brings in the bootstrap from the
33.Em active
34partition and, if marked bootable, runs it.
35Under DOS,
36you can have one or more partitions with one
37.Em active .
38The DOS
39.Nm
40program can be used to divide space on the disk into partitions and set one
41.Em active .
42.Sh DESCRIPTION
43The
44.Fx
45program
46.Nm
47serves a similar purpose to the DOS program. The first form is used to
48display partition information or to interactively edit the partition
49table. The second is used to write a partition table using a
50.Ar configfile
51and is designed to be used by other scripts/programs.
52.Pp
53Options are:
54.It Fl a
55Change the active partition only. Ignored if
56.Fl f
57is given.
58.It Fl b Ar bootcode
59Get the boot code from the file
60.Ar bootcode .
61.It Fl B
62Reinitialize the boot code contained in sector 0 of the disk. Ignored
63if
64.Fl f
65is given.
66.It Fl f Ar configfile
67Set partition values using the file
68.Ar configfile .
69The
70.Ar configfile
71always modifies existing partitions, unless
72.Fl i
73is also given, in which case all existing partitions are deleted (marked
74as "unused") before the
75.Ar configfile
76is read. The
77.Ar configfile
78can be "-", in which case
79.Ar stdin
80is read. See
81.Sx CONFIGURATION FILE ,
82below, for file syntax.
83.Pp
84.Em WARNING :
85when
86.Fl f
87is used, you are not asked if you really want to write the partition
88table (as you are in the interactive mode). Use with caution!
89.\" !PC98
90.\" .It Fl i
91.\" Initialize sector 0 of the disk. This implies
92.\" .Fl u ,
93.\" unless
94.\" .Fl f
95.\" is given.
96.\" .It Fl I
97.\" Initialize the contents of sector 0
98.\" with one
99/\" .Fx
100/\" slice covering the entire disk.
101.It Fl s
102Print summary information and exit.
103.It Fl t
104Test mode; do not write partition values. Generally used with the
105.Fl f
106option to see what would be written to the partition table. Implies
107.Fl v .
108.It Fl u
109Is used for updating (editing) sector 0 of the disk. Ignored if
110.Fl f
111is given.
112.It Fl v
113Be verbose. When
114.Fl f
115is used,
116.Nm
117prints out the partition table that is written to the disk.
118.It Fl 12345678
119Operate on a single fdisk entry only. Ignored if
120.Fl f
121is given.
122.El
123.Pp
124The final disk name can be provided as a
125.Sq bare
2.\"
3.Dd October 4, 1996
4.Dt FDISK 8
5.Os
6.Sh NAME
7.Nm fdisk
8.Nd PC partition table maintenance program
9.Sh SYNOPSIS
10.Nm
11.\" !PC98 .Op Fl BIaistu
12.Op Fl Bastu
13.Op Fl b Ar bootcode
14.Op Fl 1234
15.Op Ar disk
16.Bl -tag -width time
17.Nm
18.Fl f Ar configfile
19.Op Fl itv
20.Op Ar disk
21.Sh PROLOGUE
22In order for the BIOS to boot the kernel,
23certain conventions must be adhered to.
24Sector 0 of the disk must contain boot code,
25a partition table,
26and a magic number.
27BIOS partitions can be used to break the disk up into several pieces.
28The BIOS brings in sector 0 and verifies the magic number. The sector
290 boot code then searches the partition table to determine which
30partition is marked
31.Em active .
32This boot code then brings in the bootstrap from the
33.Em active
34partition and, if marked bootable, runs it.
35Under DOS,
36you can have one or more partitions with one
37.Em active .
38The DOS
39.Nm
40program can be used to divide space on the disk into partitions and set one
41.Em active .
42.Sh DESCRIPTION
43The
44.Fx
45program
46.Nm
47serves a similar purpose to the DOS program. The first form is used to
48display partition information or to interactively edit the partition
49table. The second is used to write a partition table using a
50.Ar configfile
51and is designed to be used by other scripts/programs.
52.Pp
53Options are:
54.It Fl a
55Change the active partition only. Ignored if
56.Fl f
57is given.
58.It Fl b Ar bootcode
59Get the boot code from the file
60.Ar bootcode .
61.It Fl B
62Reinitialize the boot code contained in sector 0 of the disk. Ignored
63if
64.Fl f
65is given.
66.It Fl f Ar configfile
67Set partition values using the file
68.Ar configfile .
69The
70.Ar configfile
71always modifies existing partitions, unless
72.Fl i
73is also given, in which case all existing partitions are deleted (marked
74as "unused") before the
75.Ar configfile
76is read. The
77.Ar configfile
78can be "-", in which case
79.Ar stdin
80is read. See
81.Sx CONFIGURATION FILE ,
82below, for file syntax.
83.Pp
84.Em WARNING :
85when
86.Fl f
87is used, you are not asked if you really want to write the partition
88table (as you are in the interactive mode). Use with caution!
89.\" !PC98
90.\" .It Fl i
91.\" Initialize sector 0 of the disk. This implies
92.\" .Fl u ,
93.\" unless
94.\" .Fl f
95.\" is given.
96.\" .It Fl I
97.\" Initialize the contents of sector 0
98.\" with one
99/\" .Fx
100/\" slice covering the entire disk.
101.It Fl s
102Print summary information and exit.
103.It Fl t
104Test mode; do not write partition values. Generally used with the
105.Fl f
106option to see what would be written to the partition table. Implies
107.Fl v .
108.It Fl u
109Is used for updating (editing) sector 0 of the disk. Ignored if
110.Fl f
111is given.
112.It Fl v
113Be verbose. When
114.Fl f
115is used,
116.Nm
117prints out the partition table that is written to the disk.
118.It Fl 12345678
119Operate on a single fdisk entry only. Ignored if
120.Fl f
121is given.
122.El
123.Pp
124The final disk name can be provided as a
125.Sq bare
126disk name only, e.g.
126disk name only, e.g.\&
127.Ql da0 ,
128or as a fully qualified device node under
129.Pa /dev .
130If omitted, the disks
131.Ql wd0 ,
132.Ql da0 ,
133and
134.Ql od0
135are being searched in that order, until one is
136being found responding.
137.Pp
138When called with no arguments, it prints the sector 0 partition table.
139An example follows:
140.Bd -literal
141 ******* Working on device /dev/rda0 *******
142 parameters extracted from in-core disklabel are:
143 cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
144
145 parameters to be used for BIOS calculations are:
146 cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
147
148 Media sector size is 512
149 Warning: BIOS sector numbering starts with sector 1
150 Information from DOS bootblock is:
151 The data for partition 1 is:
152 sysmid 148,(FreeBSD/NetBSD/386BSD)
153 start 256, size 2490112 (1215 Meg), sid 196
154 beg: cyl 1/ sector 0/ head 0;
155 end: cyl 9727/ sector 0/ head 0
156 system Name FreeBSD(98)
157 The data for partition 2 is:
158 sysmid 148,(FreeBSD/NetBSD/386BSD)
159 start 2490368, size 5505024 (2688 Meg), sid 196
160 beg: cyl 9728/ sector 0/ head 0;
161 end: cyl 31231/ sector 0/ head 0
162 system Name FreeBSD(98)
163 The data for partition 3 is:
164 <UNUSED>
165 The data for partition 4 is:
166 <UNUSED>
167 The data for partition 5 is:
168 <UNUSED>
169 The data for partition 6 is:
170 <UNUSED>
171 The data for partition 7 is:
172 <UNUSED>
173 The data for partition 8 is:
174 <UNUSED>
175 The data for partition 9 is:
176 <UNUSED>
177 The data for partition 10 is:
178 <UNUSED>
179 The data for partition 11 is:
180 <UNUSED>
181 The data for partition 12 is:
182 <UNUSED>
183 The data for partition 13 is:
184 <UNUSED>
185 The data for partition 14 is:
186 <UNUSED>
187 The data for partition 15 is:
188 <UNUSED>
189 The data for partition 16 is:
190 <UNUSED>
191.Ed
192.Pp
193The disk is divided into three partitions that happen to fill the disk.
194The second partition overlaps the end of the first.
195(Used for debugging purposes)
196.Bl -tag -width "cyl, sector and head"
197.It Em "sysmid"
198is used to label the partition.
199.Fx
200reserves the
201magic number 148 decimal (94 in hex).
202.It Em start No and Em size
203fields provide the start address
204and size of a partition in sectors.
205.\" !PC98 .It Em "flag 80"
206.\" specifies that this is the active partition.
207.It Em cyl , sector No and Em head
208fields are used to specify the beginning address
209and end address for the partition.
210.It Em "system Name"
211is the name of the partition.
212.It Em Note :
213these numbers are calculated using BIOS's understanding of the disk geometry
214and saved in the bootblock.
215.El
216.Pp
217The flags
218.\" .Fl i
219.\" or
220.Fl u
221are used to indicate that the partition data is to be updated, unless the
222.Fl f
223option is used. If the
224.Fl f
225option is not used, the
226.Nm
227program will enter a conversational mode.
228This mode is designed not to change any data unless you explicitly tell it to.
229.Nm Fdisk
230selects defaults for its questions to guarantee the above behavior.
231.Pp
232It displays each partition
233and ask if you want to edit it.
234If you say yes,
235it will step through each field showing the old value
236and asking for a new one.
237When you are done with a partition,
238.Nm
239will display it and ask if it is correct.
240.Nm Fdisk
241will then proceed to the next entry.
242.Pp
243Getting the
244.Em cyl , sector ,
245and
246.Em head
247fields correct is tricky.
248So by default,
249they will be calculated for you;
250you can specify them if you choose.
251.Pp
252After all the partitions are processed,
253you are given the option to change the
254.Em active
255partition.
256Finally,
257when the all the data for the first sector has been accumulated,
258you are asked if you really want to rewrite sector 0.
259Only if you answer yes,
260will the data be written to disk.
261.Pp
262The difference between the
263.Fl u
264flag and
265.Fl i
266flag is that
267the
268.Fl u
269flag just edits the fields as they appear on the disk.
270While the
271.Fl i
272flag is used to "initialize" sector 0;
273it will setup the last BIOS partition to use the whole disk for
274.Fx ;
275and make it active.
276.Sh NOTES
277The automatic calculation of starting cylinder etc. uses
278a set of figures that represent what the BIOS thinks is the
279geometry of the drive.
280These figures are by default taken from the incore disklabel,
281but the program initially gives you an opportunity to change them.
282This allows the user to create a bootblock that can work with drives
283that use geometry translation under the BIOS.
284.Pp
285If you hand craft your disk layout,
286please make sure that the
287.Fx
288partition starts on a cylinder boundary.
289A number of decisions made later may assume this.
290(This might not be necessary later.)
291.Pp
292Editing an existing partition will most likely cause you to
293lose all the data in that partition.
294.Pp
295You should run this program interactively once or twice to see how it
296works. This is completely safe as long as you answer the last question
297in the negative. There are subtleties that the program detects that are
298not fully explained in this manual page.
299.Sh CONFIGURATION FILE
300When the
301.Fl f
302option is given, a disk's partition table can be written using values
303from a
304.Ar configfile .
305The syntax of this file is very simple. Each line is either a comment or
306a specification, and whitespace (except for newlines) are ignored:
307.Bl -tag -width Ds
308.It Xo
309.Ic #
310.Ar comment ...
311.Xc
312Lines beginning with a "#" are comments and are ignored.
313.It Xo
314.Ic g
315.Ar spec1
316.Ar spec2
317.Ar spec3
318.Xc
319Set the BIOS geometry used in partition calculations. There must be
320three values specified, with a letter preceding each number:
321.Bl -tag -width Ds
322.Sm off
323.It Cm c Ar num
324.Sm on
325Set the number of cylinders to
326.Ar num .
327.Sm off
328.It Cm h Ar num
329.Sm on
330Set the number of heads to
331.Ar num .
332.Sm off
333.It Cm s Ar num
334.Sm on
335Set the number of sectors/track to
336.Ar num .
337.El
338.Pp
339These specs can occur in any order, as the leading letter determines
340which value is which; however, all three must be specified.
341.Pp
342This line must occur before any lines that specify partition
343information.
344.Pp
345It is an error if the following is not true:
346.Bd -literal -offset indent
3471 <= number of cylinders
3481 <= number of heads <= 256
3491 <= number of sectors/track < 64
350.Ed
351.Pp
352The number of cylinders should be less than or equal to 1024, but this
353is not enforced, although a warning will be output. Note that bootable
354.Fx
355partitions (the "/" filesystem) must lie completely within the
356first 1024 cylinders; if this is not true, booting may fail.
357Non-bootable partitions do not have this restriction.
358.Pp
359Example (all of these are equivalent), for a disk with 1019 cylinders,
36039 heads, and 63 sectors:
361.Bd -literal -offset indent
362g c1019 h39 s63
363g h39 c1019 s63
364g s63 h39 c1019
365.Ed
366.It Xo
367.Ic p
368.Ar partition
369.Ar type
370.Ar start
371.Ar length
372.Xc
373Set the partition given by
374.Ar partition
375(1-4) to type
376.Ar type ,
377starting at sector
378.Ar start
379for
380.Ar length
381sectors.
382.Pp
383Only those partitions explicitly mentioned by these lines are modified;
384any partition not referenced by a "p" line will not be modified.
385However, if an invalid partition table is present, or the
386.Fl i
387option is specified, all existing partition entries will be cleared
388(marked as unused), and these "p" lines will have to be used to
389explicitly set partition information. If multiple partitions need to be
390set, multiple "p" lines must be specified; one for each partition.
391.Pp
392These partition lines must occur after any geometry specification lines,
393if one is present.
394.Pp
395The
396.Ar type
397is 165 for
398.Fx
399partitions. Specifying a partition type of zero is
400the same as clearing the partition and marking it as unused; however,
401dummy values (such as "0") must still be specified for
402.Ar start
403and
404.Ar length .
405.Pp
406Note: the start offset will be rounded upwards to a head boundary if
407necessary, and the end offset will be rounded downwards to a cylinder
408boundary if necessary.
409.Pp
410Example: to clear partition 4 and mark it as unused:
411.Bd -literal -offset indent
412p 4 0 0 0
413.Ed
414.Pp
415Example: to set partition 1 to a
416.Fx
417partition, starting at sector 1
418for 2503871 sectors (note: these numbers will be rounded upwards and
419downwards to correspond to head and cylinder boundaries):
420.Bd -literal -offset indent
421p 1 165 1 2503871
422.Ed
423.It Xo
424.Ic a
425.Ar partition
426.Xc
427Make
428.Ar partition
429the active partition. Can occur anywhere in the config file, but only
430one must be present.
431.Pp
432Example: to make partition 1 the active partition:
433.Bd -literal -offset indent
434a 1
435.Ed
436.El
437.Sh FILES
438.Bl -tag -width /boot/mbr -compact
439.It Pa /boot/mbr
440The default boot code
441.El
442.Sh SEE ALSO
443.Xr disklabel 8
444.Sh BUGS
445The default boot code will not necessarily handle all partition types
446correctly, in particular those introduced since MS-DOS 6.x.
447.Pp
448The entire program should be made more user-friendly.
449.Pp
450Throughout this man page, the term
451.Sq partition
452is used where it should actually be
453.Sq slice ,
454in order to conform with the terms used elsewhere.
455.Pp
456You cannot use this command to completely dedicate a disk to
457.Fx .
458The
459.Xr disklabel 8
460command must be used for this.
127.Ql da0 ,
128or as a fully qualified device node under
129.Pa /dev .
130If omitted, the disks
131.Ql wd0 ,
132.Ql da0 ,
133and
134.Ql od0
135are being searched in that order, until one is
136being found responding.
137.Pp
138When called with no arguments, it prints the sector 0 partition table.
139An example follows:
140.Bd -literal
141 ******* Working on device /dev/rda0 *******
142 parameters extracted from in-core disklabel are:
143 cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
144
145 parameters to be used for BIOS calculations are:
146 cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
147
148 Media sector size is 512
149 Warning: BIOS sector numbering starts with sector 1
150 Information from DOS bootblock is:
151 The data for partition 1 is:
152 sysmid 148,(FreeBSD/NetBSD/386BSD)
153 start 256, size 2490112 (1215 Meg), sid 196
154 beg: cyl 1/ sector 0/ head 0;
155 end: cyl 9727/ sector 0/ head 0
156 system Name FreeBSD(98)
157 The data for partition 2 is:
158 sysmid 148,(FreeBSD/NetBSD/386BSD)
159 start 2490368, size 5505024 (2688 Meg), sid 196
160 beg: cyl 9728/ sector 0/ head 0;
161 end: cyl 31231/ sector 0/ head 0
162 system Name FreeBSD(98)
163 The data for partition 3 is:
164 <UNUSED>
165 The data for partition 4 is:
166 <UNUSED>
167 The data for partition 5 is:
168 <UNUSED>
169 The data for partition 6 is:
170 <UNUSED>
171 The data for partition 7 is:
172 <UNUSED>
173 The data for partition 8 is:
174 <UNUSED>
175 The data for partition 9 is:
176 <UNUSED>
177 The data for partition 10 is:
178 <UNUSED>
179 The data for partition 11 is:
180 <UNUSED>
181 The data for partition 12 is:
182 <UNUSED>
183 The data for partition 13 is:
184 <UNUSED>
185 The data for partition 14 is:
186 <UNUSED>
187 The data for partition 15 is:
188 <UNUSED>
189 The data for partition 16 is:
190 <UNUSED>
191.Ed
192.Pp
193The disk is divided into three partitions that happen to fill the disk.
194The second partition overlaps the end of the first.
195(Used for debugging purposes)
196.Bl -tag -width "cyl, sector and head"
197.It Em "sysmid"
198is used to label the partition.
199.Fx
200reserves the
201magic number 148 decimal (94 in hex).
202.It Em start No and Em size
203fields provide the start address
204and size of a partition in sectors.
205.\" !PC98 .It Em "flag 80"
206.\" specifies that this is the active partition.
207.It Em cyl , sector No and Em head
208fields are used to specify the beginning address
209and end address for the partition.
210.It Em "system Name"
211is the name of the partition.
212.It Em Note :
213these numbers are calculated using BIOS's understanding of the disk geometry
214and saved in the bootblock.
215.El
216.Pp
217The flags
218.\" .Fl i
219.\" or
220.Fl u
221are used to indicate that the partition data is to be updated, unless the
222.Fl f
223option is used. If the
224.Fl f
225option is not used, the
226.Nm
227program will enter a conversational mode.
228This mode is designed not to change any data unless you explicitly tell it to.
229.Nm Fdisk
230selects defaults for its questions to guarantee the above behavior.
231.Pp
232It displays each partition
233and ask if you want to edit it.
234If you say yes,
235it will step through each field showing the old value
236and asking for a new one.
237When you are done with a partition,
238.Nm
239will display it and ask if it is correct.
240.Nm Fdisk
241will then proceed to the next entry.
242.Pp
243Getting the
244.Em cyl , sector ,
245and
246.Em head
247fields correct is tricky.
248So by default,
249they will be calculated for you;
250you can specify them if you choose.
251.Pp
252After all the partitions are processed,
253you are given the option to change the
254.Em active
255partition.
256Finally,
257when the all the data for the first sector has been accumulated,
258you are asked if you really want to rewrite sector 0.
259Only if you answer yes,
260will the data be written to disk.
261.Pp
262The difference between the
263.Fl u
264flag and
265.Fl i
266flag is that
267the
268.Fl u
269flag just edits the fields as they appear on the disk.
270While the
271.Fl i
272flag is used to "initialize" sector 0;
273it will setup the last BIOS partition to use the whole disk for
274.Fx ;
275and make it active.
276.Sh NOTES
277The automatic calculation of starting cylinder etc. uses
278a set of figures that represent what the BIOS thinks is the
279geometry of the drive.
280These figures are by default taken from the incore disklabel,
281but the program initially gives you an opportunity to change them.
282This allows the user to create a bootblock that can work with drives
283that use geometry translation under the BIOS.
284.Pp
285If you hand craft your disk layout,
286please make sure that the
287.Fx
288partition starts on a cylinder boundary.
289A number of decisions made later may assume this.
290(This might not be necessary later.)
291.Pp
292Editing an existing partition will most likely cause you to
293lose all the data in that partition.
294.Pp
295You should run this program interactively once or twice to see how it
296works. This is completely safe as long as you answer the last question
297in the negative. There are subtleties that the program detects that are
298not fully explained in this manual page.
299.Sh CONFIGURATION FILE
300When the
301.Fl f
302option is given, a disk's partition table can be written using values
303from a
304.Ar configfile .
305The syntax of this file is very simple. Each line is either a comment or
306a specification, and whitespace (except for newlines) are ignored:
307.Bl -tag -width Ds
308.It Xo
309.Ic #
310.Ar comment ...
311.Xc
312Lines beginning with a "#" are comments and are ignored.
313.It Xo
314.Ic g
315.Ar spec1
316.Ar spec2
317.Ar spec3
318.Xc
319Set the BIOS geometry used in partition calculations. There must be
320three values specified, with a letter preceding each number:
321.Bl -tag -width Ds
322.Sm off
323.It Cm c Ar num
324.Sm on
325Set the number of cylinders to
326.Ar num .
327.Sm off
328.It Cm h Ar num
329.Sm on
330Set the number of heads to
331.Ar num .
332.Sm off
333.It Cm s Ar num
334.Sm on
335Set the number of sectors/track to
336.Ar num .
337.El
338.Pp
339These specs can occur in any order, as the leading letter determines
340which value is which; however, all three must be specified.
341.Pp
342This line must occur before any lines that specify partition
343information.
344.Pp
345It is an error if the following is not true:
346.Bd -literal -offset indent
3471 <= number of cylinders
3481 <= number of heads <= 256
3491 <= number of sectors/track < 64
350.Ed
351.Pp
352The number of cylinders should be less than or equal to 1024, but this
353is not enforced, although a warning will be output. Note that bootable
354.Fx
355partitions (the "/" filesystem) must lie completely within the
356first 1024 cylinders; if this is not true, booting may fail.
357Non-bootable partitions do not have this restriction.
358.Pp
359Example (all of these are equivalent), for a disk with 1019 cylinders,
36039 heads, and 63 sectors:
361.Bd -literal -offset indent
362g c1019 h39 s63
363g h39 c1019 s63
364g s63 h39 c1019
365.Ed
366.It Xo
367.Ic p
368.Ar partition
369.Ar type
370.Ar start
371.Ar length
372.Xc
373Set the partition given by
374.Ar partition
375(1-4) to type
376.Ar type ,
377starting at sector
378.Ar start
379for
380.Ar length
381sectors.
382.Pp
383Only those partitions explicitly mentioned by these lines are modified;
384any partition not referenced by a "p" line will not be modified.
385However, if an invalid partition table is present, or the
386.Fl i
387option is specified, all existing partition entries will be cleared
388(marked as unused), and these "p" lines will have to be used to
389explicitly set partition information. If multiple partitions need to be
390set, multiple "p" lines must be specified; one for each partition.
391.Pp
392These partition lines must occur after any geometry specification lines,
393if one is present.
394.Pp
395The
396.Ar type
397is 165 for
398.Fx
399partitions. Specifying a partition type of zero is
400the same as clearing the partition and marking it as unused; however,
401dummy values (such as "0") must still be specified for
402.Ar start
403and
404.Ar length .
405.Pp
406Note: the start offset will be rounded upwards to a head boundary if
407necessary, and the end offset will be rounded downwards to a cylinder
408boundary if necessary.
409.Pp
410Example: to clear partition 4 and mark it as unused:
411.Bd -literal -offset indent
412p 4 0 0 0
413.Ed
414.Pp
415Example: to set partition 1 to a
416.Fx
417partition, starting at sector 1
418for 2503871 sectors (note: these numbers will be rounded upwards and
419downwards to correspond to head and cylinder boundaries):
420.Bd -literal -offset indent
421p 1 165 1 2503871
422.Ed
423.It Xo
424.Ic a
425.Ar partition
426.Xc
427Make
428.Ar partition
429the active partition. Can occur anywhere in the config file, but only
430one must be present.
431.Pp
432Example: to make partition 1 the active partition:
433.Bd -literal -offset indent
434a 1
435.Ed
436.El
437.Sh FILES
438.Bl -tag -width /boot/mbr -compact
439.It Pa /boot/mbr
440The default boot code
441.El
442.Sh SEE ALSO
443.Xr disklabel 8
444.Sh BUGS
445The default boot code will not necessarily handle all partition types
446correctly, in particular those introduced since MS-DOS 6.x.
447.Pp
448The entire program should be made more user-friendly.
449.Pp
450Throughout this man page, the term
451.Sq partition
452is used where it should actually be
453.Sq slice ,
454in order to conform with the terms used elsewhere.
455.Pp
456You cannot use this command to completely dedicate a disk to
457.Fx .
458The
459.Xr disklabel 8
460command must be used for this.