From owner-freebsd-current@freebsd.org Tue Dec 26 20:20:14 2017 Return-Path: Delivered-To: freebsd-current@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 1391FEACE6D for ; Tue, 26 Dec 2017 20:20:14 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 863EF65918 for ; Tue, 26 Dec 2017 20:20:13 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-lf0-x22b.google.com with SMTP id f3so4337156lfe.4 for ; Tue, 26 Dec 2017 12:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QGm/ff1gGpeEnquOqLTeKU9ZJQykFSO9CRWbonxtvgI=; b=v7NF4VtK+L+sUzUGtN6SZpfB98oFhPbAhRLunePD9gPiJgVvfCoJTe8Vf7BJhLT9nJ DPakfHAoE0PJNWJz+WdkKbR8FWi8/sVq8JZ0V8IXWvEl5zdc1BGDaNGzdC/W+5ia/49Q cRKkafEKdjTa53dvAkk/sVcUwGwxVua+M2gqnkSHFnHTqSnJnH3DT0zt8NfHpfk9y7kQ VvgEyYkrDQaq474z3gMh+e+Lcv0nv4adI6KAr+nQHNxvnu5K5H7tQhoWlz+JgoSwF6GA LxLIN873dPFCo4k6AvH86yf3VnboaOBQp0pR34YT6XOndlMRbxFHHYDHTIwOkKAC4bw2 5V8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QGm/ff1gGpeEnquOqLTeKU9ZJQykFSO9CRWbonxtvgI=; b=eJrn1Q1gUgPYv78bVual3caMinD55uFajGjfqesYZssQLpCOCOeKk/kQk/XgsQWch/ DapriDxEIBUOM1cVashRLlAn/WYKCalKYc/N0ovyykxlG8OSKHEkMFyRW/ZTUPXMIuNH vx1/dttl4zdPOIlmqoCB7BPLNjtcU/1rNMf/tydNcwgqoyyuDzmznXPovypjlW/0dD7b XNJBbw97YyfyRigx5TFlDfWWJf6jdMjeVN74Tzm8c9EAqu0U0/ogArKYmt0DET2xlVUI RHzl8FgTdYiSDR9h4Nt3rrDqgAb3Dvt4RI8vAVUmUhc0wgMWCBX/5PBliPJiPd4/Sy1r TU3Q== X-Gm-Message-State: AKGB3mInFgFmTjRSOm8t8FachSgKNlbvSzXEI+jP1vyGPeZAvQJKa1hW 5LBetm8gK2n4kW5mFzVlyKI9d1Cxk/Gn1lR9/2BznQ== X-Google-Smtp-Source: ACJfBov0AlsnckCtbyqY5ueY0abQ5idP5HFf6chdHashO9DHi4lCXa6YQoDBS+aLuo2bC+OP3a4f/irs6EbRkX6cydU= X-Received: by 10.25.235.220 with SMTP id f89mr1347377lfk.14.1514319611246; Tue, 26 Dec 2017 12:20:11 -0800 (PST) MIME-Version: 1.0 References: <201712261731.vBQHVr7d057227@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201712261731.vBQHVr7d057227@pdx.rh.CN85.dnsmgr.net> From: Steven Hartland Date: Tue, 26 Dec 2017 20:20:00 +0000 Message-ID: Subject: Re: ZFS: alignment/boundary for partition type freebsd-zfs To: "Rodney W. Grimes" Cc: Alan Somers , Allan Jude , FreeBSD CURRENT , "O. Hartmann" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 20:20:14 -0000 You only need to set the min if the drives hide their true sector size, as Allan mentioned. camcontrol identify is one of the easiest ways to check this. If the pool reports ashift 12 then zfs correctly detected the drives as 4K so that part is good On Tue, 26 Dec 2017 at 20:15, Rodney W. Grimes < freebsd-rwg@pdx.rh.cn85.dnsmgr.net> wrote: > > On Tue, Dec 26, 2017 at 10:04 AM, O. Hartmann > > wrote: > > > > > Am Tue, 26 Dec 2017 11:44:29 -0500 > > > Allan Jude schrieb: > > > > > > > On 2017-12-26 11:24, O. Hartmann wrote: > > > > > Running recent CURRENT on most of our lab's boxes, I was in need to > > > replace and > > > > > restore a ZFS RAIDZ pool. Doing so, I was in need to partition the > > > disks I was about > > > > > to replace. Well, the drives in question are 4k block size drives > with > > > 512b emulation > > > > > - as most of them today. I've created the only and sole partiton on > > > each 4 TB drive > > > > > via the command sequence > > > > > > > > > > gpart create -s GPT adaX > > > > > gpart add -t freebsd-zfs -a 4k -l nameXX adaX > > > > > > > > > > After doing this on all drives I was about to replace, something > drove > > > me to check on > > > > > the net and I found a lot of websites giving "advices", how to > prepare > > > large, modern > > > > > drives for ZFS. I think the GNOP trick is not necessary any more, > but > > > many blogs > > > > > recommend to perform > > > > > > > > > > gpart add -t freebsd-zfs -b 1m -a 4k -l nameXX adaX > > > > > > > > > > to put the partition boundary at the 1 Megabytes boundary. I > didn't do > > > that. My > > > > > partitions all start now at block 40. > > > > > > > > > > My question is: will this have severe performance consequences or > is > > > that negligible? > > > > > > > > > > Since most of those websites I found via "zfs freebsd alignement" > are > > > from years ago, > > > > > I'm a bit confused now an consideration performing all this > > > days-taking resilvering > > > > > process let me loose some more hair as the usual "fallout" ... > > > > > > > > > > Thanks in advance, > > > > > > > > > > Oliver > > > > > > > > > > > > > The 1mb alignment is not required. It is just what I do to leave room > > > > for the other partition types before the ZFS partition. > > > > > > > > However, the replacement for the GNOP hack, is separate. In addition > to > > > > aligning the partitions to 4k, you have to tell ZFS that the drive > is 4k: > > > > > > > > sysctl vfs.zfs.min_auto_ashift=12 > > > > > > > > (2^12 = 4096) > > > > > > > > Before you create the pool, or add additional vdevs. > > > > > > > > > > I didn't do the sysctl vfs.zfs.min_auto_ashift=12 :-(( when I created > the > > > vdev. What is > > > the consequence for that for the pool? I lived under the impression > that > > > this is necessary > > > for "native 4k" drives. > > > > > > How can I check what ashift is in effect for a specific vdev? > > > > > > > It's only necessary if your drive stupidly fails to report its physical > > sector size correctly, and no other FreeBSD developer has already > written a > > quirk for that drive. Do "zdb -l /dev/adaXXXpY" for any one of the > > partitions in the ZFS raid group in question. It should print either > > "ashift: 12" or "ashift: 9". > > And more than likely if you used the bsdinstall from one of > the distributions to setup the system you created the ZFS > pool from it has the sysctl in /boot/loader.conf as the > default for all? recent? bsdinstall's is that the 4k default > is used and the sysctl gets written to /boot/loader.conf > at install time so from then on all pools you create shall > also be 4k. You have to change a default during the > system install to change this to 512. > > > -aLAn > > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to " > freebsd-current-unsubscribe@freebsd.org" > > > > -- > Rod Grimes > rgrimes@freebsd.org > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >