ZFS Cheatsheet

For those of us outside of Sun:

With ZFS on the way, I thought I’d gather up from some of my resources and create a ZFS cheatsheet so you can get ready for whats to come:

There are two main commands for ZFS, “zfs” and “zpool”

"zpool list" - Show current usage on zfs pools
"zpool iostat 5" - Display I/O stats for zfs pools
"zpool vdevs" - Shows current mirror/pool device properties
"zpool create pool c0t3d0 c1t1d0 c4t4d0 c5t2d0" - Creates a pool consisting of c0t3d0 c1t1d0, c4t4d0, c5t2d0
"zpool create -fv pool slice1 slice2" - Creates a pool consisting of slice1 and slice2
"zpool create pool mirror c1t0d0 c2t0d0" - Creates a mirror consisting of c2t0d0 and c2t0d0
"zpool add -f pool mirror c0t1d0s3 c0t1d0s4" - Adds mirror to pool

"zfs list" - Show current zfs filesystems
"zfs create pool/filesystem" - Creates filesystem under pool
"zfs create pool/filesystem /mountpoint" - Creates filesystem under pool and mounts it to mountpoint
"zfs snapshot pool/filesystem@snapshotname" - Takes snapshot of filesystem
"zfs mount pool/filesystem /mountpoint" - Mounts a zfs filesystem to mountpoint
"zfs destroy pool/filesystem" - Deletes filesystem from pool
"zfs destroy pool" - Deletes pool

Notes on ZFS:
(From what I’ve gathered, may not be correct)

  • Package Name: SUNWzfs
  • You can’t convert a UFS filesystem to a ZFS filesystem as of yet, this means if you want ZFS you will have to install Solaris 10 Express from scratch.
  • If upgrading, ZFS can be used on new disks but not on existing UFS disks.
  • If there is a bad checksum on a disk, ZFS will grab the good checksum from another disk in the mirror and self heal.
  • You can use part of a pool for additional swap space.
  • Other operating systems can’t mount ZFS volumes as of yet.
  • There is never a need to fsck a ZFS filesystem.
  • Comments are closed.