Bug 157698 - [patch] gpart(8) man page contains old/incorrect size for /boot/gptboot
Summary: [patch] gpart(8) man page contains old/incorrect size for /boot/gptboot
Status: Closed Overcome By Events
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Guangyuan Yang
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-06-08 05:30 UTC by rsimmons0
Modified: 2018-11-23 04:24 UTC (History)
5 users (show)

See Also:


Attachments
file.txt (130 bytes, text/plain)
2011-06-08 05:30 UTC, rsimmons0
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rsimmons0 2011-06-08 05:30:05 UTC
In the gpart(8) man page under examples is the sentence: "A size of 15 blocks (7680 bytes) would be sufficient for booting from UFS but let's use 128 blocks (64 KB) here in this example, in order to reserve some space for potential future need (e.g. from a ZFS partition)."  This is incorrect (maybe because the size of /boot/gptboot has changed since the man page was written, or maybe it's an error).

The current size of gptboot is 13851 bytes:

#ls -l gptboot
-r--r--r--  1 root  0  13851 Feb 17 02:19 gptboot

13851/512 = 27.05 blocks

Rounding up, the minimum size for the freebsd-boot partition is 28 blocks.

Fix: So, the sentence in the man page should read: "A size of 28 blocks (14336 bytes) would be sufficient for booting from UFS but let's use 128 blocks (64 KB) here in this example, in order to reserve some space for potential future need (e.g. from a ZFS partition)."

Patch attached with submission follows:
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2012-05-04 05:18:15 UTC
Responsible Changed
From-To: freebsd-doc->eadler

I'll take it.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2012-09-02 04:09:08 UTC
Responsible Changed
From-To: eadler->freebsd-doc

I won't be looking at this PR for a while and I need to clear some out 
of my queue
Comment 3 Arrigo Marchiori 2015-09-24 07:17:20 UTC
Hello,

I found another bug in the gpart(8) man page and I am reporting it here instead of filing a new bug, because it only requires a small correction.
Please tell me if you need a separate bug report instead.

Among the examples:

> After creating all required partitions, embed bootstrap code into them:
>
>           /sbin/gpart bootcode -p /boot/boot1 da0

That command is not valid. Maybe the '-p' should be a '-b'?

# /sbin/gpart bootcode -p /boot/boot1 da0
gpart: missing -i option
Comment 4 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-09-24 07:32:22 UTC
> > After creating all required partitions, embed bootstrap code into them:
> >
> >           /sbin/gpart bootcode -p /boot/boot1 da0
> 
> That command is not valid. Maybe the '-p' should be a '-b'?
> 
> # /sbin/gpart bootcode -p /boot/boot1 da0
> gpart: missing -i option

This command is correct and applicably only for VTOC8 scheme.
Comment 5 Arrigo Marchiori 2015-09-24 07:52:10 UTC
(In reply to Andrey V. Elsukov from comment #4)

You are right, I am sorry for the noise.
Comment 6 Allan Jude freebsd_committer freebsd_triage 2018-11-23 04:24:55 UTC
(In reply to rsimmons0 from comment #0)
The 15 blocks is referring to /boot/boot2 (which is 7680 bytes). UFS doesn't use the first 15 blocks of the partition, and that is where we stuff boot2, which is loaded from boot1, which lives in the volume boot record, which itself is loaded by boot0 which lives in the master boot record. All of this only applies to MBR.


This advice has already been changed in the man page in 2012: https://svnweb.freebsd.org/base/head/lib/geom/part/gpart.8?r1=230058&r2=230059&