Obsolete:Zfs

From Wikitech
This page contains historical information. It may be outdated or unreliable.

ZFS is a filesystem developed at Sun and now available for Solaris, opensolaris, and FreeBSD. It is also available for Linux via the FUSE userspace filesystem module.

We use it because of its snapshot capability.


A few useful commands:

  • zfs list
    shows all pools.
  • zpool status poolname
    shows all devices used, and a few other goodies.
  • zfs mount
    shows all zfs filesystems mounted
  • zpool upgrade poolname
    upgrade the zfs pool to use the most recent pool format (use before you reboot into an ungraded version of Solaris)


Less commonly used but you will need them sooner or later:

  • zfs create poolname/blot
    creates the filesystem poolname/blot in the zfs pool specified by poolname
    example: if you have the pool /export, then zfs create export/thumbs (no leading slash) will create a zfs filesystem on /export/thumbs
  • zfs destroy poolname/blot
    destroys the filesystem poolname/blot with the pool specified by poolname
    example: if you have created the pool /export and the filesystem /export/thumbs then zfs destroy export/thumbs (no leading slash) will delete the filesystem and all its contents.


  • zpool create export raidz1 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0 raidz1 c0t6d0 c0t7d0 c1t1d0 c1t2d0 c1t3d0 raidz1 ...
    create a zpool /export on which you can create zfs filesystems. Ours all use raidz, see Sun Fire X4500 and X4540 for more. You can get the current setup by zpool status.
  • zpool destroy export
    destroy the export zpool and all data on it, even if disks are mounted. If enough devices are bad and can't be written to, then this command will fail with the message "cannot destroy XXXX: pool is faulted". You can force it by zfs destroy -f export/thumbs".

(Adding to this list is encouraged!)

See also: Zfs replication


Other sources of information:

  • The Sun ZFS admin guide [1]
  • The Sun ZFS Best Practices Guide [2]