Creating ZFS datasets under ZFS pool in Solaris 10.
March 29, 2008 – 1:17 pmSolaris 10 comes with powerful command called ‘zpool’. It configures ZFS storage pools. A storage pool is a collection of devices that provides physical storage and data replication for ZFS datasets.
All datasets within a storage pool share the same space.
Let’s create our first ZFS pool. As states in the manual, ZFS can use individual slices or partitions, though using whole disk is recommended.
root@server # zpool create samplepool cXdXsX
or if we have 2 disks mirrored:
root@server # zpool create mirror samplepool cXdXsX cYdYsY
If we don’t specify the mountpoint (-m /mountpoint), the /poolname (in this case /samplepool) will be used.
You can use:
root@server # zpool iostat -v samplepool
and/or
root@server # zpool list
commands to verify.
Now let’s have a look at the ZFS datasets:
root@server # zfs list
NAME USED AVAIL REFER MOUNTPOINT
samplepool 6.0G 192G 270M /samplepool
As we can see, there is one dataset already created and 192GB available space there. Now we want to create additional ZFS dataset for the log files with 2GB quota on it.
root@server # zfs create samplepool/sample_dataset
root@server # zfs set mountpoint=/usr/local/sample_dataset samplepool/sample_dataset
root@server # zfs set quota=2g samplepool/sample_dataset
Here we go! It’s already done! We can verify this using:
root@server # zfs list
NAME USED AVAIL REFER MOUNTPOINT
samplepool 16.4G 192G 270M /samplepool
samplepool/sample_dataset 2.0G 24K 2.0G 1% /usr/local/sample_dataset
or
root@server # df -kh | grep sample
samplepool 209G 270M 192G 1% /samplepool
samplepool/sample_dataset 2.0G 24K 2.0G 1% /usr/local/sample_dataset
Pretty easy, isn’t it?