1.\" Copyright (c) 1987, 1988, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Symmetric Computer Systems. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. All advertising materials mentioning features or use of this software 16.\" must display the following acknowledgment: 17.\" This product includes software developed by the University of 18.\" California, Berkeley and its contributors. 19.\" 4. Neither the name of the University nor the names of its contributors 20.\" may be used to endorse or promote products derived from this software 21.\" without specific prior written permission. 22.\" 23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 36.\" $FreeBSD: src/sbin/disklabel/disklabel.8,v 1.15.2.22 2003/04/17 17:56:34 trhodes Exp $ 37.\" $DragonFly: src/sbin/disklabel64/disklabel64.8,v 1.3 2007/08/10 18:28:27 swildner Exp $ 38.\" 39.Dd August 8, 2007 40.Dt DISKLABEL64 8 41.Os 42.Sh NAME 43.Nm disklabel64 44.Nd read and write disk pack label 45.Sh SYNOPSIS 46.Nm 47.Op Fl r 48.Ar disk 49.Nm 50.Fl w 51.Op Fl r 52.Op Fl n 53.Ar disk Ar disktype/auto 54.Oo Ar packid Oc 55.Nm 56.Fl e 57.Op Fl r 58.Op Fl n 59.Ar disk 60.Nm 61.Fl R 62.Op Fl r 63.Op Fl n 64.Ar disk Ar protofile 65.Nm 66.Op Fl NW 67.Ar disk 68.Pp 69.Nm 70.Fl B 71.Oo 72.Fl b Ar boot1 73.Fl s Ar boot2 74.Oc 75.Ar disk 76.Oo Ar disktype/auto Oc 77.Nm 78.Fl w 79.Fl B 80.Op Fl n 81.Oo 82.Fl b Ar boot1 83.Fl s Ar boot2 84.Oc 85.Ar disk Ar disktype/auto 86.Oo Ar packid Oc 87.Nm 88.Fl R 89.Fl B 90.Op Fl n 91.Oo 92.Fl b Ar boot1 93.Fl s Ar boot2 94.Oc 95.Ar disk Ar protofile 96.Oo Ar disktype/auto Oc 97.Nm 98.Fl f Ar slice_start_lba 99.Oo Ar options Oc 100.Sh DESCRIPTION 101The 102.Nm 103utility 104installs, examines or modifies the label on a disk drive or pack. 105When writing 106the label, it can be used to change the drive identification, the disk 107partitions on the drive, or to replace a damaged label. 108There are several forms 109of the command that read (display), install or edit the label on a disk. 110In 111addition, 112.Nm 113can install bootstrap code. 114.Ss Raw or in-core label 115The disk label resides close to or at the beginning of each disk slice. 116For faster access, the kernel maintains a copy in core at all times. 117By 118default, most forms of the 119.Nm 120command access the in-core copy of the label. 121To access the raw (on-disk) 122copy, use the 123.Fl r 124option. 125This option allows a label to be installed on a disk without kernel 126support for a label, such as when labels are first installed on a system; it 127must be used when first installing a label on a disk. 128The specific effect of 129.Fl r 130is described under each command. 131.Ss Disk device name 132All 133.Nm 134forms require a disk device name, which should always be the raw 135device name representing the disk or slice. 136For example 137.Pa da0 138represents the entire disk regardless of any DOS partitioning, 139and 140.Pa da0s1 141represents a slice. 142Some devices, most notably 143.Ar ccd , 144require that the 145.Dq whole-disk 146(or 147.Dq c ) 148partition be specified. 149For example 150.Pa ccd0c . 151You do not have to include the 152.Pa /dev/ 153path prefix when specifying the device. 154The 155.Nm 156utility will automatically prepend it. 157.Ss Reading the disk label 158To examine the label on a disk drive, use 159.Nm 160without options: 161.Pp 162.Nm 163.Op Fl r 164.Ar disk 165.Pp 166.Ar disk 167represents the raw disk in question, and may be in the form 168.Pa da0 169or 170.Pa /dev/da0c . 171It will display all of the parameters associated with the drive and its 172partition layout. 173Unless the 174.Fl r 175flag is given, 176the kernel's in-core copy of the label is displayed; 177if the disk has no label, or the partition types on the disk are incorrect, 178the kernel may have constructed or modified the label. 179If the 180.Fl r 181flag is given, 182.Nm 183reads the label from the raw disk and displays it. 184Both versions are usually 185identical except in the case where a label has not yet been initialized or 186is corrupt. 187.Ss Writing a standard label 188To write a standard label, use the form 189.Pp 190.Nm 191.Fl w 192.Op Fl r 193.Op Fl n 194.Ar disk Ar disktype/auto 195.Oo Ar packid Oc 196.Pp 197.Nm 198.Fl w 199.Op Fl r 200.Op Fl n 201.Ar disk 202auto 203.Pp 204The required arguments to 205.Nm 206are the drive to be labeled and the drive type as described in the 207.Xr disktab 5 208file. 209The drive parameters and partitions are taken from that file. 210If 211different disks of the same physical type are to have different partitions, it 212will be necessary to have separate disktab entries describing each, or to edit 213the label after installation as described below. 214The optional argument is a 215pack identification string, up to 16 characters long. 216The pack id must be 217quoted if it contains blanks. 218.Pp 219If the 220.Fl n 221flag is given, no data will be written to the device, and instead the 222disklabel that would have been written will be printed to stdout. 223.Pp 224If the 225.Fl r 226flag is given, the disk sectors containing the label and bootstrap 227will be written directly. 228A side-effect of this is that any existing bootstrap code will be overwritten 229and the disk rendered unbootable. 230See the boot options below for a method of 231writing the label and the bootstrap at the same time. 232If 233.Fl r 234is not specified, 235the existing label will be updated via the in-core copy and any bootstrap 236code will be unaffected. 237If the disk does not already have a label, the 238.Fl r 239flag must be used. 240In either case, the kernel's in-core label is replaced. 241.Pp 242For a virgin disk that is not known to 243.Xr disktab 5 , 244.Ar disktype 245can be specified as 246.Dq auto . 247In this case, the driver is requested to produce a virgin label for the 248disk. 249This might or might not be successful, depending on whether the 250driver for the disk is able to get the required data without reading 251anything from the disk at all. 252It will likely succeed for all SCSI 253disks, most IDE disks, and vnode devices. 254Writing a label to the 255disk is the only supported operation, and the 256.Ar disk 257itself must be provided as the canonical name, i.e.\& not as a full 258path name. 259.Pp 260For most harddisks, a label based on percentages for most partitions (and 261one partition with a size of 262.Ql * ) 263will produce a reasonable configuration. 264.Pp 265PC-based systems have special requirements in order for the BIOS to properly 266recognize a 267.Dx 268disklabel. 269Older systems may require what is known as a 270.Dq dangerously dedicated 271disklabel, which creates a fake DOS partition to work around problems older 272BIOSes have with modern disk geometries. 273On newer systems you generally want 274to create a normal DOS partition using 275.Ar fdisk 276and then create a 277.Dx 278disklabel within that slice. 279This is described 280later on in this page. 281.Pp 282Installing a new disklabel does not in of itself allow your system to boot 283a kernel using that label. 284You must also install boot blocks, which is 285described later on in this manual page. 286.Ss Editing an existing disk label 287To edit an existing disk label, use the form 288.Pp 289.Nm 290.Fl e 291.Op Fl r 292.Op Fl n 293.Ar disk 294.Pp 295This command reads the label from the in-core kernel copy, or directly from the 296disk if the 297.Fl r 298flag is also specified. 299The label is written to a file in ASCII and then 300supplied to an editor for changes. 301If no editor is specified in an 302.Ev EDITOR 303environment variable, 304.Xr vi 1 305is used. 306When the editor terminates, the label file is used to rewrite the disk 307label. 308Existing bootstrap code is unchanged regardless of whether 309.Fl r 310was specified. 311If 312.Fl n 313is specified, no data will be written to the device, and instead the 314disklabel that would have been written will be printed to stdout. 315This is 316useful to see how a partitioning scheme will work out for a specific disk. 317.Ss Restoring a disk label from a file 318To restore a disk label from a file, use the form 319.Pp 320.Nm 321.Fl R 322.Op Fl r 323.Op Fl n 324.Ar disk Ar protofile 325.Pp 326.Nm 327is capable of restoring a disk label that was previously saved in a file in ASCII format. 328The prototype file used to create the label should be in the same format as that 329produced when reading or editing a label. 330Comments are delimited by 331.Ar \&# 332and newline. 333As when writing a new label, any existing bootstrap code will be 334clobbered if 335.Fl r 336is specified and will be unaffected otherwise. 337See the boot options below for a 338method of restoring the label and writing the bootstrap at the same time. 339If 340.Fl n 341is used, no data will be written to the device, and instead the 342disklabel that would have been written will be printed to stdout. 343This is 344useful to see how a partitioning scheme will work out for a specific disk. 345.Ss Enabling and disabling writing to the disk label area 346By default, it is not possible to write to the disk label area at the beginning 347of a disk. 348The disk driver arranges for 349.Xr write 2 350and similar system calls 351to return 352.Er EROFS 353on any attempt to do so. 354If you need 355to write to this area (for example, to obliterate the label), use the form 356.Pp 357.Nm 358.Fl W 359.Ar disk 360.Pp 361To disallow writing to the label area after previously allowing it, use the 362command 363.Pp 364.Nm 365.Fl N 366.Ar disk 367.Ss Installing bootstraps 368The final three forms of 369.Nm 370are used to install bootstrap code. 371If you are creating a 372.Dq dangerously-dedicated 373slice for compatibility with older PC systems, 374you generally want to specify the raw disk name such as 375.Pa da0 . 376If you are creating a label within an existing DOS slice, 377you should specify 378the partition name such as 379.Pa da0s1a . 380Making a slice bootable can be tricky. 381If you are using a normal DOS 382slice you typically install (or leave) a standard MBR on the base disk and 383then install the 384.Dx 385bootblocks in the slice. 386.Pp 387.Nm 388.Fl B 389.Oo 390.Fl b Ar boot1 391.Fl s Ar boot2 392.Oc 393.Ar disk 394.Oo Ar disktype Oc 395.Pp 396This form installs the bootstrap only. 397It does not change the disk label. 398You should never use this command on a base disk unless you intend to create a 399.Dq dangerously-dedicated 400disk, such as 401.Ar da0 . 402This command is typically run on a slice such as 403.Ar da0s1 . 404.Pp 405.Nm 406.Fl w 407.Fl B 408.Op Fl n 409.Oo 410.Fl b Ar boot1 411.Fl s Ar boot2 412.Oc 413.Ar disk Ar disktype 414.Oo Ar packid Oc 415.Pp 416This form corresponds to the 417.Dq write label 418command described above. 419In addition to writing a new volume label, it also installs the bootstrap. 420If run on a base disk this command will create a 421.Dq dangerously-dedicated 422label. 423This command is normally run on a slice rather than a base disk. 424If 425.Fl n 426is used, no data will be written to the device, and instead the 427disklabel that would have been written will be printed to stdout. 428.Pp 429.Nm 430.Fl R 431.Fl B 432.Op Fl n 433.Oo 434.Fl b Ar boot1 435.Fl s Ar boot2 436.Oc 437.Ar disk Ar protofile 438.Oo Ar disktype Oc 439.Pp 440This form corresponds to the 441.Dq restore label 442command described above. 443In addition to restoring the volume label, it also installs the bootstrap. 444If run on a base disk this command will create a 445.Dq dangerously-dedicated 446label. 447This command is normally run on a slice rather than a base disk. 448.Pp 449The bootstrap commands always access the disk directly, so it is not necessary 450to specify the 451.Fl r 452flag. 453If 454.Fl n 455is used, no data will be written to the device, and instead the 456disklabel that would have been written will be printed to stdout. 457.Pp 458The bootstrap code is comprised of two boot programs. 459Specify the name of the 460boot programs to be installed in one of these ways: 461.Bl -enum 462.It 463Specify the names explicitly with the 464.Fl b 465and 466.Fl s 467flags. 468.Fl b 469indicates the primary boot program and 470.Fl s 471the secondary boot program. 472The boot programs are located in 473.Pa /boot . 474.It 475If the 476.Fl b 477and 478.Fl s 479flags are not specified, but 480.Ar disktype 481was specified, the names of the programs are taken from the 482.Dq b0 483and 484.Dq b1 485parameters of the 486.Xr disktab 5 487entry for the disk if the disktab entry exists and includes those parameters. 488.It 489Otherwise, the default boot image names are used: 490.Pa /boot/boot1 491and 492.Pa /boot/boot2 493for the standard stage1 and stage2 boot images. 494.El 495.Ss Initializing/Formatting a bootable disk from scratch 496To initialize a disk from scratch the following sequence is recommended. 497Please note that this will wipe everything that was previously on the disk, 498including any 499.No non- Ns Dx 500slices. 501.Bl -enum 502.It 503Use 504.Xr fdisk 8 505to initialize the hard disk, and create a slice table, referred to 506as the 507.Dq "partition table" 508in 509.Tn DOS . 510.It 511Use 512.Nm 513to define partitions on 514.Dx 515slices created in the previous step. 516.It 517Finally use 518.Xr newfs 8 519to create file systems on new partitions. 520.El 521.Pp 522A typical partitioning scheme would be to have an 523.Ql a 524partition 525of approximately 128MB to hold the root file system, a 526.Ql b 527partition for 528swap, a 529.Ql d 530partition for 531.Pa /var 532(usually 128MB), an 533.Ql e 534partition 535for 536.Pa /var/tmp 537(usually 128MB), an 538.Ql f 539partition for 540.Pa /usr 541(usually around 2GB), 542and finally a 543.Ql g 544partition for 545.Pa /home 546(usually all remaining space). 547Your mileage may vary. 548.Pp 549.Nm fdisk Fl BI Pa da0 550.Pp 551.Nm 552.Fl w B 553.Pa da0s1 554.Cm auto 555.Pp 556.Nm 557.Fl e 558.Pa da0s1 559.Sh FILES 560.Bl -tag -width ".Pa /etc/disktab" -compact 561.It Pa /boot/boot 562Default boot image. 563.It Pa /etc/disktab 564Disk description file. 565.El 566.Sh SAVED FILE FORMAT 567The 568.Nm 569utility 570uses an 571.Tn ASCII 572version of the label when examining, editing, or restoring a disk 573label. 574The format is: 575.Bd -literal -offset 4n 576# /dev/da1c: 577type: SCSI 578disk: da0s1 579label: 580flags: 581bytes/sector: 512 582sectors/track: 51 583tracks/cylinder: 19 584sectors/cylinder: 969 585cylinders: 1211 586sectors/unit: 1173930 587rpm: 3600 588interleave: 1 589trackskew: 0 590cylinderskew: 0 591headswitch: 0 # milliseconds 592track-to-track seek: 0 # milliseconds 593drivedata: 0 594 59516 partitions: 596# size offset fstype 597 a: 81920 0 4.2BSD 598 b: 160000 81920 swap 599 c: 1173930 0 unused 600 h: 962010 211920 vinum 601.Ed 602.Pp 603Lines starting with a 604.Ql # 605mark are comments. 606Most of the other specifications are no longer used. 607The ones which must still be set correctly are: 608.Pp 609.Bl -inset 610.It Ar label 611is an optional label, set by the 612.Ar packid 613option when writing a label. 614.It Ar flags 615may be 616.Cm removable , ecc 617or 618.Cm badsect . 619.Cm removable 620is set for removable media drives, but no current 621.Dx 622driver evaluates this 623flag. 624.Cm ecc 625is no longer supported; 626.Cm badsect 627specifies that the drive can perform bad sector remapping. 628.It Ar sectors/unit 629describes the total size of the disk. 630This value must be correct. 631.It Ar "the partition table" 632is the 633.Ux 634partition table, not the 635.Tn DOS 636partition table described in 637.Xr fdisk 8 . 638.El 639.Pp 640The partition table can have up to 16 entries. 641It contains the following information: 642.Bl -tag -width indent 643.It Ar # 644The partition identifier is a single letter in the range 645.Ql a 646to 647.Ql h . 648By convention, partition 649.Ql c 650is reserved to describe the entire disk. 651.It Ar size 652The size of the partition in sectors, 653.Cm K 654(kilobytes - 1024), 655.Cm M 656(megabytes - 1024*1024), 657.Cm G 658(gigabytes - 1024*1024*1024), 659.Cm % 660(percentage of free space 661.Em after 662removing any fixed-size partitions other than partition 663.Ql c ) , 664or 665.Cm * 666(all remaining free space 667.Em after 668fixed-size and percentage partitions). 669For partition 670.Ql c , 671a size of 672.Cm * 673indicates the entire disk. 674Lowercase versions of 675.Cm K , M , 676and 677.Cm G 678are allowed. 679Size and type should be specified without any spaces between them. 680.Pp 681Example: 2097152, 1G, 1024M and 1048576K are all the same size 682(assuming 512-byte sectors). 683.It Ar offset 684The offset of the start of the partition from the beginning of the 685drive in sectors, or 686.Cm * 687to have 688.Nm 689calculate the correct offset to use (the end of the previous partition plus 690one, ignoring partition 691.Ql c . 692For partition 693.Ql c , 694.Cm * 695will be interpreted as an offset of 0. 696.It Ar fstype 697Describes the purpose of the partition. 698The example shows all currently used partition types. 699For 700.Tn UFS 701file systems and 702.Xr ccd 4 703partitions, use type 704.Cm 4.2BSD . 705For Vinum drives, use type 706.Cm vinum . 707Other common types are 708.Cm swap 709and 710.Cm unused . 711By convention, partition 712.Ql c 713represents the entire slice and should be of type 714.Cm unused , 715though 716.Nm 717does not enforce this convention. 718The 719.Nm 720utility 721also knows about a number of other partition types, 722none of which are in current use. 723(See the definitions starting with 724.Dv FS_UNUSED 725in 726.In sys/disklabel64.h 727for more details). 728.El 729.Sh EXAMPLES 730.Dl "disklabel64 da0s1" 731.Pp 732Display the in-core label for the first slice of the 733.Pa da0 734disk, as obtained via 735.Pa /dev/da0s1 . 736(If the disk is 737.Dq dangerously-dedicated , 738the base disk name should be specified, such as 739.Pa da0 . ) 740.Pp 741.Dl "disklabel64 da0s1 > savedlabel" 742.Pp 743Save the in-core label for 744.Pa da0s1 745into the file 746.Pa savedlabel . 747This file can be used with the 748.Fl R 749option to restore the label at a later date. 750.Pp 751.Dl "disklabel64 -w -r /dev/da0s1 da2212 foo" 752.Pp 753Create a label for 754.Pa da0s1 755based on information for 756.Dq da2212 757found in 758.Pa /etc/disktab . 759Any existing bootstrap code will be clobbered 760and the disk rendered unbootable. 761.Pp 762.Dl "disklabel64 -e -r da0s1" 763.Pp 764Read the on-disk label for 765.Pa da0s1 , 766edit it, and reinstall in-core as well as on-disk. 767Existing bootstrap code is unaffected. 768.Pp 769.Dl "disklabel64 -e -r -n da0s1" 770.Pp 771Read the on-disk label for 772.Pa da0s1 , 773edit it, and display what the new label would be (in sectors). 774It does 775.Em not 776install the new label either in-core or on-disk. 777.Pp 778.Dl "disklabel64 -r -w da0s1 auto" 779.Pp 780Try to auto-detect the required information from 781.Pa da0s1 , 782and write a new label to the disk. 783Use another 784.Nm Fl e 785command to edit the 786partitioning and file system information. 787.Pp 788.Dl "disklabel64 -R da0s1 savedlabel" 789.Pp 790Restore the on-disk and in-core label for 791.Pa da0s1 792from information in 793.Pa savedlabel . 794Existing bootstrap code is unaffected. 795.Pp 796.Dl "disklabel64 -R -n da0s1 label_layout" 797.Pp 798Display what the label would be for 799.Pa da0s1 800using the partition layout in 801.Pa label_layout . 802This is useful for determining how much space would be allotted for various 803partitions with a labelling scheme using 804.Cm % Ns -based 805or 806.Cm * 807partition sizes. 808.Pp 809.Dl disklabel64 -B da0s1 810.Pp 811Install a new bootstrap on 812.Pa da0s1 . 813The boot code comes from 814.Pa /boot/boot1 815and possibly 816.Pa /boot/boot2 . 817On-disk and in-core labels are unchanged. 818.Pp 819.Dl disklabel64 -w -B /dev/da0s1 -b newboot1 -s newboot2 da2212 820.Pp 821Install a new label and bootstrap. 822The label is derived from disktab information for 823.Dq da2212 824and installed both in-core and on-disk. 825The bootstrap code comes from the files 826.Pa /boot/newboot1 827and 828.Pa /boot/newboot2 . 829.Pp 830.Dl dd if=/dev/zero of=/dev/da0 bs=512 count=32 831.Dl fdisk -BI da0 832.Dl dd if=/dev/zero of=/dev/da0s1 bs=512 count=32 833.Dl disklabel64 -w -B da0s1 auto 834.Dl disklabel64 -e da0s1 835.Pp 836Completely wipe any prior information on the disk, creating a new bootable 837disk with a DOS partition table containing one 838.Dq whole-disk 839slice. 840Then 841initialize the slice, then edit it to your needs. 842The 843.Pa dd 844commands are optional, but may be necessary for some BIOSes to properly 845recognize the disk. 846.Pp 847This is an example disklabel that uses some of the new partition size types 848such as 849.Cm % , M , G , 850and 851.Cm * , 852which could be used as a source file for 853.Pp 854.Dl disklabel64 -R ad0s1c new_label_file 855.Bd -literal -offset 4n 856# /dev/ad0s1c: 857type: ESDI 858disk: ad0s1 859label: 860flags: 861bytes/sector: 512 862sectors/track: 63 863tracks/cylinder: 16 864sectors/cylinder: 1008 865cylinders: 40633 866sectors/unit: 40959009 867rpm: 3600 868interleave: 1 869trackskew: 0 870cylinderskew: 0 871headswitch: 0 # milliseconds 872track-to-track seek: 0 # milliseconds 873drivedata: 0 874 87516 partitions: 876# size offset fstype 877 a: 400M 0 4.2BSD 878 b: 1G * swap 879 c: * * unused 880 e: 204800 * 4.2BSD 881 f: 5g * 4.2BSD 882 g: * * 4.2BSD 883.Ed 884.Sh DIAGNOSTICS 885The kernel device drivers will not allow the size of a disk partition 886to be decreased or the offset of a partition to be changed while it is open. 887Some device drivers create a label containing only a single large partition 888if a disk is unlabeled; thus, the label must be written to the 889.Dq a 890partition of the disk while it is open. 891This sometimes requires the desired 892label to be set in two steps, the first one creating at least one other 893partition, and the second setting the label on the new partition while shrinking 894the 895.Dq a 896partition. 897.Pp 898On some machines the bootstrap code may not fit entirely in the area 899allocated for it by some file systems. 900As a result, it may not be possible to have file systems on some partitions 901of a 902.Dq bootable 903disk. 904When installing bootstrap code, 905.Nm 906checks for these cases. 907If the installed boot code would overlap a partition of type 908.Dv FS_UNUSED 909it is marked as type 910.Dv FS_BOOT . 911The 912.Xr newfs 8 913utility will disallow creation of file systems on 914.Dv FS_BOOT 915partitions. 916Conversely, if a partition has a type other than 917.Dv FS_UNUSED 918or 919.Dv FS_BOOT , 920.Nm 921will not install bootstrap code that overlaps it. 922.Sh SEE ALSO 923.Xr ccd 4 , 924.Xr disklabel64 5 , 925.Xr disktab 5 , 926.Xr boot0cfg 8 , 927.Xr diskinfo 8 , 928.Xr disklabel 8 , 929.Xr fdisk 8 , 930.Xr vinum 8 931.Sh BUGS 932When a disk name is given without a full pathname, 933the constructed device name uses the 934.Dq c 935partition. 936.Pp 937For the i386 architecture, the primary bootstrap sector contains 938an embedded 939.Em fdisk 940table. 941The 942.Nm 943utility takes care to not clobber it when installing a bootstrap only 944.Pq Fl B , 945or when editing an existing label 946.Pq Fl e , 947but it unconditionally writes the primary bootstrap program onto 948the disk for 949.Fl w 950or 951.Fl R , 952thus replacing the 953.Em fdisk 954table by the dummy one in the bootstrap program. 955This is only of 956concern if the disk is fully dedicated, so that the 957.Bx 958disklabel 959starts at absolute block 0 on the disk. 960.Pp 961The 962.Nm 963utility 964does not perform all possible error checking. 965Warning *is* given if partitions 966overlap; if an absolute offset does not match the expected offset; if the 967.Dq c 968partition does not start at 0 or does not cover the entire slice; if a 969partition runs past the end of the device; and a number of other errors; but 970no warning is given if space remains unused. 971