In order to use again the same drive in ZFS, if you are sure the disk is not faulty, doing DD to the first 10 GB of the drive is a good start, but you need to do it also at the end of the drive. But there is no need to DD 10 GB, I believe the first and last MB is enough.
I solved it this way:
dd bs=512 if=/dev/zero of=/dev/sdk count=2048 seek=$(($(blockdev --getsz /dev/sdk) - 2048))
dd bs=512 if=/dev/zero of=/dev/sdk count=2048
Then just add the "new" disk back to the ZFS pool. No need to labelclear, scrub, wipe the disk. DD is all you need. You also should not partition the disk after DD. ZFS will not accept any previously partitioned disk.
Then just zpool replace <pool-name> <old-device> <new-device>
normally is the disk-by-id and is the device listed in lsblk
.
Jordanelver
How to replace a failed disk in a ZFS mirror | Jordan Elver | Ruby on Rails Developer, Bristol, UK
How to replace a failed disk in a ZFS mirror | Jordan Elver | Ruby on Rails Developer, Bristol, UK
FreeBSD
How to replace zfs failed drive? | The FreeBSD Forums
When the pool was healthy, a scrub ... do something regularly to catch corrupt files and fix them? ... Click to expand... do a search on the forum for "zfs scrub"....
Tritondatacenter
Understanding and Resolving ZFS Disk Failure
Because scrubbing and resilvering ... scrub" command returns an error. By enabling ZFS autoreplace on a pool (a property disabled by default) you will enable your system to automatically use a spare drive to replace FAULTED/UNAVAIL drives....
Oracle
Oracle
On some systems, such as the Sun Fire x4500, you must unconfigure a disk before you can take it offline. If you are replacing a disk in the same slot position on this system, then you can just run the zpool replace command as described in the first example in this section.
Archlinux
[SOLVED] How to replace a failed drive in a ZFS pool / Kernel & Hardware / Arch Linux Forums
Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Replace the device using 'zpool replace'. see: http://zfsonlinux.org/msg/ZFS-8000-4J scan: resilvered 1.36M in 0h19m with 0 errors on Wed Oct 1 03:59:16 2014 config: NAME STATE READ WRITE CKSUM zfsdatapool ...
Oracle
Replacing a Device in a ZFS Storage Pool
Physically replace the disk (c1t3d0). Ensure that the blue Ready to Remove LED is illuminated before you physically remove the faulted drive.
Dlford
5 Steps to Safely Replace a Drive in a Linux ZFS Array | dlford.io
Let’s lay out an example scenario - say we have a mirrored (RAID1) array, and I just got an Email alert from smartmontools telling me that a drive /dev/sdf is failing in my ZFS RAID 10 array. Before I configure an array, I like to make sure all drive bays are labelled with the corresponding ...
GitHub
RAIDZ1: unable to replace a drive with itself · Issue #2076 · openzfs/zfs
Trying to simulate failure scenarios with a 3+1 RAIDZ1 array in order to prepare for eventualities. # create spfstank raidz1 -o ashift=12 sda sdb sdc sdd # zfs create spfstank/part # dd if=/dev/ran...
Proxmox
[SOLVED] - Need help replacing disk in ZFS | Proxmox Support Forum
Hi guys. I run PBS with ZFS on a pool named RPOOL that contains 4 drives of 4Tb. /dev/sdb was phasing out and gave tons of errors. I did a "ls -a /dev/disk/by-id/", and here is the output concerning ths serial number K4KJ220L: ata-HGST_HUS726040ALA610_K4KJ220L...
45drives
KB450412 - Replacing Drives in ZFS Pool on Ubuntu 20.04 - 45Drives Knowledge Base
September 10, 2021 - You are here: KB Home Ubuntu KB450412 – Replacing Drives in ZFS Pool on Ubuntu 20.04 Table of Contents Scope/DescriptionPrerequisitesStepsThrough Houston UIThrough Command LineVerificationTroubleshooting Scope/Description This article will walk through the steps to replace a failed drive ...
45drives
KB450265 - Replacing Drives in ZFS Pool on Rocky Linux - 45Drives Knowledge Base
April 28, 2022 - You are here: KB Home Rocky Linux KB450265 – Replacing Drives in ZFS Pool on Rocky Linux Table of Contents Scope/DescriptionPrerequisitesThrough HoustonThrough Command LineVerificationTroubleshooting Scope/Description This article will walk through the steps to replace a failed drive in a ...
Nodinrogers
Replacing a drive in a ZFS array in Ubuntu | No D in Rogers
Sooner or later, every system will have a drive failure. ZFS was designed with this in mind. I noticed in my /var/log/kern.log file error messages about one of …