JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris ZFS Administration Guide     Oracle Solaris 11 Express 11/10
search filter icon
search icon

Document Information

Preface

1.  Oracle Solaris ZFS File System (Introduction)

What's New in ZFS?

ZFS File System Encryption

ZFS Send Stream Enhancements

ZFS Snapshot Differences (zfs diff)

ZFS Storage Pool Recovery and Performance Enhancements

Tuning ZFS Synchronous Behavior

Improved ZFS Pool Messages

ZFS ACL Interoperability Improvements

Splitting a Mirrored ZFS Storage Pool (zpool split)

Solaris iSCSI Changes

New ZFS System Process

ZFS Deduplication Property

Changes to the zpool list Command

ZFS Storage Pool Recovery

ZFS Log Device Enhancements

Triple Parity RAIDZ (raidz3)

Holding ZFS Snapshots

ZFS Device Replacement Enhancements

ZFS User and Group Quotas

ZFS ACL Pass Through Inheritance for Execute Permission

Automatic ZFS Snapshots

ZFS Property Enhancements

ZFS Log Device Recovery

Using ZFS ACL Sets

Using Cache Devices in Your ZFS Storage Pool

ZFS Root Pool Management

Rolling Back a Dataset Without Unmounting

Enhancements to the zfs send Command

ZFS Quotas and Reservations for File System Data Only

ZFS File System Properties for the Solaris CIFS Service

ZFS Storage Pool Properties

ZFS and File System Mirror Mounts

ZFS Command History Enhancements (zpool history)

Upgrading ZFS File Systems (zfs upgrade)

ZFS Delegated Administration

Setting Up Separate ZFS Log Devices

Creating Intermediate ZFS Datasets

ZFS Hot-Plugging Enhancements

Recursively Renaming ZFS Snapshots (zfs rename -r)

gzip Compression Is Available for ZFS

Storing Multiple Copies of ZFS User Data

Improved zpool status Output

ZFS and Solaris iSCSI Improvements

Sharing ZFS File System Enhancements

ZFS Command History (zpool history)

ZFS Property Improvements

ZFS xattr Property

ZFS canmount Property

ZFS User Properties

Setting Properties When Creating ZFS File Systems

Displaying All ZFS File System Information

New zfs receive -F Option

Recursive ZFS Snapshots

Double-Parity RAID-Z (raidz2)

Hot Spares for ZFS Storage Pool Devices

Replacing a ZFS File System With a ZFS Clone (zfs promote)

Upgrading ZFS Storage Pools (zpool upgrade)

Using ZFS to Clone Non-Global Zones and Other Enhancements

ZFS Backup and Restore Commands Are Renamed

Recovering Destroyed Storage Pools

ZFS Is Integrated With Fault Manager

The zpool clear Command

Compact NFSv4 ACL Format

File System Monitoring Tool (fsstat)

What Is ZFS?

ZFS Pooled Storage

Transactional Semantics

Checksums and Self-Healing Data

Unparalleled Scalability

ZFS Snapshots

Simplified Administration

ZFS Terminology

ZFS Component Naming Requirements

2.  Getting Started With Oracle Solaris ZFS

3.  Oracle Solaris ZFS and Traditional File System Differences

4.  Managing Oracle Solaris ZFS Storage Pools

5.  Managing ZFS Root Pool Components

6.  Managing Oracle Solaris ZFS File Systems

7.  Working With Oracle Solaris ZFS Snapshots and Clones

8.  Using ACLs and Attributes to Protect Oracle Solaris ZFS Files

9.  Oracle Solaris ZFS Delegated Administration

10.  Oracle Solaris ZFS Advanced Topics

11.  Oracle Solaris ZFS Troubleshooting and Pool Recovery

A.  Oracle Solaris ZFS Version Descriptions

Index

What's New in ZFS?

This section summarizes new features in the ZFS file system.

ZFS File System Encryption

Oracle Solaris 11 Express, build 149: In this Solaris release, you can encrypt a ZFS file system.

For example, the tank/cindys file system is created with the encryption property enabled. The default encryption policy is to prompt for a passphrase, which must be a minimum of 8 characters in length.

# zfs create -o encryption=on tank/cindys
Enter passphrase for 'tank/cindys': xxx
Enter again: xxx

An encryption policy is set when a ZFS dataset is created. A dataset's encryption policy is inherited by descendent file systems and cannot be removed.

For more information, see Encrypting ZFS File Systems.

ZFS Send Stream Enhancements

Oracle Solaris 11 Express, build 148: In this Solaris release, you can set file system properties that are sent and received in a snapshot stream. These enhancements provide flexibility in applying file system properties in a send stream to the receiving file system or in determining whether the local file system properties should be ignored when received, such as a mountpoint property value.

For more information, see Applying Different Property Values to a ZFS Snapshot Stream.

ZFS Snapshot Differences (zfs diff)

Oracle Solaris 11 Express, build 147: In this Solaris release, you can determine ZFS snapshot differences by using the zfs diff command.

For example, the following two snapshots are created:

$ ls /tank/cindys
fileA
$ zfs snapshot tank/cindys@0913
$ ls /tank/cindys
fileA  fileB
$ zfs snapshot tank/cindys@0914

Identify the snapshot differences. For example:

$ zfs diff tank/cindys@0913 tank/cindys@0914
M       /tank/cindys/
+       /tank/cindys/fileB

In the above output, the M indicates that the directory has been modified. The + indicates that fileB exists in the later snapshot.

For more information, see Identifying ZFS Snapshot Differences (zfs diff).

ZFS Storage Pool Recovery and Performance Enhancements

Oracle Solaris 11 Express, build 146 and build 147: In this Solaris release, the following new ZFS storage pool features are provided:

Tuning ZFS Synchronous Behavior

Oracle Solaris 11 Express, build 140: In this Solaris release, you can determine a ZFS file system's synchronous behavior by using the sync property.

The default synchronous behavior is to write all synchronous file system transactions to the intent log and to flush all devices to ensure the data is stable. Disabling the default synchronous behavior is not recommended. Applications that depend on synchronous support might be impacted and data loss could occur.

The property can be set before or after the dataset is created, and it takes effect immediately. For example:

# zfs set sync=always tank/perrin

The zil_disable parameter is no longer available in Solaris releases that include the sync property.

For more information, see Table 6-1.

Improved ZFS Pool Messages

Oracle Solaris 11 Express, build 140: In this Solaris release, you can use the -T option to provide an interval and count value for the zpool list and zpool status commands to display additional information.

In addition, more pool scrub and resilver information is provided in the zpool status command as follows:

The following syntax uses the interval and count option to display ongoing pool resilvering information. You can use the -T d value to display the information the standard date format or -T u to display the information by using an internal format.

# zpool status -T d tank 3 2
Thu Apr  8 06:46:39 PDT 2010
  pool: tank
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scan: resilver in progress since Thu Apr  8 06:46:18 2010
    81.3M scanned out of 202M at 3.69M/s, 0h0m to go
    37.0M resilvered, 40.21% done
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c2t3d0  ONLINE       0     0     0
            c2t4d0  ONLINE       0     0     0
          mirror-1  ONLINE       0     0     0
            c2t7d0  ONLINE       0     0     0
            c2t8d0  ONLINE       0     0     0 (resilvering)

errors: No known data errors

ZFS ACL Interoperability Improvements

Oracle Solaris 11 Express, build 139: In this Solaris release, the following ACL improvements are provided:

For more information, see Chapter 8, Using ACLs and Attributes to Protect Oracle Solaris ZFS Files.

Splitting a Mirrored ZFS Storage Pool (zpool split)

Oracle Solaris 11 Express, build 140: In this Solaris release, you can use the zpool split command to split a mirrored storage pool, which detaches a disk or disks in the original mirrored pool to create another identical pool.

For more information, see Creating a New Pool By Splitting a Mirrored ZFS Storage Pool.

Solaris iSCSI Changes

Oracle Solaris 11 Express, build 136: In this Solaris release, the Solaris iSCSI target daemon is replaced by using the COMSTAR target daemon. This also means that the shareiscsi property that was used to share a ZFS volume as an iSCSI LUN is no longer available. Use the sbdadm command to configure and share a ZFS volume as an iSCSI LUN.

For more information, see Using a ZFS Volume as a Solaris iSCSI LUN.

New ZFS System Process

Oracle Solaris 11 Express, build 129: In this Solaris release, each ZFS storage pool has an associated process, zpool-poolname. The threads in this process are the pool's I/O processing threads to handle I/O tasks, such as compression and checksumming, that are associated with the pool. The purpose of this process is to provide visibility into each storage pool's CPU utilization. Information about these process can be reviewed by using the ps and prstat commands. These processes are only available in the global zone. For more information, see SDC(7).

ZFS Deduplication Property

Oracle Solaris 11 Express, build 128: In this Solaris release, you can use the deduplication property to remove redundant data from your ZFS file systems. If a file system has the dedup property enabled, duplicate data blocks are removed synchronously. The result is that only unique data is stored and common components are shared between files.

You can enable this property as follows:

# zfs set dedup=on tank/home

Although deduplication is set as a file system property, the scope is pool-wide. For example, you can identify the deduplication ratio as follows:

# zpool list tank
NAME    SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank    136G  55.2G  80.8G    40%  2.30x  ONLINE  -

The zpool list output has been updated to support the deduplication property. For more information, see Changes to the zpool list Command.

For more information setting the deduplication property, see The dedup Property.

Do not enable the dedup property on file systems on production systems until you review the following considerations:

For more information about these considerations, see this FAQ:

http://hub.opensolaris.org/bin/view/Community+Group+zfs/dedup

Changes to the zpool list Command

Oracle Solaris 11 Express, build 128: In this Solaris release, the zpool list output has changed to provide better space allocation information. For example:

# zpool list tank
NAME    SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
tank    136G  55.2G  80.8G    40%  ONLINE  -

The previous USED and AVAIL fields have been replaced with ALLOC and FREE.

The ALLOC field identifies the amount of physical space allocated to all datasets and internal metadata. The FREE field identifies the amount of unallocated space in the pool.

For more information, see Displaying Information About ZFS Storage Pools.

ZFS Storage Pool Recovery

Oracle Solaris 11 Express, build 128: A storage pool can become damaged if underlying devices become unavailable, a power failure occurs, or if more than the supported number of devices fail in a redundant ZFS configuration. This release provides new command features for recovering your damaged storage pool. However, using this recovery feature means that the last few transactions that occurred prior to the pool outage might be lost.

Both the zpool clear and zpool import commands support the -F option to possibly recover a damaged pool. In addition, running the zpool status, zpool clear, or zpool import command automatically report a damaged pool and these commands describe how to recover the pool.

For more information, see Repairing ZFS Storage Pool-Wide Damage.

ZFS Log Device Enhancements

Oracle Solaris 11 Express, builds 122–125: The following log device enhancements are available:

Triple Parity RAIDZ (raidz3)

Oracle Solaris 11 Express, build 120: In this Solaris release, a redundant RAID-Z configuration can now have either single-, double-, or triple-parity, which means that one, two, three device failures can be sustained respectively, without any data loss. You can specify the raidz3 keyword for a triple-parity RAID-Z configuration. For more information, see Creating a RAID-Z Storage Pool.

Holding ZFS Snapshots

Oracle Solaris 11 Express, build 120: If you implement different automatic snapshot policies so that older snapshots are being inadvertently destroyed by zfs receive because they no longer exist on the sending side, you might consider using the snapshots hold feature in this Solaris release.

Holding a snapshot prevents it from being destroyed. In addition, this feature allows a snapshot with clones to be deleted pending the removal of the last clone by using the zfs destroy -d command.

You can hold a snapshot or set of snapshots. For example, the following syntax puts a hold tag, keep, on tank/home/cindys/snap@1.

# zfs hold keep tank/home/cindys@snap1

For more information, see Holding ZFS Snapshots.

ZFS Device Replacement Enhancements

Oracle Solaris 11 Express, build 120: In this Solaris release, a system event or sysevent is provided when an underlying device is expanded. ZFS has been enhanced to recognize these events and adjusts the pool based on the new size of the expanded LUN, depending on the setting of the autoexpand property. You can use the autoexpand pool property to enable or disable automatic pool expansion when a dynamic LUN expansion event is received.

These features enable you to expand a LUN and the resulting pool can access the expanded space without having to export and import pool or reboot the system.

For example, automatic LUN expansion is enabled on the tank pool.

# zpool set autoexpand=on tank

Or, you can create the pool with the autoexpand property enabled.

# zpool create -o autoexpand=on tank c1t13d0

The autoexpand property is disabled by default so you can decide whether you want the LUN expanded or not.

A LUN can also be expanded by using the zpool online -e command. For example:

# zpool online -e tank c1t6d0

Or, you can reset the autoexpand property after the LUN is attached or made available by using the zpool replace feature. For example, the following pool is created with one 8-GB disk (c0t0d0). The 8-GB disk is replaced with a 16-GB disk (c1t13d0), but the pool size is not expanded until the autoexpand property is enabled.

# zpool create pool c0t0d0
# zpool list
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
pool   8.44G  76.5K  8.44G     0%  ONLINE  -
# zpool replace pool c0t0d0 c1t13d0
# zpool list
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
pool   8.44G  91.5K  8.44G     0%  ONLINE  -
# zpool set autoexpand=on pool
# zpool list
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
pool   16.8G   91.5K  16.8G    0%  ONLINE  -

Another way to expand the LUN in the above example without enabling the autoexpand property, is to use the zpool online -e command even though the device is already online. For example:

# zpool create tank c0t0d0
# zpool list tank
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
tank   8.44G  76.5K  8.44G     0%  ONLINE  -
# zpool replace tank c0t0d0 c1t13d0
# zpool list tank
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
tank   8.44G  91.5K  8.44G     0%  ONLINE  -
# zpool online -e tank c1t13d0
# zpool list tank
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
tank   16.8G    90K  16.8G     0%  ONLINE  -

Additional device replacement enhancements in this release include the following features:

For more information about replacing devices, see Replacing Devices in a Storage Pool.

ZFS User and Group Quotas

Oracle Solaris 11 Express, build 120: In previous Solaris releases, you could apply quotas and reservations to ZFS file systems to manage and reserve disk space.

In this Solaris release, you can set a quota on the amount of disk space consumed by files that are owned by a particular user or group. You might consider setting user and group quotas in an environment with a large number of users or groups.

You can set a user quota by using the zfs userquota property. To set a group quota, use the zfs groupquota property. For example:

# zfs set userquota@user1=5G tank/data
# zfs set groupquota@staff=10G tank/staff/admins

You can display a user's or a group's current quota setting as follows:

# zfs get userquota@user1 tank/data
NAME       PROPERTY         VALUE            SOURCE
tank/data  userquota@user1  5G               local
# zfs get groupquota@staff tank/staff/admins
NAME               PROPERTY          VALUE             SOURCE
tank/staff/admins  groupquota@staff  10G               local

Display general quota information as follows:

# zfs userspace tank/data
TYPE        NAME   USED  QUOTA  
POSIX User  root     3K   none  
POSIX User  user1     0    5G  
# zfs groupspace tank/staff/admins
TYPE         NAME   USED  QUOTA  
POSIX Group  root     3K   none  
POSIX Group  staff     0    10G  

You can display an individual user's disk space usage by viewing the userused@user property. A group's disk space usage can be viewed by using the groupused@group property. For example:

# zfs get userused@user1 tank/staff
NAME        PROPERTY        VALUE           SOURCE
tank/staff  userused@user1  213M            local
# zfs get groupused@staff tank/staff
NAME        PROPERTY         VALUE            SOURCE
tank/staff  groupused@staff  213M             local

For more information about setting user quotas, see Setting ZFS Quotas and Reservations.

