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
42 .Sh IMPLEMENTATION NOTES
43 The GPT standard allows a variable number of partitions, but
45 only boots from tables with 128 partitions or less.
46 .Sh PARTITION ATTRIBUTES
48 checks and manages several attributes of GPT UFS partitions.
49 .Bl -tag -width ".Cm bootfailed"
51 Attempt to boot from this partition.
52 If more than one partition has the
56 will attempt to boot each one until successful.
58 Attempt to boot from this partition only one time.
59 Setting this attribute with
61 automatically also sets the
64 Multiple partitions may have the
72 attribute marks partitions that had the
74 attribute set, but failed to boot.
75 This attribute is managed by the system.
79 .Sx "POST-BOOT ACTIONS"
83 For normal usage, the user does not have to set or manage any of the
86 will boot from the first UFS partition found.
90 attribute can be used for testing an upgraded operating system on
91 an already-working computer.
92 The existing system partition is left untouched, and the new version
93 of the operating system to be tested is installed on another partition.
96 attribute is set on that new test partition.
97 The next boot is attempted from the test partition.
98 Success or failure will be shown in the system log files.
99 After a successful boot of the test partition, a user script can check
100 the logs and change the
102 attributes so the test partition becomes the new system partition.
105 attribute is cleared after an attempted boot, a failed boot will not
106 leave the system attempting to boot from a partition that will never
108 Instead, the system will boot from the older, known-working operating
109 system that has not been modified.
112 attribute is set on any partitions, booting will be attempted from them
114 If no partitions with
116 attributes are found, booting will be attempted from the first UFS
120 first reads the partition table.
123 partitions with only the
125 attribute set, indicating a failed boot, are set to
128 then scans through all of the
131 Boot behavior depends on the combination of
135 attributes set on those partitions.
136 .Bl -tag -width ".Cm bootonce + .Cm bootme"
137 .It Cm bootonce + Cm bootme
138 Highest priority: booting is attempted from each of the
140 partitions with both of these attributes.
141 On each partition, the
143 attribute is removed and the boot attempted.
145 Middle priority: booting is attempted from each of the
156 attributes are found on any partitions, booting is attempted from the
159 partition on the disk.
160 .Sh POST-BOOT ACTIONS
162 .Pa /etc/rc.d/gptboot
163 checks the attributes of
165 partitions on all GPT disks.
169 .Dq boot from X failed
171 Partitions with only the
173 attribute, indicating a partition that successfully booted, generate a
174 .Dq boot from X succeeded
178 attributes are cleared from all the partitions.
181 attribute is cleared from the partition that successfully booted.
182 There is normally only one of these.
184 .Bl -tag -width /boot/gptboot -compact
188 parameters for the boot blocks
195 partition, usually the first partition on the disk.
202 is typically installed in combination with
210 .Bd -literal -offset indent
211 gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
215 can also be installed without the PMBR:
216 .Bd -literal -offset indent
217 gpart bootcode -p /boot/gptboot -i 1 ada0
222 attribute for partition 2:
223 .Bd -literal -offset indent
224 gpart set -a bootme -i 2 ada0
229 attribute for partition 2, automatically also setting the
232 .Bd -literal -offset indent
233 gpart set -a bootonce -i 2 ada0
242 appeared in FreeBSD 7.1.
244 This manual page written by
245 .An Warren Block Aq wblock@FreeBSD.org .