Date: Mon, 19 Nov 2012 09:31:15 +0100 From: Adam Nowacki <nowakpl@platinum.linux.pl> To: freebsd-fs@freebsd.org Subject: Re: ZFS behavior with odd-number of non-parity drives? Message-ID: <50A9EE53.7020908@platinum.linux.pl> In-Reply-To: <50A82F08.8010908@8192.net> References: <50A82F08.8010908@8192.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50A9EE53.7020908>