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
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.
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.
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: