Page 1 of 1

Delete Disk from pool

Posted: 20 Aug 2019 19:06
by gomario
How can I delete a disc from a ZFS pool? The disc has been removed without going thru the proper steps. (The disc died completely!) I tried to replace the dead/non-existant disc with a new one but that command does not work. Afterall you can not replace a non existent disc. Therefore I want to delete the disc completely and resilver the new disc afresh. How can I do that? The ZFS system keeps on "seing" the previous commands and wants me to first bring online the broken disc :shock:
Delete OffLine device from Pool.jpg

Re: Delete Disk from pool

Posted: 23 Aug 2019 15:39
by ms49434
The "error" will disappear once the pool is healthy again. There's no 'forget disk' command in ZFS.
In order to replace a disk you need to provide the GUID of the former disk, i.e. zpool replace My16TbZFS_Pool 5960994339084961882 /dev/da2.

Re: Delete Disk from pool

Posted: 23 Aug 2019 17:58
by gomario
Thank you for the reply. Yes, but for the pool to be healthy again, I have to replace the faulty disc in the first place. Is there a way to "Cancel" the replacing command? The Disc with which I wanted to replace as well as the new disc, are both faulty and OFFLINE!!! The replace command can't not be completed . I have a third 4TB disc which is functioning and I want to use it but the system does not allow me. It keeps on asking to complete the initial replace.
If somehow I could tell the system to "forget" about the offline discs and resilver the new disc using the info from the other 4, functioning ones.

Re: Delete Disk from pool

Posted: 23 Aug 2019 19:41
by ms49434
gomario wrote:
23 Aug 2019 17:58
Thank you for the reply. Yes, but for the pool to be healthy again, I have to replace the faulty disc in the first place. Is there a way to "Cancel" the replacing command? The Disc with which I wanted to replace as well as the new disc, are both faulty and OFFLINE!!! The replace command can't not be completed . I have a third 4TB disc which is functioning and I want to use it but the system does not allow me. It keeps on asking to complete the initial replace.
If somehow I could tell the system to "forget" about the offline discs and resilver the new disc using the info from the other 4, functioning ones.
I don't know what the original disk was before you started to replace it.
Try to gather the original disk GUID by running

Code: Select all

zdb -C My16TbZFS_Pool
Then run

Code: Select all

zpool replace My16TbZFS_Pool [original.disk.guid] [dev.of.new.disk]
if this doesn't work you could try to detach the other disk with

Code: Select all

zpool detach My16TbZFS_Pool [replacement.disk.guid]
and try to replace the (originally) faulted disk using the replace command from above.

Re: Delete Disk from pool

Posted: 24 Aug 2019 09:35
by gomario
Thank you very much. The second advice worked 100%. If someone else ever runs into the same issue: "zpool detach" is the magic command.