User Tools

Site Tools


computing:storage:zfs_cmds

This is an old revision of the document!


ZFS - Basic Commands

http://www.tumblr.com/tagged/zfs

ZFS Filesystem Integrity: http://docs.oracle.com/cd/E19963-01/html/821-1448/gbbwa.html

:!: Linux-style disk device syntax shown. These examples use disks like: /dev/sdb, /dev/sdc, /dev/sdx.

:!: Log in as root.

Check status of ZFS pools: http://docs.oracle.com/cd/E19082-01/817-2271/gamno/index.html

  zpool status

Check status of ZFS datasets:

  zfs list

Create ZFS pool:

  zpool create <Pool Name> <first storage device> <second storage device> ...

Create ZFS pool mirror:

  zpool create <Pool Name> mirror /dev/sdb /dev/sdc

Create ZFS pool raidz:

  zpool create <Pool Name> raidz /dev/sdd /dev/sde /dev/sdf

Create ZFS pool raidz2:

  zpool create <Pool Name> raidz /dev/sdg /dev/sdh /dev/sdi /dev/sdj

View the status of the ZFS pools:

  zpool status | more

Create ZFS pool RAID 10:

  zpool create <Pool Name> mirror /dev/sdb /dev/sdc
  zpool add <Pool Name> mirror /dev/sdd /dev/sde
  zpool add <Pool Name> mirror /dev/sdf /dev/sdg

Create ZFS pool RAID 50:

  zpool create <Pool Name> raidz /dev/sdb /dev/sdc /dev/sdd
  zpool add <Pool Name> raidz /dev/sde/dev/sdf /dev/sdg
  zpool add <Pool Name> raidz /dev/sdh /dev/sdi /dev/sdj

Create ZFS pool RAID 60:

  zpool create <Pool Name> raidz2 /dev/sdb /dev/sdc /dev/sdd /dev/sde
  zpool add <Pool Name> raidz2 /dev/sdf /dev/sdg /dev/sdh /dev/sdi

Modify the properties of the ZFS pool:

  zfs set <property>=<value> <Pool Name>

Enable compression on speific pool:

  zfs set compression=on <Pool Name>

Enable data deduplication on specific pool:

  zfs set dedup=on <Pool Name>

Verify the properties of specific pool:

  zfs get all <Pool Name>

Destroy a ZFS pool:

  zpool destroy <Pool Name>

Snapshots

https://www.howtoforge.com/tutorial/how-to-use-snapshots-clones-and-replication-in-zfs-on-linux/

A snapshot provides a read-only, point-in-time copy of a file system or volume that does not consume extra space in the ZFS pool. The snapshot uses only space when the block references are changed. Snapshots preserve disk space by recording only the differences between the current dataset and a previous version.

A typical example use for a snapshot is to have a quick way of backing up the current state of the file system when a risky action like a software installation or a system upgrade is performed.

Clones

A clone is a writable volume or file system whose initial contents are the same as the dataset from which it was created.

SMART

smartctl -T permissive -a -d sat /dev/rdsk/XXXXXXXXX
computing/storage/zfs_cmds.1450823753.txt.gz · Last modified: 2015/12/22 15:35 by gcooper