Re: Replacing a REMOVED drive in DEGRADED zpool

From: Matthias Fechner <idefix_at_fechner.net>
Date: Sat, 23 Aug 2025 04:21:13 UTC
Am 21.08.2025 um 16:13 schrieb Robert:
> On 8/20/2025 11:23 PM, Matthias Fechner wrote:
>> Hi Robert,
>>
>> Am 21.08.2025 um 03:55 schrieb Robert:
>>> 1. Run `zpool offline zdb1 ada0p3`
>>> 2. Shut down and pull/insert replacement
>>> 3. Boot up and run `gpart backup ada1 > gpart.ada1` then `gpart 
>>> restore ada0 < gpart.ada1`
>>> 4. Run `zpool replace zdb1 ada0p3 ada0p3` 
>>
>> I have written for this some notes for myself:
>> https://wiki.idefix.fechner.net/freebsd/zfs/#replace-a-failed-disk
>>
>> I do not think you must offline it, you should be able to use replace 
>> command or attach (I would check the man page to verify that for the 
>> version you use).
>
> Thanks, there is some great information inĀ  your document. And detach 
> would not be necessary either? It can be replaced in its current 
> status of REMOVED?
>
if you never did such a restore I suggest you setup a virtual machine in 
a similar way you have your setup (I think do a default install and use 
two additional disc to build an additional zpool is enough).
You can use much smaller discs, it is just to simulate the commands.

If the setup is done, make a snapshot.

Then just remove/detach a disc and see what happens.
Add a new disc and try to replace it in the zpool.

This will give you some practice.

You can ask and read as many as you want, you will only get your answers 
if you try it and a virtual machine is here perfect to test this.

Matthias