8 .Nd PC slice table maintenance utility
20 In order for the BIOS to boot the kernel,
21 certain conventions must be adhered to.
22 Sector 0 of the disk must contain boot code,
25 BIOS slices can be used to break the disk up into several pieces.
26 The BIOS brings in sector 0 and verifies the magic number.
28 0 boot code then searches the slice table to determine which
31 This boot code then brings in the bootstrap from the
32 active slice and, if marked bootable, runs it.
35 you can have one or more slices with one active.
39 utility can be used to divide space on the disk into slices and set one
43 This command is obsolete.
44 Users are advised to use
53 serves a similar purpose to the
56 The first form is used to
57 display slice information or to interactively edit the slice
59 The second is used to write a slice table using a
61 and is designed to be used by other scripts/programs.
64 .Bl -tag -width indent
66 Change the active slice only.
71 Get the boot code from the file
76 Reinitialize the boot code contained in sector 0 of the disk.
80 .It Fl f Ar configfile
81 Set slice values using the file
85 only modifies explicitly specified slices, unless
87 is also given, in which case all existing slices are deleted (marked
97 in which case standard input is read.
99 .Sx CONFIGURATION FILE ,
100 below, for file syntax.
105 is used, you are not asked if you really want to write the slices
106 table (as you are in the interactive mode).
109 Initialize sector 0 of the disk.
110 Existing slice entries will be cleared
111 (marked as unused) before editing.
115 Initialize sector 0 slice table
118 slice covering the entire disk.
120 Print a slice table in
122 configuration file format and exit; see
123 .Sx CONFIGURATION FILE ,
127 Benign warnings (such as "GEOM not found") are suppressed.
129 Print summary information and exit.
131 Test mode; do not write slice values.
132 Generally used with the
134 option to see what would be written to the slice table.
138 Update (edit) the disk's sector 0 slice table.
148 prints out the slice table that is written to the disk.
150 Operate on a single slice table entry only.
156 The final disk name can be provided as a
158 disk name only, e.g.\&
160 or as a full pathname.
163 tries to figure out the default disk device name from the
166 When called with no arguments, it prints the sector 0 slice table.
169 ******* Working on device /dev/ada0 *******
170 parameters extracted from in-core disklabel are:
171 cylinders=769 heads=15 sectors/track=33 (495 blks/cyl)
173 parameters to be used for BIOS calculations are:
174 cylinders=769 heads=15 sectors/track=33 (495 blks/cyl)
176 Warning: BIOS sector numbering starts with sector 1
177 Information from DOS bootblock is:
178 The data for partition 1 is:
179 sysid 165,(FreeBSD/NetBSD/386BSD)
180 start 495, size 380160 (185 Meg), flag 0
181 beg: cyl 1/ sector 1/ head 0;
182 end: cyl 768/ sector 33/ head 14
183 The data for partition 2 is:
185 start 378180, size 2475 (1 Meg), flag 0
186 beg: cyl 764/ sector 1/ head 0;
187 end: cyl 768/ sector 33/ head 14
188 The data for partition 3 is:
190 The data for partition 4 is:
191 sysid 99,(ISC UNIX, other System V/386, GNU HURD or Mach)
192 start 380656, size 224234 (109 Meg), flag 80
193 beg: cyl 769/ sector 2/ head 0;
194 end: cyl 197/ sector 33/ head 14
197 The disk is divided into three slices that happen to fill the disk.
198 The second slice overlaps the end of the first.
199 (Used for debugging purposes.)
200 .Bl -tag -width ".Em cyl , sector No and Em head"
202 is used to label the slice.
205 magic number 165 decimal (A5 in hex).
211 fields provide the start address
212 and size of a slice in sectors.
214 specifies that this is the active slice.
220 fields are used to specify the beginning and end addresses of the slice.
224 these numbers are calculated using BIOS's understanding of the disk geometry
225 and saved in the bootblock.
231 flags are used to indicate that the slice data is to be updated.
234 option is also given,
236 will enter a conversational mode.
237 In this mode, no changes will be written to disk unless you explicitly tell
243 utility will display each slice and ask whether you want to edit it.
246 will step through each field, show you the old value,
247 and ask you for a new one.
248 When you are done with the slice,
250 will display it and ask you whether it is correct.
251 It will then proceed to the next entry.
257 fields correct is tricky, so by default,
258 they will be calculated for you;
259 you can specify them if you choose to though.
261 After all the slices are processed,
262 you are given the option to change the
265 Finally, when all the new data for sector 0 has been accumulated,
266 you are asked to confirm whether you really want to rewrite it.
268 The difference between the
275 flag edits (updates) the existing slice parameters
280 them (old values will be ignored);
281 if you edit the first slice,
283 will also set it up to use the whole disk for
287 The automatic calculation of starting cylinder etc.\& uses
288 a set of figures that represent what the BIOS thinks the
289 geometry of the drive is.
290 These figures are taken from the in-core disklabel by default,
293 initially gives you an opportunity to change them.
294 This allows you to create a bootblock that can work with drives
295 that use geometry translation under the BIOS.
297 If you hand craft your disk layout,
298 please make sure that the
300 slice starts on a cylinder boundary.
302 Editing an existing slice will most likely result in the loss of
303 all data in that slice.
307 interactively once or twice to see how it works.
308 This is completely safe as long as you answer the last question
310 There are subtleties that
312 detects that are not fully explained in this manual page.
313 .Sh CONFIGURATION FILE
316 option is given, a disk's slice table can be written using values
319 The syntax of this file is very simple;
320 each line is either a comment or a specification, as follows:
321 .Bl -tag -width indent
322 .It Ic # Ar comment ...
323 Lines beginning with a
325 are comments and are ignored.
326 .It Ic g Ar spec1 spec2 spec3
327 Set the BIOS geometry used in slice calculations.
329 three values specified, with a letter preceding each number:
330 .Bl -tag -width indent
332 Set the number of cylinders to
335 Set the number of heads to
338 Set the number of sectors/track to
342 These specs can occur in any order, as the leading letter determines
343 which value is which; however, all three must be specified.
345 This line must occur before any lines that specify slice
348 It is an error if the following is not true:
349 .Bd -literal -offset indent
350 1 <= number of cylinders
351 1 <= number of heads <= 256
352 1 <= number of sectors/track < 64
355 The number of cylinders should be less than or equal to 1024, but this
356 is not enforced, although a warning will be printed.
361 file system) must lie completely within the
362 first 1024 cylinders; if this is not true, booting may fail.
363 Non-bootable slices do not have this restriction.
365 Example (all of these are equivalent), for a disk with 1019 cylinders,
366 39 heads, and 63 sectors:
367 .Bd -literal -offset indent
372 .It Ic p Ar slice type start length
373 Set the slice given by
396 measurement respectively.
401 it is set to the value of the previous partition end.
406 the partition end is set to the end of the disk.
408 Only those slices explicitly mentioned by these lines are modified;
409 any slice not referenced by a
411 line will not be modified.
412 However, if an invalid slice table is present, or the
414 option is specified, all existing slice entries will be cleared
415 (marked as unused), and these
417 lines will have to be used to
418 explicitly set slice information.
419 If multiple slices need to be
422 lines must be specified; one for each slice.
424 These slice lines must occur after any geometry specification lines,
432 Specifying a slice type of zero is
433 the same as clearing the slice and marking it as unused; however,
434 dummy values (such as
436 must still be specified for
441 Note: the start offset will be rounded upwards to a head boundary if
442 necessary, and the end offset will be rounded downwards to a cylinder
443 boundary if necessary.
445 Example: to clear slice 4 and mark it as unused:
449 Example: to set slice 1 to a
451 slice, starting at sector 1
452 for 2503871 sectors (note: these numbers will be rounded upwards and
453 downwards to correspond to head and cylinder boundaries):
455 .Dl "p 1 165 1 2503871"
457 Example: to set slices 1, 2 and 4 to
459 slices, the first being 2 Gigabytes, the second being 10 Gigabytes and the
460 forth being the remainder of the disk (again, numbers will be rounded
471 Can occur anywhere in the config file, but only
474 Example: to make slice 1 the active slice:
479 .Bl -tag -width ".Pa /boot/mbr" -compact
481 The default boot code.
489 The default boot code will not necessarily handle all slice types
490 correctly, in particular those introduced since
494 The entire utility should be made more user-friendly.
498 do not understand the difference between
502 causing difficulty to adjust.
504 You cannot use this command to completely dedicate a disk to
508 command must be used for this.