ZFS ACL Pass Through Inheritance for Execute Permission

Oracle Solaris 11 Express, build 120: In previous Solaris releases, you could apply ACL inheritance so that all files are created with 0664 or 0666 permissions. In this release, if you want to optionally include the execute bit from the file creation mode into the inherited ACL, you can set the aclinherit mode to pass the execute permission to the inherited ACL.

If aclinherit=passthrough-x is enabled on a ZFS dataset, you can include execute permission for an output file that is generated from cc or gcc compiler tools. If the inherited ACL does not include execute permission, then the executable output from the compiler won't be executable until you use the chmod command to change the file's permissions.

For more information, see Example 8-13.

Automatic ZFS Snapshots

Oracle Solaris 11 Express, build 120: This release includes the Time Slider snapshot tool. This tool automatically snapshots ZFS file systems and allows you to browse and recover snapshots of file systems. For more information, see Managing Automatic ZFS Snapshots.

ZFS Property Enhancements

Oracle Solaris 11 Express, build 120: The following ZFS file system enhancements are included in these releases.

ZFS Log Device Recovery

Oracle Solaris 11 Express, build 120: In this release, ZFS identifies intent log failures in the zpool status command output. Fault Management Architecture (FMA) reports these errors as well. Both ZFS and FMA describe how to recover from an intent log failure.

For example, if the system shuts down abruptly before synchronous write operations are committed to a pool with a separate log device, you see messages similar to the following:

# zpool status -x
  pool: pool
 state: FAULTED
status: One or more of the intent logs could not be read.
        Waiting for adminstrator intervention to fix the faulted pool.
action: Either restore the affected device(s) and run 'zpool online',
        or ignore the intent log records by running 'zpool clear'.
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        pool        FAULTED      0     0     0 bad intent log
          mirror    ONLINE       0     0     0
            c0t1d0  ONLINE       0     0     0
            c0t4d0  ONLINE       0     0     0
        logs        FAULTED      0     0     0 bad intent log
          c0t5d0    UNAVAIL      0     0     0 cannot open

You can resolve the log device failure in the following ways:

To recover from this error without replacing the failed log device, you can clear the error with the zpool clear command. In this scenario, the pool will operate in a degraded mode and the log records will be written to the main pool until the separate log device is replaced.

Consider using mirrored log devices to avoid the log device failure scenario.

Using ZFS ACL Sets

Oracle Solaris 11 Express, build 120: This release provides the ability to apply NFSv4–style ACLs in sets, rather than apply different ACL permissions individually. The following ACL sets are provided:

These ACL sets are prefined and cannot be modified.

For more information about using ACL sets, see Example 8-5.

Using Cache Devices in Your ZFS Storage Pool

Oracle Solaris 11 Express, build 120: In this release, when you create a pool, you can specify cache devices, which are used to cache storage pool data.

Cache devices provide an additional layer of caching between main memory and disk. Using cache devices provides the greatest performance improvement for random-read workloads of mostly static content.

One or more cache devices can be specified when the pool is created. For example:

# zpool create pool mirror c0t2d0 c0t4d0 cache c0t0d0
# zpool status pool
  pool: pool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        pool        ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c0t2d0  ONLINE       0     0     0
            c0t4d0  ONLINE       0     0     0
        cache
          c0t0d0    ONLINE       0     0     0

errors: No known data errors

After cache devices are added, they gradually fill with content from main memory. Depending on the size of your cache device, it could take over an hour for the device to fill. Capacity and reads can be monitored by using the zpool iostat command as follows:

# zpool iostat -v pool 5

Cache devices can be added or removed from a pool after the pool is created.

For more information, see Creating a ZFS Storage Pool With Cache Devices and Example 4-4.

ZFS Root Pool Management

Oracle Solaris 11 Express, build 120: This Oracle Solaris release uses a ZFS root file system by default. For more information about managing root pool components, see Chapter 5, Managing ZFS Root Pool Components.

Rolling Back a Dataset Without Unmounting

Oracle Solaris 11 Express, build 120: This release enables you to roll back a dataset without unmounting it first. Thus, the zfs rollback -f option is no longer needed to force an unmount operation. The -f option is no longer supported and is ignored, if specified.

Enhancements to the zfs send Command

Oracle Solaris 11 Express, build 120: This release includes the following enhancements to the zfs send command. Using this command, you can now perform the following tasks:

For more information, see Sending and Receiving Complex ZFS Snapshot Streams.

ZFS Quotas and Reservations for File System Data Only

Oracle Solaris 11 Express, build 120: In addition to the existing ZFS quota and reservation features, this release includes dataset quotas and reservations that do not include descendents, such as snapshots and clones, in the disk space accounting.

For example, you can set a 10-GB refquota limit for studentA that sets a 10-GB hard limit of referenced disk space. For additional flexibility, you can set a 20-GB quota that enables you to manage studentA's snapshots.

# zfs set refquota=10g tank/studentA
# zfs set quota=20g tank/studentA

For more information, see Setting ZFS Quotas and Reservations.

ZFS File System Properties for the Solaris CIFS Service

Oracle Solaris 11 Express, build 120: This release provides support for the Solaris Common Internet File System (CIFS) service. This product provides the ability to share files between Solaris and Windows or MacOS systems.

To facilitate sharing files between these systems by using the Solaris CIFS service, the following new ZFS properties are provided:

Currently, the sharesmb property is available to share ZFS files in the Solaris CIFS environment. More ZFS CIFS-related properties will be available in an upcoming release. For information about using the sharesmb property, see Sharing and Unsharing ZFS File Systems.

In addition to the ZFS properties added for supporting the Solaris CIFS software product, the vscan property is available for scanning ZFS files if you have a 3rd-party virus scanning engine.

ZFS Storage Pool Properties

Oracle Solaris 11 Express, build 120: ZFS storage pool properties were introduced in an earlier release. This release provides two properties, cachefile and failmode.

The following describes the new storage pool properties in this release:

ZFS and File System Mirror Mounts

Oracle Solaris 11 Express, build 120: In this Solaris release, NFSv4 mount enhancements are provided to make ZFS file systems more accessible to NFS clients.

When file systems are created on the NFS server, the NFS client can automatically discover these newly created file systems within their existing mount of a parent file system.

For example, if the server neo already shares the tank file system and client zee has it mounted, /tank/baz is automatically visible on the client after it is created on the server.

zee# mount neo:/tank /mnt
zee# ls /mnt
baa    bar

neo# zfs create tank/baz

zee% ls /mnt
baa    bar    baz
zee% ls /mnt/baz
file1    file2 

ZFS Command History Enhancements (zpool history)

Oracle Solaris 11 Express, build 120: The zpool history command has been enhanced to provide the following new features:

For more information about using the zpool history command, see Resolving Problems With ZFS.

Upgrading ZFS File Systems (zfs upgrade)

Oracle Solaris 11 Express, build 120: The zfs upgrade command is included in this release to provide future ZFS file system enhancements to existing file systems. ZFS storage pools have a similar upgrade feature to provide pool enhancements to existing storage pools.

For example:

# zfs upgrade
This system is currently running ZFS filesystem version 3.

All filesystems are formatted with the current version.

Note - File systems that are upgraded and any streams created from those upgraded file systems by the zfs send command are not accessible on systems that are running older software releases.


ZFS Delegated Administration

Oracle Solaris 11 Express, build 120: In this release, you can grant fine-grained permissions to allow nonprivileged users to perform ZFS administration tasks.

You can use the zfs allow and zfs unallow commands to delegate and remove permissions.

You can modify delegated administration with the pool's delegation property. For example:

# zpool get delegation users
NAME  PROPERTY    VALUE       SOURCE
users  delegation  on          default
# zpool set delegation=off users
# zpool get delegation users
NAME  PROPERTY    VALUE       SOURCE
users  delegation  off         local

By default, the delegation property is enabled.

For more information, see Chapter 9, Oracle Solaris ZFS Delegated Administration and zfs(1M).

Setting Up Separate ZFS Log Devices

Oracle Solaris 11 Express, build 120: The ZFS intent log (ZIL) is provided to satisfy POSIX requirements for synchronous transactions. For example, databases often require their transactions to be on stable storage devices when returning from a system call. NFS and other applications can also use fsync() to ensure data stability. By default, the ZIL is allocated from blocks within the main storage pool. In this Solaris release, you can decide if you want the ZIL blocks to continue to be allocated from the main storage pool or from a separate log device. Better performance might be possible by using separate intent log devices in your ZFS storage pool, such as with NVRAM or a dedicated disk.

Log devices for the ZFS intent log are not related to database log files.

You can set up a ZFS log device when the storage pool is created or after the pool is created. For examples of setting up log devices, see Creating a ZFS Storage Pool With Log Devices and Adding Devices to a Storage Pool.

You can attach a log device to an existing log device to create a mirrored log device. This operation is identical to attaching a device in a unmirrored storage pool.

Consider the following points when determining whether setting up a ZFS log device is appropriate for your environment:

Creating Intermediate ZFS Datasets

Oracle Solaris 11 Express, build 120: You can use the -p option with the zfs create, zfs clone, and zfs rename commands to quickly create a non-existent intermediate dataset, if it doesn't already exist.

In the following example, ZFS datasets (users/area51) are created in the datab storage pool.

# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
datab                       106K  16.5G    18K  /datab
# zfs create -p -o compression=on datab/users/area51

If the intermediate dataset already exists during the create operation, the operation completes successfully.

Properties specified apply to the target dataset, not to the intermediate dataset. For example:

# zfs get mountpoint,compression datab/users/area51
NAME                PROPERTY     VALUE                SOURCE
datab/users/area51  mountpoint   /datab/users/area51  default
datab/users/area51  compression  on                   local

The intermediate dataset is created with the default mount point. Any additional properties are disabled for the intermediate dataset. For example:

# zfs get mountpoint,compression datab/users
NAME         PROPERTY     VALUE         SOURCE
datab/users  mountpoint   /datab/users  default
datab/users  compression  off           default

For more information, see zfs(1M).

ZFS Hot-Plugging Enhancements

Oracle Solaris 11 Express, build 120: In this release, ZFS more effectively responds to devices that are removed and can now automatically identify devices that are inserted.

For more information, see zpool(1M).

Recursively Renaming ZFS Snapshots (zfs rename -r)

Oracle Solaris 11 Express, build 120: You can recursively rename all descendent ZFS snapshots by using the zfs rename -r command. For example:

First, a snapshot of a set of ZFS file systems is created.

# zfs snapshot -r users/home@today
# zfs list
NAME                     USED  AVAIL  REFER  MOUNTPOINT
users                    216K  16.5G    20K  /users
users/home                76K  16.5G    22K  /users/home
users/home@today            0      -    22K  -
users/home/markm          18K  16.5G    18K  /users/home/markm
users/home/markm@today      0      -    18K  -
users/home/marks          18K  16.5G    18K  /users/home/marks
users/home/marks@today      0      -    18K  -
users/home/neil           18K  16.5G    18K  /users/home/neil
users/home/neil@today       0      -    18K  -

Then, the snapshots are renamed the following day.

# zfs rename -r users/home@today @yesterday
# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
users                        216K  16.5G    20K  /users
users/home                    76K  16.5G    22K  /users/home
users/home@yesterday            0      -    22K  -
users/home/markm              18K  16.5G    18K  /users/home/markm
users/home/markm@yesterday      0      -    18K  -
users/home/marks              18K  16.5G    18K  /users/home/marks
users/home/marks@yesterday      0      -    18K  -
users/home/neil               18K  16.5G    18K  /users/home/neil
users/home/neil@yesterday       0      -    18K  -

A snapshot is the only type of dataset that can be renamed recursively.

For more information about snapshots, see Overview of ZFS Snapshots and this blog entry that describes how to create rolling snapshots:

http://blogs.sun.com/mmusante/entry/rolling_snapshots_made_easy

gzip Compression Is Available for ZFS

Oracle Solaris 11 Express, build 120: In this Solaris release, you can set gzip compression on ZFS file systems, in addition to lzjb compression. You can specify compression as gzip, or gzip-N, where N equals 1 through 9. For example:

# zfs create -o compression=gzip users/home/snapshots
# zfs get compression users/home/snapshots
NAME                  PROPERTY     VALUE            SOURCE
users/home/snapshots  compression  gzip             local
# zfs create -o compression=gzip-9 users/home/oldfiles
# zfs get compression users/home/oldfiles
NAME                  PROPERTY     VALUE           SOURCE
users/home/oldfiles   compression  gzip-9          local

For more information about setting ZFS properties, see Setting ZFS Properties.

Storing Multiple Copies of ZFS User Data

Oracle Solaris 11 Express, build 120: As a reliability feature, ZFS file system metadata is automatically stored multiple times across different disks, if possible. This feature is known as ditto blocks.

In this Solaris release, you can also store multiple copies of user data is also stored per file system by using the zfs set copies command. For example:

# zfs set copies=2 users/home
# zfs get copies users/home
NAME        PROPERTY  VALUE       SOURCE
users/home  copies    2           local

Available values are 1, 2, or 3. The default value is 1. These copies are in addition to any pool-level redundancy, such as in a mirrored or RAID-Z configuration.

The benefits of storing multiple copies of ZFS user data are as follows:


Note - Depending on the allocation of the ditto blocks in the storage pool, multiple copies might be placed on a single disk. A subsequent full disk failure might cause all ditto blocks to be unavailable.


You might consider using ditto blocks when you accidentally create a non-redundant pool and when you need to set data retention policies.

For a detailed description of how storing multiple copies on a system with a single-disk pool or a multiple-disk pool might impact overall data protection, see this blog:

http://blogs.sun.com/relling/entry/zfs_copies_and_data_protection

For more information about setting ZFS properties, see Setting ZFS Properties.

Improved zpool status Output

Oracle Solaris 11 Express, build 120: You can use the zpool status -v command to display a list of files with persistent errors. Previously, you had to use the find -inum command to identify the file names from the list of displayed inodes.

For more information about displaying a list of files with persistent errors, see Repairing a Corrupted File or Directory.

ZFS and Solaris iSCSI Improvements

Oracle Solaris 11 Express, build 120: In this Solaris release, you can create a ZFS volume as a Solaris iSCSI target device by setting the shareiscsi property on the ZFS volume. This method is a convenient way to quickly set up a Solaris iSCSI target. For example:

# zfs create -V 2g tank/volumes/v2
# zfs set shareiscsi=on tank/volumes/v2
# iscsitadm list target
Target: tank/volumes/v2
    iSCSI Name: iqn.1986-03.com.sun:02:984fe301-c412-ccc1-cc80-cf9a72aa062a
    Connections: 0

After the iSCSI target is created, you can set up the iSCSI initiator. For information about setting up a Solaris iSCSI initiator, see Chapter 14, Configuring iSCSI Storage Devices With COMSTAR, in System Administration Guide: Devices and File Systems.

For more information about managing a ZFS volume as an iSCSI target, see Using a ZFS Volume as a Solaris iSCSI LUN.

Sharing ZFS File System Enhancements

Oracle Solaris 11 Express, build 120: In this Solaris release, the process of sharing file systems has been improved. Although modifying system configuration files, such as /etc/dfs/dfstab, is unnecessary for sharing ZFS file systems, you can use the sharemgr command to manage ZFS share properties. The sharemgr command enables you to set and manage share properties on share groups. ZFS shares are automatically designated in the zfs share group.

As in previous releases, you can set the ZFS sharenfs property on a ZFS file system to share a ZFS file system. For example:

# zfs set sharenfs=on tank/home

Or, you can use the new sharemgr add-share subcommand to share a ZFS file system in the zfs share group. For example:

# sharemgr add-share -s tank/data zfs
# sharemgr show -vp zfs
zfs nfs=()
    zfs/tank/data
          /tank/data
          /tank/data/1
          /tank/data/2
          /tank/data/3

Then, you can use the sharemgr command to manage ZFS shares. The following example shows how to use sharemgr to set the nosuid property on the shared ZFS file systems. You must preface ZFS share paths with a /zfs designation.

# sharemgr set -P nfs -p nosuid=true zfs/tank/data
# sharemgr show -vp zfs
zfs nfs=()
    zfs/tank/data nfs=(nosuid="true")
          /tank/data
          /tank/data/1
          /tank/data/2
          /tank/data/3

For more information, see sharemgr(1M).

ZFS Command History (zpool history)

Oracle Solaris 11 Express, build 120: In this Solaris release, ZFS automatically logs successful zfs and zpool commands that modify pool state information. For example:

# zpool history
History for 'newpool':
2007-04-25.11:37:31 zpool create newpool mirror c0t8d0 c0t10d0
2007-04-25.11:37:46 zpool replace newpool c0t10d0 c0t9d0
2007-04-25.11:38:04 zpool attach newpool c0t9d0 c0t11d0
2007-04-25.11:38:09 zfs create newpool/user1
2007-04-25.11:38:15 zfs destroy newpool/user1

History for 'tank':
2007-04-25.11:46:28 zpool create tank mirror c1t0d0 c2t0d0 mirror c3t0d0 c4t0d0

This features enables you or Oracle support personnel to identify the actual ZFS commands that were executed to troubleshoot an error scenario.

You can identify a specific storage pool with the zpool history command. For example:

# zpool history newpool
History for 'newpool':
2007-04-25.11:37:31 zpool create newpool mirror c0t8d0 c0t10d0
2007-04-25.11:37:46 zpool replace newpool c0t10d0 c0t9d0
2007-04-25.11:38:04 zpool attach newpool c0t9d0 c0t11d0
2007-04-25.11:38:09 zfs create newpool/user1
2007-04-25.11:38:15 zfs destroy newpool/user1

In this Solaris release, the zpool history command does not record user-ID, hostname, or zone-name. For more information, see ZFS Command History Enhancements (zpool history).

For more information about troubleshooting ZFS problems, see Resolving Problems With ZFS.

ZFS Property Improvements

ZFS xattr Property

Oracle Solaris 11 Express, build 120: You can use the xattr property to disable or enable extended attributes for a specific ZFS file system. The default value is on. For a description of ZFS properties, see Introducing ZFS Properties.

ZFS canmount Property

Oracle Solaris 11 Express, build 120: The new canmount property enables you to specify whether a dataset can be mounted by using the zfs mount command. For more information, see The canmount Property.

ZFS User Properties

Oracle Solaris 11 Express, build 120: In addition to the standard native properties that can be used to either export internal statistics or control ZFS file system behavior, ZFS provides user properties. User properties have no effect on ZFS behavior, but you can use them to annotate datasets with information that is meaningful in your environment.

For more information, see ZFS User Properties.

Setting Properties When Creating ZFS File Systems

Oracle Solaris 11 Express, build 120: In this Solaris release, you can set properties when you create a file system, not just after the file system is created.

The following examples illustrate equivalent syntax:

# zfs create tank/home
# zfs set mountpoint=/export/zfs tank/home
# zfs set sharenfs=on tank/home
# zfs set compression=on tank/home
# zfs create -o mountpoint=/export/zfs -o sharenfs=on -o compression=on tank/home

Displaying All ZFS File System Information

Oracle Solaris 11 Express, build 120: In this Solaris release, you can use various forms of the zfs get command to display information about all datasets if you do not specify a dataset or if you specify all. In previous releases, all dataset information was not retreivable with the zfs get command.

For example:

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

New zfs receive -F Option

Oracle Solaris 11 Express, build 120: In this Solaris release, you can use the new -F option to the zfs receive command to force a rollback of the file system to the most recent snapshot before the receive is initiated. Using this option might be necessary when the file system is modified after a rollback occurs but before the receive is initiated.

For more information, see Receiving a ZFS Snapshot.

Recursive ZFS Snapshots

Oracle Solaris 11 Express, build 120: When you use the zfs snapshot command to create a file system snapshot, you can use the -r option to recursively create snapshots for all descendent file systems. In addition, you can use the -r option to recursively destroy all descendent snapshots when a snapshot is destroyed.

Recursive ZFS snapshots are created quickly as one atomic operation. The snapshots are created together (all at once) or not created at all. The benefit of such an operation is that the snapshot data is always taken at one consistent time, even across descendent file systems.

For more information, see Creating and Destroying ZFS Snapshots.

Double-Parity RAID-Z (raidz2)

Oracle Solaris 11 Express, build 120: A redundant RAID-Z configuration can now have either a single- or double-parity configuration, which means that one or two device failures, respectively, can be sustained, without any data loss. You can specify the raidz2 keyword for a double-parity RAID-Z configuration. Or, you can specify the raidz or raidz1 keyword for a single-parity RAID-Z configuration.

For more information, see Creating a RAID-Z Storage Pool or zpool(1M).

Hot Spares for ZFS Storage Pool Devices

Oracle Solaris 11 Express, build 120: The ZFS hot spares feature enables you to identify disks that could be used to replace a failed or faulted device in one or more storage pools. Designating a device as a hot spare means that if an active device in the pool fails, the hot spare automatically replaces the failed device. Or, you can manually replace a device in a storage pool with a hot spare.

For more information, see Designating Hot Spares in Your Storage Pool and zpool(1M).

Replacing a ZFS File System With a ZFS Clone (zfs promote)

Oracle Solaris 11 Express, build 120: The zfs promote command enables you to replace an existing ZFS file system with a clone of that file system. This feature is helpful when you want to run tests on an alternative version of a file system and then make that alternative version the active file system.

For more information, see Replacing a ZFS File System With a ZFS Clone and zfs(1M).

Upgrading ZFS Storage Pools (zpool upgrade)

Oracle Solaris 11 Express, build 120: You can upgrade your storage pools to a newer version of ZFS to take advantage of the latest features by using the zpool upgrade command. In addition, the zpool status command has been modified to notify you when your pools are running older versions of ZFS.

For more information, see Upgrading ZFS Storage Pools and zpool(1M).

Using ZFS to Clone Non-Global Zones and Other Enhancements

Oracle Solaris 11 Express, build 120: When the source zonepath and the target zonepath both reside on ZFS and are in the same pool, zoneadm clone now automatically uses the ZFS clone feature to clone a zone. This enhancement means that zoneadm clone will take a ZFS snapshot of the source zonepath and set up the target zonepath. The snapshot is named SUNWzoneX, where X is a unique ID used to distinguish between multiple snapshots. The destination zone's zonepath is used to name the ZFS clone. A software inventory is performed so that a snapshot used at a future time can be validated by the system. Note that you can still specify that the ZFS zonepath be copied instead of the ZFS clone, if desired.

To clone a source zone multiple times, a new parameter added to zoneadm allows you to specify that an existing snapshot should be used. The system validates that the existing snapshot is usable on the target. Additionally, the zone install process now has the capability to detect when a ZFS file system can be created for a zone, and the uninstall process can detect when a ZFS file system in a zone can be destroyed. These steps are then performed automatically by the zoneadm command.

Keep the following points in mind when using ZFS on a system with Solaris containers installed:

For more information, see System Administration Guide: Oracle Solaris Zones, Oracle Solaris 10 Containers, and Resource Management.

ZFS Backup and Restore Commands Are Renamed

Oracle Solaris 11 Express, build 120: In this Solaris release, the zfs backup and zfs restore commands are renamed to zfs send and zfs receive to more accurately describe their functions. These commands send and receive ZFS data stream representations.

For more information about these commands, see Sending and Receiving ZFS Data.

Recovering Destroyed Storage Pools

Oracle Solaris 11 Express, build 120: This release includes the zpool import -D command, which enables you to recover pools that were previously destroyed with the zpool destroy command.

For more information, see Recovering Destroyed ZFS Storage Pools.

ZFS Is Integrated With Fault Manager

Oracle Solaris 11 Express, build 120: This release includes a ZFS diagnostic engine that is capable of diagnosing and reporting pool failures and device failures. Checksum, I/O, device, and pool errors associated with pool or device failures are also reported.

The diagnostic engine does not include predictive analysis of checksum and I/O errors, nor does it include proactive actions based on fault analysis.

If a ZFS failure occurs, you might see a message similar to the following:

SUNW-MSG-ID: ZFS-8000-D3, TYPE: Fault, VER: 1, SEVERITY: Major
EVENT-TIME: Wed Jun 30 14:53:39 MDT 2010
PLATFORM: SUNW,Sun-Fire-880, CSN: -, HOSTNAME: neo
SOURCE: zfs-diagnosis, REV: 1.0
EVENT-ID: 504a1188-b270-4ab0-af4e-8a77680576b8
DESC: A ZFS device failed.  Refer to http://sun.com/msg/ZFS-8000-D3 for more information.
AUTO-RESPONSE: No automated response will occur.
IMPACT: Fault tolerance of the pool may be compromised.
REC-ACTION: Run 'zpool status -x' and replace the bad device.

By reviewing the recommended action, which is to follow the more specific directions in the zpool status command, you can quickly identify and resolve the failure.

For an example of recovering from a reported ZFS problem, see Resolving a Missing Device.

The zpool clear Command

Oracle Solaris 11 Express, build 120: This release includes the zpool clear command for clearing error counts associated with a device or a pool. Previously, error counts were cleared when a device in a pool was brought online with the zpool online command. For more information, see Clearing Storage Pool Device Errors and zpool(1M).

Compact NFSv4 ACL Format

Oracle Solaris 11 Express, build 120: In this release, you can set and display NFSv4 ACLs in two formats: verbose and compact. You can use the chmod command to set either ACL formats. You can use the ls -V command to display the compact ACL format. You can use the ls -v command to display the verbose ACL format.

For more information, see Setting and Displaying ACLs on ZFS Files in Compact Format, chmod(1), and ls(1).

File System Monitoring Tool (fsstat)

Oracle Solaris 11 Express, build 120: A new file system monitoring tool, fsstat, reports file system operations. Activity can be reported by mount point or by file system type. The following example shows general ZFS file system activity:

$ fsstat zfs
 new  name   name  attr  attr lookup rddir  read read  write write
 file remov  chng   get   set    ops   ops   ops bytes   ops bytes
7.82M 5.92M 2.76M 1.02G 3.32M  5.60G 87.0M  363M 1.86T 20.9M  251G zfs

For more information, see fsstat(1M).