Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Bug 211361] suggested boot partition size is too small, bsdinstall creates unaligned partitions

9 views
Skip to first unread message

bugzilla...@freebsd.org

unread,
Jul 25, 2016, 3:52:04 AM7/25/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211361

Bug ID: 211361
Summary: suggested boot partition size is too small, bsdinstall
creates unaligned partitions
Product: Base System
Version: 11.0-STABLE
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: misc
Assignee: freebs...@FreeBSD.org
Reporter: d...@FreeBSD.org

The gpart(4) man page suggests creating a 44 kB boot partition. This was fine
for 9 and 10 where gptzfsboot is 42 kB, but 11's gptzfsboot is twice that size.
Users who followed that recommendation will not be able to install a new
gptzfsboot in their existing boot partition.

The man page should be updated, and the problem should probably be documented
in the release notes.

Standard operating procedure (i.e. what the gpart(4) man page recommends and
what bsdinstall does) is to place the swap partition immediately after the boot
partition, so it is possible to fix this issue on a live system (after
upgrading but before rebooting) by deleting the boot and swap partitions,
creating a new, appropriately sized boot partition, then creating a new,
slightly smaller swap partition. Here is an example for a two-disk system with
striped swap and either striped or mirrored ZFS:

# swapoff -a
# gpart delete -i 1 ada0
# gpart delete -i 2 ada0
# gpart add -b 40 -s $((512-40)) -t freebsd-boot -i 1 -l boot0 ada0
# gpart add -t freebsd-swap -l swap0 ada0
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
# gpart delete -i 1 ada1
# gpart delete -i 2 ada1
# gpart add -b 40 -s $((512-40)) -t freebsd-boot -i 1 -l boot1 ada1
# gpart add -t freebsd-swap -l swap1 ada1
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
# swapon -a

The point of $((512-40)) is that we want both the boot partition and the swap
partition that follows it to be aligned on (at least) 4096-byte boundaries.
The partition table is normally 34 sectors long (see `gpart list | grep
first`), so we round up to 40 and place the boot partition there, and the swap
partition at 512.

Note that bsdinstall creates an unaligned 512 kB boot partition, so all
subsequent partitions will be unaligned, which can cause serious performance
issues on "advanced format" drives. I recommend fixing this as well.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebs...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs...@freebsd.org"

bugzilla...@freebsd.org

unread,
Jul 25, 2016, 3:52:32 AM7/25/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211361

Dag-Erling Smørgrav <d...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Severity|Affects Some People |Affects Many People
Flags| |mfc-stable11?

bugzilla...@freebsd.org

unread,
Jul 25, 2016, 5:00:36 AM7/25/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211361

Kubilay Kocak <ko...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Keywords| |needs-patch, performance
Status|New |Open
CC| |r...@FreeBSD.org

bugzilla...@freebsd.org

unread,
Jul 25, 2016, 7:26:01 AM7/25/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211361

--- Comment #1 from commi...@freebsd.org ---
A commit references this bug:

Author: des
Date: Mon Jul 25 11:25:34 UTC 2016
New revision: 303289
URL: https://svnweb.freebsd.org/changeset/base/303289

Log:
Rewrite the GPT and MBR examples. For GPT, ensure that the boot partition
is large enough for gptzfsboot, which has doubled in size since 10.

PR: 211361
MFC after: 3 days

Changes:
head/sbin/geom/class/part/gpart.8

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 11:30:43 AM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211361

--- Comment #2 from commi...@freebsd.org ---
A commit references this bug:

Author: des
Date: Fri Aug 5 15:30:05 UTC 2016
New revision: 303769
URL: https://svnweb.freebsd.org/changeset/base/303769

Log:
MFH (r303289): update example section

PR: 211361
Approved by: re (gjb)

Changes:
_U stable/11/
stable/11/sbin/geom/class/part/gpart.8

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 12:19:06 PM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211361

Allan Jude <alla...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |alla...@FreeBSD.org

--- Comment #3 from Allan Jude <alla...@FreeBSD.org> ---
You can obviate the need to do the extra math by adding the parameter '-a 4k'
to the gpart commands, and it will align them to 4k for you.

I can make bsdinstall do this for GPT based disks, but MBR is too sensitive to
try to do anything like that.

bugzilla...@freebsd.org

unread,
Aug 5, 2016, 3:02:15 PM8/5/16
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211361

Nathan Whitehorn <nwhit...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |nwhit...@FreeBSD.org

--- Comment #4 from Nathan Whitehorn <nwhit...@FreeBSD.org> ---
This is just zfsboot, correct? partedit (UFS and single-volume ZFS) explicitly
aligns all partitions to the GEOM stripe size.
0 new messages