RAID-Z wasted space - asize roundups to nparity +1

Matthew Ahrens mahrens at delphix.com
Mon Jan 28 21:55:55 UTC 2013


This is so that we won't end up with small, unallocatable segments.  E.g.
if you are using RAIDZ2, the smallest usable segment would be 3 sectors (1
sector data + 2 sectors parity).  If we left a 1 or 2 sector free segment,
it would be unusable and you'd be able to get into strange accounting
situations where you have free space but can't write because you're "out of
space".

The amount of waste due to this can be minimized by using larger blocksizes
(e.g. the default recordsize of 128k and files larger than 128k), and by
using smaller sector sizes (e.g. 512b sector disks rather than 4k sector
disks).  In your case these techniques would limit the waste to 0.6%.

--matt

On Sun, Jan 27, 2013 at 5:01 AM, Adam Nowacki <nowakpl at platinum.linux.pl>wrote:

> I've just found something very weird in the ZFS code.
>
> sys/cddl/contrib/opensolaris/**uts/common/fs/zfs/vdev_raidz.**c:504 in
> HEAD
>
> Can someone explain the reason behind this line of code? What it does is
> align on-disk record size to a multiple of number of parity disks + 1 ...
> this really doesn't make any sense. So far as I can tell those extra
> sectors are just padding - completely unused.
>
> For the array I'm using this results in 4.8% of wasted disk space - 1.7TB.
> It's a 12x 3TB disk RAID-Z2.
> ______________________________**_________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/**mailman/listinfo/freebsd-fs<http://lists.freebsd.org/mailman/listinfo/freebsd-fs>
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@**freebsd.org<freebsd-fs-unsubscribe at freebsd.org>
> "
>


More information about the freebsd-fs mailing list