• 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. How to enable or disable telnet in Solaris 10
  2. Determining which network interface will be used for jumpstart installation / network boot
  3. Solaris 11 : How to configure VLAN tagging on a network interface
  4. ZFS Tutorials : Creating ZFS snapshot and clones
  5. Solaris : How to set limit on the maximum number of open files per process
  6. Solaris Volume Manager (SVM) : Understanding metadb Flags
  7. How to Configure TCP Keepalive option in Solaris
  8. LDOMs troubleshooting : guest and control domains can not talk to each other but can talk with anyone else on the network
  9. Complete hardware reference : T1000 / T2000 / T5120 / T5140 / T5220 / T5240 / T5440
  10. How to change hostname in Solaris 8, 9 and 10

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright