xref: /netbsd-src/share/man/man8/man8.x86/boot.8 (revision d90047b5d07facf36e6c01dcc0bded8997ce9cc2)
1.\"	$NetBSD: boot.8,v 1.21 2020/07/15 12:38:30 kim Exp $
2.\"
3.\" Copyright (c) 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" This code is derived from software written and contributed
7.\" to Berkeley by William Jolitz.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors
18.\"    may be used to endorse or promote products derived from this software
19.\"    without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\"     @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
34.\"
35.Dd July 15, 2020
36.Dt BOOT 8 x86
37.Os
38.Sh NAME
39.Nm boot
40.Nd
41system bootstrapping procedures
42.Sh DESCRIPTION
43Intel Architecture, 32-bit (IA-32) computers (the
44.Tn IBM PC
45and its clones)
46that can run
47.Nx Ns /i386
48or
49.Nx Ns /amd64
50can use any of the following boot procedures, depending on what the hardware and
51.Tn BIOS
52support:
53.Bl -tag -width "x86/pxeboot(8)"
54.It boot
55bootstrap
56.Nx
57from the system
58.Tn BIOS
59.It efiboot
60bootstrap
61.Nx
62from the system
63.Tn UEFI
64.It Xr x86/dosboot 8
65bootstrap
66.Nx
67from
68.Tn MS-DOS
69.It Xr x86/pxeboot 8
70network bootstrap
71.Nx
72from a
73.Tn TCP/IP
74.Tn LAN
75with
76.Tn DHCP ,
77.Tn TFTP ,
78and
79.Tn NFS .
80.El
81.Ss Power fail and crash recovery
82Normally, the system will reboot itself at power-up or after crashes.
83An automatic consistency check of the file systems will be performed,
84and unless this fails, the system will resume multi-user operations.
85.Ss Cold starts
86The 386
87.Tn "PC AT"
88clones attempt to boot the floppy disk drive A (otherwise known as drive
890) first, and failing that, attempt to boot the hard disk C (otherwise
90known as hard disk controller 1, drive 0).
91The
92.Nx
93bootblocks are loaded and started either by the
94.Tn BIOS ,
95or by a boot selector program (such as OS-BS, BOOTEASY, the OS/2 Boot Menu or
96.Nx Ns 's
97.No boot-selecting
98master boot record - see
99.Xr x86/mbr 8 ) .
100.Ss Normal Operation
101Once running, a banner similar to the following will appear:
102.Bd -unfilled -offset indent
103>> NetBSD BIOS Boot, revision 3.0
104>> (user@buildhost, builddate)
105>> Memory: 637/15360 k
106Press return to boot now, any other key for boot menu
107booting hd0a:netbsd - starting in 5
108.Ed
109.Pp
110After a countdown, the system image listed will be loaded.
111In the example above, it will be
112.Dq Li hd0a:netbsd
113which is the file
114.Pa /netbsd
115on partition
116.Dq a
117of the
118.Nx
119.Tn MBR
120partition of the first hard disk known to the
121.Tn BIOS
122.Po
123which is an
124.Tn IDE
125or similar device - see the
126.Sx BUGS
127section
128.Pc .
129.Pp
130Pressing a key within the time limit, or before the boot program starts, will
131enter interactive mode.
132When using a short or 0 timeout, it is often useful to interrupt the boot
133by holding down a shift key, as some BIOSes and BIOS extensions will drain the
134keystroke buffer at various points during POST.
135.Pp
136If present, the file
137.Pa /boot.cfg
138will be used to configure the behaviour of the boot loader including
139setting the timeout, choosing a console device, altering the banner
140text and displaying a menu allowing boot commands to be easily chosen.
141See
142.Xr boot.cfg 5 .
143.Ss Boot Protocol
144The
145.Nx Ns /x86
146boot loader can boot a kernel using either the native
147.Nx
148boot protocol, or the
149.Dq multiboot
150protocol (which is compatible with some other operating systems).
151In the native
152.Nx
153boot protocol, options are passed from the boot loader
154to the kernel via flag bits in the
155.Va boothowto
156variable (see
157.Xr boothowto 9 ) .
158In the multiboot protocol, options are passed from the boot loader
159to the kernel as strings.
160.Ss Diagnostic Output
161If the first stage boot fails to load the boot, it will print a terse
162message indicating the reason for the failure.
163The possible error messages and their cause are listed in
164.Xr x86/mbr 8 .
165.Pp
166If the first stage boot succeeds, the banner will be shown and the
167error messages should be self-explanatory.
168.Ss Interactive mode
169In interactive mode, the boot loader will present a prompt, allowing
170input of these commands:
171.\" NOTE: much of this text is duplicated in the MI boot.8.
172.\" Some of it is
173.\" also duplicated in the x86-specific x86/dosboot.8 and x86/pxeboot.8;
174.\" please try to keep all relevant files synchronized.
175.Bl -tag -width 04n -offset 04n
176.It Ic boot Oo Va device : Oc Ns Oo Va filename Oc Oo Fl 1234abcdmqsvxz Oc
177The default
178.Va device
179will be set to the disk from which the boot loader was loaded.
180The partition is set to the first match in this list:
181.Bl -enum -compact
182.It
183The first
184.Xr gpt 8
185partition with the
186.Va bootme
187attribute set.
188.It
189The partition from which the boot loader was loaded from, if that
190can be detected.
191.It
192The first partition with a file system that could be bootable.
193.It
194The first partition.
195.El
196To boot from an alternate disk, the full name of the device should
197be given at the prompt.
198.Va device
199is of the form
200.Va NAME=partition_label
201when booting from a
202.Xr gpt 8
203partitioned disk.
204Otherwise, the syntax is
205.Xo Va xd
206.Op Va N Ns Op Va x
207.Xc
208where
209.Va xd
210is the device from which to boot,
211.Va N
212is the unit number, and
213.Va x
214is the partition letter.
215.Pp
216In the later case, the following list of supported devices may
217vary from installation to installation:
218.Pp
219.Bl -hang -compact
220.It hd
221Hard disks as numbered by the BIOS.
222This includes ST506, IDE, ESDI, RLL disks on a WD100[2367] or
223lookalike controller(s), and SCSI disks
224on SCSI controllers recognized by the BIOS.
225.It fd
226Floppy drives as numbered by the BIOS.
227.It cd
228CD-ROM drives as numbered by the BIOS.
229.It raid
230RAIDframe configured from hard disks recognized by the BIOS.
231Only RAID level 1 sets are supported by bootstrap code.
232If the RAID is partitioned, the first partition is used, or the
233first
234.Xr gpt 8
235partition that has the
236.Va bootme
237attribute set.
238Inner RAIDframe partitions can also be given to the
239.Ic dev
240command using he
241.Va NAME=partition_label
242syntax.
243.El
244.Pp
245The default
246.Va filename
247is
248.Pa netbsd ;
249if the boot loader fails to successfully
250open that image, it then tries
251.Pa netbsd.gz
252(expected to be a kernel image compressed by gzip), followed by
253.Pa onetbsd ,
254.Pa onetbsd.gz ,
255.Pa netbsd.old ,
256and finally
257.Pa netbsd.old.gz .
258Alternate system images can be loaded by just specifying the name of the image.
259.Pp
260Options are:
261.Bl -tag -width xxx
262.It Fl 1
263Sets the machine-dependent flag
264.Sy RB_MD1
265in
266.Va boothowto .
267In
268.Nx Ns /x86 ,
269this disables multiprocessor boot;
270the kernel will boot in uniprocessor mode.
271.It Fl 2
272Sets the machine-dependent flag
273.Sy RB_MD2
274in
275.Va boothowto .
276In
277.Nx Ns /x86 ,
278this disables ACPI.
279.It Fl 3
280Sets the machine-dependent flag
281.Sy RB_MD3
282in
283.Va boothowto .
284In
285.Nx Ns /amd64 ,
286this disables SVS.
287.It Fl 4
288Sets the machine-dependent flag
289.Sy RB_MD4
290in
291.Va boothowto .
292In
293.Nx Ns /x86 ,
294this has no effect.
295.It Fl a
296Sets the
297.Sy RB_ASKNAME
298flag in
299.Va boothowto .
300This causes the kernel to prompt for the root file system device,
301the system crash dump device, and the path to
302.Xr init 8 .
303.It Fl b
304Sets the
305.Sy RB_HALT
306flag in
307.Va boothowto .
308This causes subsequent reboot attempts to halt instead of rebooting.
309.It Fl c
310Sets the
311.Sy RB_USERCONF
312flag in
313.Va boothowto .
314This causes the kernel to enter the
315.Xr userconf 4
316device configuration manager as soon as possible during the boot.
317.Xr userconf 4
318allows devices to be enabled or disabled, and allows device locators
319(such as hardware addresses or bus numbers)
320to be modified before the kernel attempts to attach the devices.
321.It Fl d
322Sets the
323.Sy RB_KDB
324flag in
325.Va boothowto .
326Requests the kernel to enter debug mode, in which it
327waits for a connection from a kernel debugger; see
328.Xr ddb 4 .
329.It Fl m
330Sets the
331.Sy RB_MINIROOT
332flag in
333.Va boothowto .
334Informs the kernel that a mini-root file system is present in memory.
335.It Fl q
336Sets the
337.Sy AB_QUIET
338flag in
339.Va boothowto .
340Boot the system in quiet mode.
341.It Fl s
342Sets the
343.Sy RB_SINGLE
344flag in
345.Va boothowto .
346Boot the system in single-user mode.
347.It Fl v
348Sets the
349.Sy AB_VERBOSE
350flag in
351.Va boothowto .
352Boot the system in verbose mode.
353.It Fl x
354Sets the
355.Sy AB_DEBUG
356flag in
357.Va boothowto .
358Boot the system with debug messages enabled.
359.It Fl z
360Sets the
361.Sy AB_SILENT
362flag in
363.Va boothowto .
364Boot the system in silent mode.
365.El
366.It Ic consdev Va dev Ns Oo Ns , Ns Va speed Oc
367Immediately switch the console to the specified device
368.Va dev
369and reprint the banner.
370.Va dev
371must be one of
372.\" .Bl -item -width com[0123]kbd -offset indent -compact
373.Ar pc , com0 , com1 , com2 ,
374.Ar com3 , com0kbd , com1kbd , com2kbd ,
375.Ar com3kbd ,
376or
377.Ar auto .
378See
379.Sx Console Selection Policy
380in
381.Xr x86/boot_console 8 .
382.Pp
383A
384.Va speed
385for the serial port is optional and defaults to 9600.
386If a value of zero is specified, then the current baud rate (set by the
387BIOS) will be used.
388Setting the
389.Va speed
390with the
391.Ar pc
392device is not possible.
393.It Ic dev Op Va device
394Set the default drive and partition for subsequent file system
395operations.
396Without an argument, print the current setting.
397.Va device
398is of the form specified in
399.Cm boot .
400.It Ic fs Va file
401Load a file system image from the specified
402.Ar file ,
403and request the kernel to use it as the root file system.
404The
405.Xr makefs 8
406utility may be used to create suitable file system images.
407.It Ic help
408Print an overview about commands and arguments.
409.It Ic load Va module Op Ar arguments
410Load the specified kernel
411.Va module ,
412and pass it the specified
413.Ar arguments .
414If the module name is not an absolute path,
415.Pa /stand/ Xo Ns
416.Aq Sy arch Ns
417.Pa / Ns
418.Aq Sy osversion Ns
419.Pa /modules/ Ns
420.Aq Sy module Ns
421.Pa / Ns
422.Aq Sy module Ns
423.Pa .kmod
424.Xc
425is used.
426Possible uses of the
427.Ic load
428command include loading a memory disk image before booting a kernel,
429or loading a
430.Tn Xen
431DOM0 kernel before booting the
432.Tn Xen
433hypervisor.
434See
435.Xr boot.cfg 5
436for examples.
437.Pp
438In addition to the
439.Cm boot
440options specified above, the
441.Tn Xen
442DOM0 kernel accepts
443.Po Ar arguments
444being separated with spaces
445.Pc :
446.Bl -tag -width xxx
447.It Ic bootdev Ns = Ns Ar dev Po or Ic root Ns = Ns Ar dev Pc
448Override the default boot device.
449.Ar dev
450is of the form
451.Va NAME=partition_label
452for
453.Xr gpt 8
454partitioned disks.
455It can also be a unit name
456.Po Dq wd0
457.Pc ,
458or an interface name
459.Po Dq bge0 ,
460.Dq wm0 ,
461\&...
462.Pc
463for cases where the root file system has to be loaded
464from network (see the
465.Sx BUGS
466section in
467.Xr x86/pxeboot 8 ) .
468.It Ic console Ns = Ns Ar dev
469Console used by DOM0 kernel during boot.
470.Ar dev
471accepts the same values as the ones given for the
472.Cm consdev
473command.
474See
475.Sx Console Selection Policy
476in
477.Xr x86/boot_console 8 .
478.It Xo Ic ip Ns = Ns
479.Ar my_ip : Ns Ar serv_ip : Ns Ar gw_ip : Ns
480.Ar mask : Ns Ar host : Ns Ar iface
481.Xc
482Specify various parameters for a network boot (IPs are in
483dot notation),
484each one separated by a colon:
485.Bl -tag -width xxxxxxx
486.It Va my_ip
487address of the host
488.It Va serv_ip
489address of the NFS server
490.It Va gw_ip
491address of the gateway
492.It Va mask
493network mask
494.It Va host
495address of the host
496.It Va iface
497interface
498.Po e.g., Dq xennet0
499or
500.Dq eth0
501.Pc
502.El
503.It Ic nfsroot Ns = Ns Ar address : Ns Ar rootpath
504Boot the system with root on NFS.
505.Ar address
506is the address of the NFS server, and
507.Ar rootpath
508is the remote mount point for the root file system.
509.It Ic pciback.hide Ns = Ns Ar pcidevs
510Pass a list of PCI IDs for use with the PCI backend driver,
511.Xr pciback 4 .
512.Ar pcidevs
513is formed of multiple IDs (in bus:device.function notation),
514each ID being surrounded with brackets.
515PCI domain IDs are currently ignored.
516See
517.Xr pciback 4 .
518.El
519.It Ic ls Op Pa path
520Print a directory listing of
521.Pa path ,
522containing inode number, filename, and file type.
523.Pa path
524can contain a device specification.
525.It Ic menu
526Display the boot menu and initiate a countdown,
527similarly to what would have happened if interactive mode
528had not been entered.
529.It Ic modules Bro Ar on | off | enabled | disabled Brc
530The values
531.Ar enabled , on
532will enable module loading for
533.Cm boot
534and
535.Cm multiboot ,
536whereas
537.Ar disabled , off
538will turn off the feature.
539.It Ic multiboot Va kernel Op Ar arguments
540Boot the specified
541.Va kernel ,
542using the
543.Dq multiboot
544protocol instead of the native
545.Nx
546boot protocol.
547The
548.Va kernel
549is specified in the same way as with the
550.Ic boot
551command.
552.Pp
553The multiboot protocol may be used in the following cases:
554.Bl -tag -width indent
555.It Nx Ns / Ns  Xen No kernels
556The
557.Tn Xen
558DOM0 kernel must be loaded as a module using the
559.Ic load
560command, and the
561.Tn Xen
562hypervisor must be booted using the
563.Ic multiboot
564command.
565Options for the DOM0 kernel (such as
566.Dq -s
567for single user mode) must be passed as options to the
568.Ic load
569command.
570Options for the hypervisor (such as
571.Dq dom0_mem=256M
572to reserve 256 MB of memory for DOM0)
573must be passed as options to the
574.Ic multiboot
575command.
576See
577.Xr boot.cfg 5
578for examples on how to boot
579.Nx Ns / Ns  Xen.
580.It Nx No multiboot kernels
581A
582.Nx
583kernel that was built with
584.Cd options MULTIBOOT
585(see
586.Xr x86/multiboot 8 )
587may be booted with either the
588.Ic boot
589or
590.Ic multiboot
591command, passing the same
592.Ar arguments
593in either case.
594.It Non- Ns Nx No kernels
595A kernel for a
596.No non- Ns Nx
597operating system that expects to be booted using the
598multiboot protocol (such as by the GNU
599.Dq GRUB
600boot loader)
601may be booted using the
602.Ic multiboot
603command.
604See the foreign operating system's documentation for the available
605.Ar arguments .
606.El
607.It Ic quit
608Reboot the system.
609.It Ic rndseed Ar file
610Load the specified
611.Ar file
612and request the kernel to use it as a seed for the
613.Xr rnd 4
614random number generator.
615The
616.Ar file
617should be in the private format used by
618.Xr rndctl 8 ,
619and should have been saved by
620.Ql "rndctl -S"
621shortly before the previous shutdown.
622See the
623.Va random_seed
624and
625.Va random_file
626variables in
627.Xr rc.conf 5 ,
628and the
629.Pa /etc/rc.d/random_seed
630script, for a way to manage the seed file.
631Using the same seed file on more then one host,
632or for more than one boot on the same host,
633will reduce the quality of random numbers
634and may impact system security.
635.It Ic userconf Va command
636Pass command
637.Va command
638to
639.Xr userconf 4
640at boot time.
641These commands are processed before the interactive
642.Xr userconf 4
643shell is executed, if requested.
644.It Ic splash Ar file
645Load a graphical image from the specified
646.Ar file
647and request the kernel to use it as a splash screen.
648The
649.Ar file
650should contain an image in one of these formats:
651JPEG (baseline only, not progressive),
652PNG (8-bit only),
653TGA,
654BMP (non-1bpp, non-RLE),
655GIF,
656PSD (composited view only),
657or
658PIC.
659.It Ic vesa Bro Va modenum | Ar on | off | enabled | disabled | list Brc
660Initialise the video card to the specified resolution and bit depth.
661The
662.Va modenum
663should be in the form of
664.Ar 0x100 , 800x600 , 800x600x32 .
665The values
666.Ar enabled , on
667put the display into the default mode, and
668.Ar disabled , off
669returns the display into standard vga mode.
670The value
671.Ar list
672lists all supported modes.
673.El
674.Pp
675In an emergency, the bootstrap methods described in the
676.Nx
677installation notes for the x86 architectures
678can be used to boot from floppy or other media,
679or over the network.
680.Ss Locating the root file system
681The kernel uses information from the bootloader to locate the
682file system to mount as root.
683There are three methods:
684.Bl -tag -width 04n -offset 04n
685.It Ic BTINFO_ROOTDEVICE Va from
686.Xr boot.cfg 5
687or multiboot.
688The bootloader passes the root device name as driver, unit, and
689partition (like sd0a).
690This will be automatically substituted by a
691.Xr dk 4
692wedge if one is discovered.
693.Pp
694The bootloader passes a wedge name as "wedge:" followed by the name.
695The kernel will search for a
696.Xr dk 4
697device with that name.
698.It Ic BTINFO_BOOTWEDGE Va determined by bootblock
699The bootloader passes start offset and length of a hard disk partition
700and a offset, size and hash of a "boot area".
701Then kernel searches
702all disks and wedges for a block sequence at that offset with a
703matching hash.
704If one is found, the kernel will look for a wedge
705on that device at the same offset.
706.Pp
707An additional partition number is provided if the bootloader also
708passed a BTINFO_BOOTDISK record.
709This (or partition 'a') will be used
710by the kernel as a fallback if there is no matching wedge.
711.It Ic BTINFO_BOOTDISK Va determined by bootblock
712This uses the device number passed by the BIOS that
713distinguishes between floppy, hard drive and CD-ROM boot.
714.Bl -tag -width xxx
715.It Ic Floppy
716The kernel searches for the
717.Xr fd 4
718device with the correct unit, the partition number is used
719to select a specific disk format.
720See
721.Xr fd 4
722for details.
723.It Ic Hard drive
724The bootloader passed a partition number and disklabel
725data (offset, type, checksum, packname).
726The kernel searches
727all disks for a matching disklabel.
728If one is found, the
729kernel will use that device and partition number.
730.It Ic CDROM
731The BIOS does not distinguish between multiple CD devices.
732The kernel searches for the first
733.Xr cd 4
734device.
735So you can only boot from unit 0.
736.El
737.El
738.Sh FILES
739.Bl -tag -width /usr/mdec/bootxx_fstype -compact
740.It Pa /boot
741boot program code loaded by the primary bootstrap
742.It Pa /boot.cfg
743optional configuration file
744.It Pa /netbsd
745system code
746.It Pa /netbsd.gz
747gzip-compressed system code
748.It Pa /usr/mdec/boot
749master copy of the boot program (copy to /boot)
750.It Pa /usr/mdec/bootxx_fstype
751primary bootstrap for file system type fstype, copied to the start of
752the
753.Nx
754partition by
755.Xr installboot 8 .
756.It Pa /usr/mdec/bootia32.efi
757.It Pa /usr/mdec/bootx64.efi
758.Tn UEFI
759bootstraps for
760.Nx Ns /i386
761and
762.Nx Ns /amd64 ,
763which should be copied to the
764.Pa /efi/boot
765directory in a
766.Tn FAT
767formatted partition of type
768.Tn EFI
769(Either
770.Xr mbr 8
771and
772.Xr gpt 8 ,
773see the
774.Sx BUGS
775section).
776.Nx
777.Tn UEFI
778bootstrap reads its configuration from the
779.Pa /efi/netBSD/boot.cfg
780file in the
781.Tn EFI
782partition.
783.El
784.Sh SEE ALSO
785.Xr ddb 4 ,
786.Xr fd 4 ,
787.Xr pciback 4 ,
788.Xr userconf 4 ,
789.Xr boot.cfg 5 ,
790.Xr halt 8 ,
791.Xr installboot 8 ,
792.Xr reboot 8 ,
793.Xr rescue 8 ,
794.Xr shutdown 8 ,
795.Xr x86/boot_console 8 ,
796.Xr x86/dosboot 8 ,
797.Xr x86/mbr 8 ,
798.Xr x86/multiboot 8 ,
799.Xr x86/pxeboot 8 ,
800.Xr boothowto 9
801.Sh BUGS
802The kernel file name must be specified before, not after, the boot options.
803Any
804.Ar filename
805specified after the boot options, e.g.:
806.Pp
807.Bd -unfilled -offset indent -compact
808.Cm boot -d netbsd.test
809.Ed
810.Pp
811is ignored, and the default kernel is booted.
812.Pp
813Hard disks are always accessed by
814.Tn BIOS
815functions.
816Unit numbers are
817.Tn BIOS
818device numbers which might differ from numbering in the
819.Nx
820kernel or physical parameters
821.Po
822e.g.,
823.Tn SCSI
824slave numbers
825.Pc .
826There isn't any distinction between
827.Dq sd
828and
829.Dq wd
830devices at the bootloader level.
831This is less a bug of the bootloader code than
832a shortcoming of the PC architecture.
833The default disk device's name printed in the starting message
834is derived from the
835.Dq type
836field of the
837.Nx
838disklabel (if it is a hard disk).
839.Pp
840.Tn UEFI
841implementation are supposed to support either
842.Xr mbr 8
843or
844.Xr gpt 8
845partitionning, but some do not handle the later.
846.Tn UEFI
847Booting
848from a
849.Xr gpt 8
850partitioned disk is still possible in this case, by adding
851an overlapping
852.Tn EFI
853partition in the protective
854.Xr mbr 8
855block.
856This can be achieved using the following commands
857(you must adapt the hard disk and
858.Tn EFI
859partition start end size to fit your setup):
860.Dl Ic dd if=/dev/rwd0d bs=512 count=1 of=mbr
861.Dl Ic fdisk -FIfaui1s 4/34/32768 -c /usr/mdec/mbr mbr
862.Dl Ic dd if=mbr bs=512 count=1 of=/dev/rwd0d conv=notrunc
863The resulting
864.Xr mbr 8
865partition table will look like this:
866.Bd -unfilled -offset indent
8670: GPT Protective MBR (sysid 238)
868    start 1, size 2097151 (1024 MB, Cyls 0-130/138/8)
869        PBR is not bootable: Bad magic number (0x0000)
8701: Primary DOS with 16 bit FAT <32M (sysid 4)
871    start 34, size 32768 (16 MB, Cyls 0/0/35-2/10/42), Active
8722: <UNUSED>
8733: <UNUSED>
874.Ed
875