Managing ZFS File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: December 2014

Onlining and Offlining Devices in a Storage Pool

ZFS allows individual devices to be taken offline or brought online. When hardware is unreliable or not functioning properly, ZFS continues to read data from or write data to the device, assuming the condition is only temporary. If the condition is not temporary, you can instruct ZFS to ignore the device by taking it offline. ZFS does not send any requests to an offline device.

Note - Devices do not need to be taken offline in order to replace them.

Taking a Device Offline

You can take a device offline by using the zpool offline command. The device can be specified by path or by short name, if the device is a disk. For example:

# zpool offline tank c0t5000C500335F95E3d0

Consider the following points when taking a device offline:

  • You cannot take a pool offline to the point where it becomes UNAVAIL. For example, you cannot take offline two devices in a raidz1 configuration, nor can you take offline a top-level virtual device.

    # zpool offline tank c0t5000C500335F95E3d0
    cannot offline c0t5000C500335F95E3d0: no valid replicas
  • By default, the OFFLINE state is persistent. The device remains offline when the system is rebooted.

    To temporarily take a device offline, use the zpool offline –t option. For example:

    # zpool offline -t tank c1t0d0

    When the system is rebooted, this device is automatically returned to the ONLINE state.

  • When a device is taken offline, it is not detached from the storage pool. If you attempt to use the offline device in another pool, even after the original pool is destroyed, you see a message similar to the following:

    device is part of exported or potentially active ZFS pool. Please see zpool(1M)

    If you want to use the offline device in another storage pool after destroying the original storage pool, first bring the device online, then destroy the original storage pool.

    Another way to use a device from another storage pool, while keeping the original storage pool, is to replace the existing device in the original storage pool with another comparable device. For information about replacing devices, see Replacing Devices in a Storage Pool.

Offline devices are in the OFFLINE state when you query pool status. For information about querying pool status, see Querying ZFS Storage Pool Status.

For more information on device health, see Determining the Health Status of ZFS Storage Pools.

Bringing a Device Online

After a device is taken offline, it can be brought online again by using the zpool online command. For example:

# zpool online tank c0t5000C500335F95E3d0

When a device is brought online, any data that has been written to the pool is resynchronized with the newly available device. Note that you cannot bring a device online to replace a disk. If you take a device offline, replace the device, and try to bring it online, it remains in the UNAVAIL state.

If you attempt to bring online an UNAVAIL device, a message similar to the following is displayed:

# zpool online tank c0t5000C500335DC60Fd0
warning: device 'c0t5000C500335DC60Fd0' onlined, but remains in faulted state
use 'zpool clear' to restore a faulted device

You might also see the faulted disk message displayed on the console or written to the /var/adm/messages file. For example:

SUNW-MSG-ID: ZFS-8000-LR, TYPE: Fault, VER: 1, SEVERITY: Major
EVENT-TIME: Wed Jun 20 11:35:26 MDT 2012
SOURCE: zfs-diagnosis, REV: 1.0
EVENT-ID: fb6699c8-6bfb-eefa-88bb-81479182e3b7
DESC: ZFS device 'id1,sd@n5000c500335dc60f/a' in pool 'pond' failed to open.
AUTO-RESPONSE: An attempt will be made to activate a hot spare if available.
IMPACT: Fault tolerance of the pool may be compromised.
REC-ACTION: Use 'fmadm faulty' to provide a more detailed view of this event.
Run 'zpool status -lx' for more information. Please refer to the associated
reference document at for the latest
service procedures and policies regarding this diagnosis.

For more information about replacing a faulted device, see Resolving a Missing or Removed Device.

You can use the zpool online –e command to expand a LUN. By default, a LUN that is added to a pool is not expanded to its full size unless the autoexpand pool property is enabled. You can expand the LUN automatically by using the zpool online –e command even if the LUN is already online or if the LUN is currently offline. For example:

# zpool online -e tank c0t5000C500335F95E3d0