Oracle Solaris ZFS Administration Guide

Querying ZFS Properties

The simplest way to query property values is by using the zfs list command. For more information, see Listing Basic ZFS Information. However, for complicated queries and for scripting, use the zfs get command to provide more detailed information in a customized format.

You can use the zfs get command to retrieve any dataset property. The following example shows how to retrieve a single property value on a dataset:

# zfs get checksum tank/ws
NAME             PROPERTY       VALUE                      SOURCE
tank/ws          checksum       on                         default

The fourth column, SOURCE, indicates the origin of this property value. The following table defines the possible source values.

Table 6–3 Possible SOURCE Values (zfs get Command)

Source Value 



This property value was never explicitly set for this dataset or any of its ancestors. The default value for this property is being used. 

inherited from dataset-name

This property value is inherited from the parent dataset specified in dataset-name.


This property value was explicitly set for this dataset by using zfs set.


This property value was set by using the zfs mount -o option and is only valid for the duration of the mount. For more information about temporary mount point properties, see Using Temporary Mount Properties.

- (none) 

This property is read-only. Its value is generated by ZFS. 

You can use the special keyword all to retrieve all dataset property values. The following examples use the all keyword:

# zfs get all tank/home
NAME       PROPERTY              VALUE                  SOURCE
tank/home  type                  filesystem             -
tank/home  creation              Tue Jun 29 11:44 2010  -
tank/home  used                  21K                    -
tank/home  available             66.9G                  -
tank/home  referenced            21K                    -
tank/home  compressratio         1.00x                  -
tank/home  mounted               yes                    -
tank/home  quota                 none                   default
tank/home  reservation           none                   default
tank/home  recordsize            128K                   default
tank/home  mountpoint            /tank/home             default
tank/home  sharenfs              off                    default
tank/home  checksum              on                     default
tank/home  compression           off                    default
tank/home  atime                 on                     default
tank/home  devices               on                     default
tank/home  exec                  on                     default
tank/home  setuid                on                     default
tank/home  readonly              off                    default
tank/home  zoned                 off                    default
tank/home  snapdir               hidden                 default
tank/home  aclmode               groupmask              default
tank/home  aclinherit            restricted             default
tank/home  canmount              on                     default
tank/home  shareiscsi            off                    default
tank/home  xattr                 on                     default
tank/home  copies                1                      default
tank/home  version               4                      -
tank/home  utf8only              off                    -
tank/home  normalization         none                   -
tank/home  casesensitivity       sensitive              -
tank/home  vscan                 off                    default
tank/home  nbmand                off                    default
tank/home  sharesmb              off                    default
tank/home  refquota              none                   default
tank/home  refreservation        none                   default
tank/home  primarycache          all                    default
tank/home  secondarycache        all                    default
tank/home  usedbysnapshots       0                      -
tank/home  usedbydataset         21K                    -
tank/home  usedbychildren        0                      -
tank/home  usedbyrefreservation  0                      -
tank/home  logbias               latency                default

Note –

The casesensitivity, nbmand, normalization, sharesmb, utf8only, and vscan properties are not fully operational in the Oracle Solaris 10 release because the Oracle Solaris SMB service is not supported in the Oracle Solaris 10 release.

The -s option to zfs get enables you to specify, by source type, the properties to display. This option takes a comma-separated list indicating the desired source types. Only properties with the specified source type are displayed. The valid source types are local, default, inherited, temporary, and none. The following example shows all properties that have been locally set on pool.

# zfs get -s local all pool
NAME             PROPERTY      VALUE                      SOURCE
pool             compression   on                         local

Any of the above options can be combined with the -r option to recursively display the specified properties on all children of the specified dataset. In the following example, all temporary properties on all datasets within tank are recursively displayed:

# zfs get -r -s temporary all tank
NAME             PROPERTY       VALUE                      SOURCE
tank/home          atime          off                      temporary
tank/home/bonwick  atime          off                      temporary
tank/home/marks    atime          off                      temporary

You can query property values by using the zfs get command without specifying a target file system, which means the command operates on all pools or file systems. For example:

# zfs get -s local all
tank/home               atime          off                    local
tank/home/bonwick       atime          off                    local
tank/home/marks         quota          50G                    local

For more information about the zfs get command, see zfs(1M).

Querying ZFS Properties for Scripting

The zfs get command supports the -H and -o options, which are designed for scripting. You can use the -H option to omit header information and to replace white space with the Tab character. Uniform white space allows for easily parseable data. You can use the -o option to customize the output in the following ways:

The following example shows how to retrieve a single value by using the -H and -o options of zfs get:

# zfs get -H -o value compression tank/home

The -p option reports numeric values as their exact values. For example, 1 MB would be reported as 1000000. This option can be used as follows:

# zfs get -H -o value -p used tank/home

You can use the -r option, along with any of the preceding options, to recursively retrieve the requested values for all descendents. The following example uses the -H, -o, and -r options to retrieve the dataset name and the value of the used property for export/home and its descendents, while omitting the header output:

# zfs get -H -o name,value -r used export/home
export/home             5.57G
export/home/marks       1.43G
export/home/maybee      2.15G