From nobody@FreeBSD.org  Sun Oct 16 17:59:59 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9C6661065677
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Oct 2011 17:59:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C0148FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Oct 2011 17:59:59 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p9GHxxpZ074715
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Oct 2011 17:59:59 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p9GHxxBV074714;
	Sun, 16 Oct 2011 17:59:59 GMT
	(envelope-from nobody)
Message-Id: <201110161759.p9GHxxBV074714@red.freebsd.org>
Date: Sun, 16 Oct 2011 17:59:59 GMT
From: Warren Block <wblock@wonkity.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsdinstall: partition editor does not put partitions on even 4K boundaries
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         161720
>Category:       bin
>Synopsis:       bsdinstall(8): partition editor does not put partitions on even 4K boundaries
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-sysinstall
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 16 18:00:28 UTC 2011
>Closed-Date:    
>Last-Modified:  Tue Oct 25 13:40:03 UTC 2011
>Originator:     Warren Block
>Release:        9.0-BETA3
>Organization:
>Environment:
FreeBSD machine3.example.com 9.0-BETA3 FreeBSD 9.0-BETA3 #0: Sat Sep 24 21:31:28 UTC 2011     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Partitions created by the Auto option of bsdinstall's partition editor do not start on even 4K boundaries.  This will seriously compromise performance on drives with 4K-byte blocks.

gpart show ada0
=>      34  25694141  ada0  GPT  (12G)
        34       128     1  freebsd-boot  (64k)
       162  23068544     2  freebsd-ufs  (11G)
  23068706   1284096     3  freebsd-swap  (627M)
  24352802   1341373        - free -  (655M)

Partition 2 starts at block 162.  Instead, it should start at 1M as with
gpart add -t freebsd-ufs -b 1M -s 11G ada0

Note: at present, FreeBSD boot code fails when freebsd-boot partitions are larger than 512K, so making the freebsd-boot partition 1M is not the simple fix it appears to be.

Reported by je33 in http://forums.freebsd.org/showthread.php?t=27044
>How-To-Repeat:
Install FreeBSD 9.0-BETA3 with bsdinstall and Auto partitioning.
>Fix:
FreeBSD partition types other than freebsd-boot should start at the next even multiple of 1M for good performance on Advanced Format (4K block) drives without harming performance of 512 byte drives.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun Oct 16 22:50:58 UTC 2011 
Responsible-Changed-Why:  
over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161720 

From: Dennis Yusupoff <dyr@smartspb.net>
To: bug-followup@FreeBSD.org, wblock@wonkity.com
Cc:  
Subject: Re: bin/161720: bsdinstall(8): partition editor does not put partitions
 on even 4K boundaries
Date: Tue, 25 Oct 2011 13:27:02 +0400

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enigBFEDB1EA657101A7650BAC7B
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 
 While I agree with you in need of aligning [first] partition, I'd like
 to behold, that gpart show size in blocks, not in megabytes, so to align
 partition to 1 mbyte on 4K-align HDDs you might execute "gpart add -b
 2048 -s 64K -t freebsd-boot ada0" ( 2048 blocks * 4096 kbytes =3D 8 Mbyte=
 ,
 in case of "plain" HDD 2048 blocks * 512 bytes =3D 1 Mbyte, which, I
 think, is a pretty good).
 Moreover, I don't see why freebsd-boot partition should be more than
 512K, if even 64K are currently just enough for FreeBSD. Looks like old
 and famous Bill Gates's sentence, I know, but however :)
 
 --=20
 With best regards,
 Dennis Yusupoff,
 network engineer of
 Smart-Telecom ISP
 Russia, Saint-Petersburg=20
 
 
 
 --------------enigBFEDB1EA657101A7650BAC7B
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iQEcBAEBAgAGBQJOpoDmAAoJEBUTaqBS2NB4dG4H/iyeEhbN8RUJvOG8Ow+c8D5b
 sLWd0XsGx7kKqlKVhTvrtTZSuCDxLGsynNvnO+iSBqFPeajOhThbw2w0CEj9XEEj
 DBVGL2KgwJl0Ye7wc6Tzjddbd7i9bELK41MM3k4iUgHlZA/qCdhLl9cPt28PQA0T
 GnDPjBCfQoMZXqncAHI+UmNga11LWQYQ0pO0BtD4Cv9a+RhPTIbZaMc9BcFlJSoP
 YNkNrW8R278bl4wUIc244hK5FDjRfvyzBgcFj3BB6ZMMHZTrmGM9swLBK7HMnQOs
 +Zke+0HPSZ0o3idpnlOgDggx6zX4PTR2ZAkNi3+xxfqoOfHeKDj2TPoU84EKyik=
 =TjYH
 -----END PGP SIGNATURE-----
 
 --------------enigBFEDB1EA657101A7650BAC7B--

From: Warren Block <wblock@wonkity.com>
To: Dennis Yusupoff <dyr@smartspb.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/161720: bsdinstall(8): partition editor does not put partitions
 on even 4K boundaries
Date: Tue, 25 Oct 2011 07:17:24 -0600 (MDT)

 On Tue, 25 Oct 2011, Dennis Yusupoff wrote:
 
 > While I agree with you in need of aligning [first] partition, I'd like
 > to behold, that gpart show size in blocks, not in megabytes, so to align
 > partition to 1 mbyte on 4K-align HDDs you might execute "gpart add -b
 > 2048 -s 64K -t freebsd-boot ada0" ( 2048 blocks * 4096 kbytes = 8 Mbyte,
 > in case of "plain" HDD 2048 blocks * 512 bytes = 1 Mbyte, which, I
 > think, is a pretty good).
 
 The -b option to 'gpart add' also accepts a size like "1M", so 'gpart 
 add -t freebsd-ufs -b 1M ...' should work on any drive with a block size 
 all the way up to 1M.  Tested and works on 512-byte drives, but I have 
 not tested it on a 4K drive.
 
 There's also the -a option, which attempts to align partitions to the 
 value given.  '-a 4096' should work on both 512-byte and 4k-byte drives.
 
 (bsdinstall's partition editor and wizard do not run gpart(8) but make 
 lower-level calls to libgeom.  Still, the functionality of the -a or -b 
 options could be duplicated.)
 
 > Moreover, I don't see why freebsd-boot partition should be more than
 > 512K, if even 64K are currently just enough for FreeBSD. Looks like old
 > and famous Bill Gates's sentence, I know, but however :)
 
 FreeBSD bootcode has problems with a freebsd-boot partition larger than 
 512K, so that's the current limit.
 
 However, starting the first filesystem partition at 1M works for both 
 alignment and compatibility with other systems.  From the -current 
 mailing list:
 
 http://lists.freebsd.org/pipermail/freebsd-current/2011-September/027547.html
 http://lists.freebsd.org/pipermail/freebsd-current/2011-September/027548.html
 http://lists.freebsd.org/pipermail/freebsd-current/2011-September/027550.html
 http://lists.freebsd.org/pipermail/freebsd-current/2011-September/027563.html
 http://lists.freebsd.org/pipermail/freebsd-current/2011-September/027626.html

From: Dennis Yusupoff <dyr@smartspb.net>
To: Warren Block <wblock@wonkity.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/161720: bsdinstall(8): partition editor does not put partitions
 on even 4K boundaries
Date: Tue, 25 Oct 2011 17:36:44 +0400

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enigCDBAE30B5EF5AC81BFBEC70E
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 
 25.10.2011 17:17, Warren Block =D0=BF=D0=B8=D1=88=D0=B5=D1=82:
 >
 > The -b option to 'gpart add' also accepts a size like "1M", so 'gpart
 > add -t freebsd-ufs -b 1M ...' should work on any drive with a block
 > size all the way up to 1M. Tested and works on 512-byte drives, but I
 > have not tested it on a 4K drive.
 >
 > There's also the -a option, which attempts to align partitions to the
 > value given. '-a 4096' should work on both 512-byte and 4k-byte drives.=
 
 I haven't knew it, thanks.
 
 >
 >> Moreover, I don't see why freebsd-boot partition should be more than
 >> 512K, if even 64K are currently just enough for FreeBSD. Looks like ol=
 d
 >> and famous Bill Gates's sentence, I know, but however :)
 >
 > FreeBSD bootcode has problems with a freebsd-boot partition larger
 > than 512K, so that's the current limit.
 >
 > However, starting the first filesystem partition at 1M works for both
 > alignment and compatibility with other systems. From the -current
 > mailing list:
 >
 [...skipped...]
 
 Yeah, I agree with you, but aligning shift size hasn't relation with
 partition size - so works with aligned partition doesn't need to
 increase freebsd-boot partition larger 512K since it's work.
 
 P.S. My home server:
 =3D=3D=3D
 [dyr@server ~]$ gpart show ada0
 =3D> 34 3907029101 ada0 GPT (1.8T)
 34 2014 - free - (1M)
 2048 128 1 freebsd-boot (64k)
 2176 8388608 2 freebsd-swap (4.0G)
 8390784 41943040 3 freebsd-zfs (20G)
 50333824 3856695311 4 freebsd-zfs (1.8T)
 
 [dyr@server ~]$
 =3D=3D=3D
 Works fine...
 
 
 
 --=20
 With best regards,
 Dennis Yusupoff,
 network engineer of
 Smart-Telecom ISP
 Russia, Saint-Petersburg=20
 
 
 
 --------------enigCDBAE30B5EF5AC81BFBEC70E
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iQEcBAEBAgAGBQJOprtsAAoJEBUTaqBS2NB4q+QH/0HJHGUox2G21x8z2HTnnPyz
 WxQbOp0PoaUpjgrxbrEKU6Sc7CNGM+N10ADGSOw2hVYVh/yyB4ZI/TQNKsdolLI9
 w7/tE5P/bOz/6DZHzNKrDD3E7sA6UN77DBK84thWb9qp4F2CCl3ZfAkzwWo1Ap/v
 EJ7xk8INsDUDLrG2r00w/uIDNoXNSJnBdy8g9hT1ZYO1kWgdE0Gq7CORl1VEPBGe
 fKutOMoAj4OtTnN1+pscMH84ZkBodv7l/6/f7QRMkGTw/SWdCp0rE2y6rKCwxT0B
 ra7bnCOIiNj0ywl0xBSfvzKNoYck8A2H7mKxNtq0e7bF9Uqd49iIo/l1dSOyp8U=
 =Aibh
 -----END PGP SIGNATURE-----
 
 --------------enigCDBAE30B5EF5AC81BFBEC70E--
>Unformatted:
