[Ask /r/BSD] Disks, Pools, Datasets, Volumes, RAID-Z, oh my! reddit / BSD ---------------------------------------------------------------------- name_censored_ · 2011-03-20 05:42 ______ **tl;dr - How do I set up my NAS with ZFS?** ______ Hi /r/BSD! I'm in the process of retiring my current linux-based Raid-5 NAS, and replacing it with a FreeNAS/ZFS box - I've always wanted to get into BSD, and ZFS's awesome feature set and maturity is as good an excuse as any! Based on what my current NAS has taught me, I plan to/have set it up as such; 1. Purchase disks as needed, rather than all upfront (storage continually get cheaper per GB, so leaving it to the last possible second makes sense). 2. Capacity to be added as pairs of new disks in a software RAID-1 mirror (allowing total failure of any single disk). 3. Each mirror should *not* rely on the other mirrors being the same size. 4. The server's entire capacity should appear as one big contiguous volume to an end-user. 5. Files should be self-healing/error-free (damn you, linux software raid, stop corrupting my files!) I've bought all the hardware (intially using 2 disks), and have set up FreeNAS. But the ZFS terminology makes my head spin (what is a dataset? How does a pool compare to a volume? And what about RAID-Z?), and I can't find any documentation that will explain it in a way that my tiny brain will comprehend. How do I set up ZFS in a way that will help me achieve my aims? Thanks in advance! (PS. Sorry if this is the wrong subreddit). ---------------------------------------------------------------------- neoice · 2011-03-20 06:06 try [this](http://hub.opensolaris.org/bin/download/Community+Group+zfs /docs/zfsadmin.pdf). I think when I first tried out ZFS, I wound up reading almost the whole thing just to hack my way through. ---------------------------------------------------------------------- notpeter · 2011-03-20 09:09 Forget RAID-Z, there's extra CPU overhead and reduced flexibility when expanding. There is currently no easy way to shrink, but expansion (by adding or upgrading disks) is straight forward. A mirrored zpool with a single filesystem is what you want. Just start with one mirror of two disks [or four disks]: > zpool create poolname mirror disk1 disk2 [mirror disk3 disk4...] Create a single case-insensitive filesystem: > zfs create poolname/fsname -o casesensitivity=insensitive Add pairs disks (e.g. 2x1TB + 2x2TB + 2x3TB = 8TB usable) > zpool add poolname mirror disk3 disk3 You can also replace a disk with a larger one (e.g. replace a dead 1TB disk with a 2TB one) but to gain access to the extra capacity you need to replace both halves of the mirrored pair and remount. Not sure how you setup a SMB share within FreeNAS for ZFS. In Solaris/Nexenta with the kernel mode CIFS server you just: > zfs set sharesmb=name=myname poolname/fsname ---------------------------------------------------------------------- name_censored_ · 2011-03-20 12:25 >Forget RAID-Z, there's extra CPU overhead and reduced flexibility when expanding. I was a bit on the fence about multivolume/parity-based RAID setups (after getting stuck with low capacity disks and no upgrade path on my previous setup), and this settles it. >Add pairs disks (e.g. 2x1TB + 2x2TB + 2x3TB = 8TB usable) >> zpool add poolname mirror disk3 disk4 Ah, so the mirror pair[s] sits in the pool as one volume, and *then* it's spanned (basically a JBOD/span over multiple RAID1s)? If so, that's exactly what I'm after. Thankyou very much! ---------------------------------------------------------------------- edogawaconan · 2011-03-20 12:30 in freebsd, samba must be used. The setup follows standard samba setup. in any case, one set (vdev) must use same-capacity drives. One vdev can be a single disk, mirrored set or raidzN set. Single disk can be upgraded to mirrored set. Mirrored set can be downgraded to single set. You can't modify raidzN set though. A collection of vdevs form pool. Capacity of each vdev will then be combined in that pool. tl;dr: disks form vdev, vdevs form pool. Vdev's configuration is independent from each other. ---------------------------------------------------------------------- [deleted] · 2011-03-20 19:46 [deleted] ---------------------------------------------------------------------- kurin · 2011-03-22 18:42 I'm late to this thread, but you can use [mdconfig](http://www.freebsd .org/cgi/man.cgi?query=mdconfig&sektion=8) to create file-backed md disks, which you can then use to play around with zfs and zpool. Create arrays, examine upgrade paths, etc. It's a very good way to experiment with your intended setup without actually purchasing or stressing hardware. ---------------------------------------------------------------------- vvelox · 2011-04-07 08:10 It works nicely. I do this at home. This is one thing I do suggest, leaving two drive trays open for easy upgrading. By leaving two trays open you can easily insert two larger drives into there, create a mirror on them, and then tell ZFS to migrate it's self off one of the older smaller mirrors onto the new larger one.