1 .\" Copyright (c) 2013 Warren Block
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd GPT bootcode for UFS on BIOS-based computers
35 is used on BIOS-based computers to boot from a UFS partition on a
45 While conceptually similar, the details differ.
49 first reads the GPT and determines which drive and partition to
50 boot from, as described under
53 If it does not find an eligible partition, or if the user hits a
54 key within three seconds,
56 switches from auto-boot to interactive mode.
57 Interactive mode allows manual selection of the disk, partition,
58 filename, and boot option flags, as described in
60 .Sh IMPLEMENTATION NOTES
61 The GPT standard allows a variable number of partitions, but
63 only boots from tables with 128 partitions or less.
64 .Sh PARTITION ATTRIBUTES
66 checks and manages several attributes of GPT UFS partitions.
67 .Bl -tag -width ".Cm bootfailed"
69 Attempt to boot from this partition.
70 If more than one partition has the
74 will attempt to boot each one until successful.
76 Attempt to boot from this partition only one time.
77 Setting this attribute with
79 automatically also sets the
82 Multiple partitions may have the
90 attribute marks partitions that had the
92 attribute set, but failed to boot.
93 This attribute is managed by the system.
97 .Sx "POST-BOOT ACTIONS"
101 For normal usage, the user does not have to set or manage any of the
102 partition attributes.
104 will boot from the first UFS partition found.
108 attribute can be used for testing an upgraded operating system on
109 an already-working computer.
110 The existing system partition is left untouched, and the new version
111 of the operating system to be tested is installed on another partition.
114 attribute is set on that new test partition.
115 The next boot is attempted from the test partition.
116 Success or failure will be shown in the system log files.
117 After a successful boot of the test partition, a user script can check
118 the logs and change the
120 attributes so the test partition becomes the new system partition.
123 attribute is cleared after an attempted boot, a failed boot will not
124 leave the system attempting to boot from a partition that will never
126 Instead, the system will boot from the older, known-working operating
127 system that has not been modified.
130 attribute is set on any partitions, booting will be attempted from them
132 If no partitions with
134 attributes are found, booting will be attempted from the first UFS
138 first reads the partition table.
141 partitions with only the
143 attribute set, indicating a failed boot, are set to
146 then scans through all of the
149 Boot behavior depends on the combination of
153 attributes set on those partitions.
154 .Bl -tag -width ".Cm bootonce + .Cm bootme"
155 .It Cm bootonce + Cm bootme
156 Highest priority: booting is attempted from each of the
158 partitions with both of these attributes.
159 On each partition, the
161 attribute is removed and the boot attempted.
163 Middle priority: booting is attempted from each of the
174 attributes are found on any partitions, booting is attempted from the
177 partition on the disk.
178 .Sh POST-BOOT ACTIONS
180 .Pa /etc/rc.d/gptboot
181 checks the attributes of
183 partitions on all GPT disks.
187 .Dq boot from X failed
189 Partitions with only the
191 attribute, indicating a partition that successfully booted, generate a
192 .Dq boot from X succeeded
196 attributes are cleared from all the partitions.
199 attribute is cleared from the partition that successfully booted.
200 There is normally only one of these.
202 .Bl -tag -width /boot/gptboot -compact
206 parameters for the boot blocks
213 partition, usually the first partition on the disk.
220 is typically installed in combination with
228 .Bd -literal -offset indent
229 gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
233 can also be installed without the PMBR:
234 .Bd -literal -offset indent
235 gpart bootcode -p /boot/gptboot -i 1 ada0
240 attribute for partition 2:
241 .Bd -literal -offset indent
242 gpart set -a bootme -i 2 ada0
247 attribute for partition 2, automatically also setting the
250 .Bd -literal -offset indent
251 gpart set -a bootonce -i 2 ada0
263 This manual page was written by
264 .An Warren Block Aq wblock@FreeBSD.org .