From owner-freebsd-fs@FreeBSD.ORG Mon Nov 19 08:31:32 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C672D837 for ; Mon, 19 Nov 2012 08:31:32 +0000 (UTC) (envelope-from nowakpl@platinum.linux.pl) Received: from platinum.linux.pl (platinum.edu.pl [81.161.192.4]) by mx1.freebsd.org (Postfix) with ESMTP id 73D918FC08 for ; Mon, 19 Nov 2012 08:31:32 +0000 (UTC) Received: by platinum.linux.pl (Postfix, from userid 87) id B6CA247DDA; Mon, 19 Nov 2012 09:31:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on platinum.linux.pl X-Spam-Level: X-Spam-Status: No, score=-1.4 required=3.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.3.2 Received: from [172.19.191.4] (unknown [83.151.38.73]) by platinum.linux.pl (Postfix) with ESMTPA id E8ABB47DD8 for ; Mon, 19 Nov 2012 09:31:17 +0100 (CET) Message-ID: <50A9EE53.7020908@platinum.linux.pl> Date: Mon, 19 Nov 2012 09:31:15 +0100 From: Adam Nowacki User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Subject: Re: ZFS behavior with odd-number of non-parity drives? References: <50A82F08.8010908@8192.net> In-Reply-To: <50A82F08.8010908@8192.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 08:31:33 -0000 For small files or tails ZFS will reduce the number of drives used. For example two 512 byte (or less) files on 5 drive (512 byte sectors) raidz2 might end as: file 1: disk 1 sector 1 - data, disk 2 sector 1 - parity 1, disk 3 sector 1 - parity 2, file 2: disk 4 sector 1 - data, disk 5 sector 1 - parity 1, disk 1 sector 2 - parity 2. 0.0kiB - 0.5kiB will use 3 sectors, 0.5kiB - 1.0kiB will use 4 sectors, 1.0kiB - 1.5kiB will use 5 sectors (all drives used), 1.5kiB - 2.0kiB will use 8 sectors (cycle repeats). On 2012-11-18 01:42, je wrote: > Given an odd number of data (non-parity) drives, how does ZFS write data > to the individual disks? > > For example, a 4-drive RAIDZ or 5-drive RAIDZ2 would use three drives > for data and two for parity when writing. Since the recordsize is a > power of two (and no power of two is evenly divisible by three), it is > impossible to write a full sector (be it a 512b or 4k sector) of data to > each data drive. > > In this case, what does ZFS do? Will it write recordsize/3 bytes of data > to each drive, leaving the drive to do a read/modify/write operation? Or > will ZFS round the write up to the nearest drive sector size and "waste" > the extra bytes? > > I see the best practice for RAIDZ is to use an odd number of drives, and > for RAIDZ2 an even number, but I am curious as to the behavior of ZFS in > these sub-optimal conditions. > > John > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"