From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 1 00:42:53 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9DD2A63 for ; Sun, 1 Jun 2014 00:42:53 +0000 (UTC) Received: from bewilderbeast.blackhelicopters.org (mwlucas-2-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:b9c::2]) (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 509C12C72 for ; Sun, 1 Jun 2014 00:42:53 +0000 (UTC) Received: from bewilderbeast.blackhelicopters.org (localhost [127.0.0.1]) by bewilderbeast.blackhelicopters.org (8.14.7/8.14.7) with ESMTP id s510ggNe097249 for ; Sat, 31 May 2014 20:42:52 -0400 (EDT) (envelope-from mwlucas@bewilderbeast.blackhelicopters.org) Received: (from mwlucas@localhost) by bewilderbeast.blackhelicopters.org (8.14.7/8.14.7/Submit) id s510ggV9097248 for hackers@freebsd.org; Sat, 31 May 2014 20:42:42 -0400 (EDT) (envelope-from mwlucas) Date: Sat, 31 May 2014 20:42:42 -0400 From: "Michael W. Lucas" To: hackers@freebsd.org Subject: fdisk(8) vs gpart(8), and gnop Message-ID: <20140601004242.GA97224@bewilderbeast.blackhelicopters.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (bewilderbeast.blackhelicopters.org [127.0.0.1]); Sat, 31 May 2014 20:42:52 -0400 (EDT) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 00:42:53 -0000 Folks, $SUBJECT have been two contentious points of discussion in private mail, Twitter, the BSDCan bar track, and random people passing on the street. I was very surprised at the number of knowledgeable people who have different ideas on this and argue about it at length. I'm hoping to verify what seems to be correct. First, is fdisk EVER necessary? I *believe* that gpart's '-a 4k' handles all alignment issues for the 512B/4KB sector issues. If you sometimes need to use fdisk, when exactly is that? Similarly, I *believe* that you need to "gnop -S 4096 $device" any time you want to use ZFS, so that 1) zfs sets ashift=12 and 2) you can later replace a 512B-sector drive with a 4096KB-sector drive without ZFS having a hissy fit about mismatched sector sizes. Finally, while UFS isn't picky about changing the underlying sector size on a dump/restore, I believe it's a good idea to always gnop the underlying disk. Disks lie about sector size, and while it's OK to assume a 4k-sector disk, assuming a 512b-sector disk on a 4k-sector disk causes write multiplication. Are my beliefs correct? I need to get this part of the book correct, or the rest of it will go wildly astray... Thanks, ==ml -- Michael W. Lucas - mwlucas@michaelwlucas.com, Twitter @mwlauthor http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/