Using ZFSIn my last post I showed how to get ZFS installed on CentOS 6.3. This post will serve as a quick start guide.
Creating a ZFS file systemThe first thing you will want to do is to create a zfs file system. The syntax is simple and straight forward.
The above command creates a mirrored ZFS file system and mounts it at /store. That is the simplest use case you have a mirrored device that provides some hardware failure resilience.zpool create store mirror /dev/sda /dev/sdb
Getting more complexCreating a simple mirror is fine and good but lets show a little more complex example.
The above command create a RAID5 like ZFS file system and mounts it at /store. It also includes a hot spare drive. Other options other than raidz include raidz2 and raidz3 giving you even more redundancy.zpool create store raidz /dev/sdc /dev/sdd /dev/sde spare /dev/sdf
You may want to create other ZFS file systems under your /store to give additional control (for example setting quota's).
Some of the other cool things you can do is turn on NFS sharing, enable compression or enable deduplication. To learn more about the more advanced stuff you can do with ZFS I recommend reading the ZFS Administrators Guide.zfs create store/user1 zfs set quota=10G store/user1