Cannot remove disk added to zpool

I added a disk to a zpool using "zpool add diskname"

My intention was mirror a zpool disk that no mirror; that is a zpool with only one disk. I did not issue the right command. Now, the disk has been added successfully but I cannot remove nor detach it as Solaris 11 thinks it has data on it (it does not).

How do I remove this disk out of the zpool and re-add it as a mirror? Thank you for your time.

Error:

/dev/dsk/c5t5000CCA012B39541d0s0 is part of exported or potentially active ZFS pool vol. Please see zpool(1M).

---------- Post updated at 12:11 PM ---------- Previous update was at 12:08 PM ----------

The disk in question is in DEGRADED status right now but the zpool itself is online. I would like to remove and re-add the one in DEGRADED status.

pool status vol
  pool: vol
 state: DEGRADED
status: One or more devices has been diagnosed as degraded. An attempt
        was made to correct the error. Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or 'fmadm repaired', or replace the device
        with 'zpool replace'.
        Run 'zpool status -v' to see device specific details.
  scan: none requested
config:

        NAME                     STATE     READ WRITE CKSUM
        vol                   DEGRADED     0     0     0
          c3t5000CCA012B3E751d0  ONLINE       0     0     0
          c3t5000CCA012B39541d0  DEGRADED     0     0     0

errors: No known data errors

Unfortunately, a disk added to a pool that way cannot be removed.

Your only option is to backup your data, rebuild the pool properly and reimport your data.

1 Like

Much thanks! I think I'll just clean up the errors and add another disk as a hot spare, then.

---------- Post updated at 12:32 PM ---------- Previous update was at 12:21 PM ----------

Hot spare added, customer happy, lesson learned :smiley:

Hot spare will not protect your data in case of of the disk in raid 0 zpool fails.

Spares are used in raid protected setup (raid1,raidz etc.), when one disk fails it will rebuild a raid array using hot spare automatically or manually depending on the zpool autoreplace policy.

You will need to go with jlliagre suggestion or add two more disk in zpool as mirrors of two devices currently present or risk loosing data due to one of the disk in zpool failing.

1 Like

Agreed and thanks to you both. Next week, I'll be adding one more disk and adding redundancy. Glad this is a test box :b:

Thought I would follow up as a way of saying thank you.

  pool: nbuvol
 state: ONLINE
  scan: none requested
config:

        NAME                       STATE     READ WRITE CKSUM
        nbuvol                     ONLINE       0     0     0
          c3t5000CCA012B3E751d0    ONLINE       0     0     0
          c3t5000CCA012B39541d0    ONLINE       0     0     0
          mirror-2                 ONLINE       0     0     0
            c5t5000CCA012B4325Dd0  ONLINE       0     0     0
            c5t5000CCA00AC56225d0  ONLINE       0     0     0

Your setup still does not offer redundancy. If c3t5000CCA012B3E751d0 or c3t5000CCA012B39541d0 fails, the whole pool will become unavailable.

Do you have any suggestions on how to provide redundancy?

Are those physical disks or LUNs exported from a storage array?

Physical and thank you for the help.

If adding more disks is possible, then you could create mirrored vdevs, by attaching mirror disks to c3t5000CCA012B3E751d0 and c3t5000CCA012B39541d0 . See manual for zpool attach command.

1 Like

Why not just wipe out the zpool mirror that I just added and mirror using those? Pretty much out of disks at this point.

The system will only allow you to detach one disk from that pool. If those are all the disks you can use, then there is no way to provide redundancy without destroying the pool and recreating it from scratch. If you will go this way, this command will create mirrored pool:

zpool create nbuvol mirror c3t5000CCA012B3E751d0 c3t5000CCA012B39541d0 mirror c5t5000CCA012B4325Dd0 c5t5000CCA00AC56225d0

You should tell the disks capacity and what is the intended usage of the pool.

Bartus suggestion will provide the best performance while a raidz will give you 50% more storage. Both will sustain a full disk failure.

300G per disk and the pool hosts log files for a Netback server.