• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Solaris ZFS : How to Offline / Online / Detach / Replace device in a storage pool

by admin

Taking Devices Offline in a Storage Pool

When hardware is unreliable or not functioning properly, ZFS continues to read or write data to the device, assuming that the condition is only temporary. If the condition is not temporary, you can instruct ZFS to ignore the device by taking it offline. You can take a device offline by using the zpool offline command followed by the pool name and the device name. In the code example in the slide, the c1t0d0 device is taken offline. This device is located in the pool named datapool.

# zpool offline datapool c1t0d0
bringing device c1t0d0 offline

When a device is offline:

  • ZFS does not send it any requests.
  • It remains offline after a system reboot
  • It is not detached from the storage pool

By default, the offline state is persistent; consequently, the device remains offline even after the system is rebooted. If you want to take a device offline temporarily and have it automatically returned to the ONLINE state after the system is rebooted, use the “zpool offline -t” command instead.

When a device is taken offline, it is not detached from the storage pool. This means that you cannot use the device in another pool.

Note: Use “zpool offline -t” to take a device offline temporarily.

Detaching Devices from a Storage Pool

To detach a device from a mirrored storage pool, you can use the zpool detach command. For example, if you want to detach the c2t1d0 device that you just attached to the mirrored pool datapool, you can do so by entering the command “zpool detach datapool c2t1d0” as shown in the code example. You can verify that the device has been detached by running the zpool status command again.

# zpool detach datapool c2t1d0
Note: The device should already be offline. This operation is refused if there are no other valid replicas of the data.

Bringing Devices Online in a Storage Pool

To bring back a device online, use the “zpool online” command followed by the pool name and the device name. Data that was added to a storage pool when a device was offline resilvers to the device after it is brought back online.

# zpool online datapool c1t0d0
bringing device c1t0d0 online
Note: You cannot use device onlining to replace a disk. If you take a device offline, replace the drive, and try to bring it online, it remains in the faulted state.

Replacing Devices in a Storage Pool

There are two reasons why you may want or need to replace a device. You may want to replace a device with a larger device, or you may need to replace a failing or failed device. To replace a device, use the “zpool replace” command followed by the pool name and the device name.

If you are physically replacing a device with another device in the same location in a redundant pool, you need to identify only the replaced device. ZFS recognizes that it is a different disk in the same location. In the following example, you are replacing disk c1t1d0 in the pool named datapool.

# zpool replace datapool c1t1d0

If you are replacing a device in a storage pool with a disk in a different location, you must specify both devices. This is shown in the below example, where you are replacing disk c1t1d0 in the pool named datapool with disk c1t2d0.

# zpool replace hrpool c1t1d0 c1t2d0
Note: For the replacement operation to be successful, the replacement device must be greater than or equal to the minimum size of all the devices in a mirror or RAID-Z configuration.
Solaris ZFS : How to Create and Manage Mirrored Storage Pools
Solaris ZFS : How to Designate Hot Spares in a Storage Pool

Filed Under: Solaris, Solaris 11, ZFS

Some more articles you might also be interested in …

  1. Complete Hardware Reference : SPARC T3-1 / T3-2 / T3-4
  2. A beginners guide to Solaris Multipathing Software (MPxIO or STMS)
  3. Solaris Zone Install Fails With Cpio Error
  4. Beginners Guide to Solaris 11 Image Packaging System (IPS)
  5. Solaris 11 : Increasing the size of a vdisk in LDom ( with backend device as ZFS volume )
  6. “Warning: Missing charsets in String to FontSet conversion” – how to resolve the xclock warning message
  7. How to share ZFS as NFS in Solaris 11
  8. Unix file basics : Inode, Soft Vs Hard link, Device files, Named pipes
  9. Complete hardware reference : T1000 / T2000 / T5120 / T5140 / T5220 / T5240 / T5440
  10. Solaris ZFS : How to replace a failed disk in rpool (x86)

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright