From owner-freebsd-bugs@freebsd.org Mon Jul 25 07:51:55 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19742BA365E for ; Mon, 25 Jul 2016 07:51:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F39C41238 for ; Mon, 25 Jul 2016 07:51:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P7pswe088557 for ; Mon, 25 Jul 2016 07:51:54 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 211361] suggested boot partition size is too small, bsdinstall creates unaligned partitions Date: Mon, 25 Jul 2016 07:51:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 11.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: des@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 07:51:55 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211361 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: freebsd-bugs@FreeBSD.org Reporter: des@FreeBSD.org The gpart(4) man page suggests creating a 44 kB boot partition. This was f= ine for 9 and 10 where gptzfsboot is 42 kB, but 11's gptzfsboot is twice that s= ize. 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 document= ed 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 sw= ap partition that follows it to be aligned on (at least) 4096-byte boundaries.= =20 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 s= wap 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. --=20 You are receiving this mail because: You are the assignee for the bug.=