From nobody Thu Oct 10 11:57:49 2024 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPSts31Mvz5YwDd for ; Thu, 10 Oct 2024 11:57:57 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id 4XPStq6lC7z47nw for ; Thu, 10 Oct 2024 11:57:55 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of rfg@tristatelogic.com designates 69.62.255.118 as permitted sender) smtp.mailfrom=rfg@tristatelogic.com; dmarc=none Received: by segfault.tristatelogic.com (Postfix, from userid 1237) id 1A29C4E690; Thu, 10 Oct 2024 04:57:49 -0700 (PDT) From: "Ronald F. Guilmette" To: questions@freebsd.org Subject: How to zero a failing disk drive before disposal? List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5116.1728561468.1@segfault.tristatelogic.com> Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Oct 2024 04:57:49 -0700 Message-ID: <5117.1728561469@segfault.tristatelogic.com> X-Spamd-Result: default: False [-2.10 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.995]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; RCVD_NO_TLS_LAST(0.10)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:14051, ipnet:69.62.128.0/17, country:US]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; R_DKIM_NA(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; DMARC_NA(0.00)[tristatelogic.com]; MISSING_XM_UA(0.00)[] X-Rspamd-Queue-Id: 4XPStq6lC7z47nw X-Spamd-Bar: -- I have a pretty ancient 4TB spinning rust drive (WD4001FAEX) that is unamb= iguously at death's door: 1 Raw_Read_Error_Rate 0x002f 200 173 051 Pre-fail Always = - 0 3 Spin_Up_Time 0x0027 167 161 021 Pre-fail Always = - 10641 4 Start_Stop_Count 0x0032 100 100 000 Old_age Always = - 155 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always = - 1 7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always = - 0 9 Power_On_Hours 0x0032 099 099 000 Old_age Always = - 829 10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always = - 0 11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always = - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always = - 80 192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always = - 24 193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always = - 130 194 Temperature_Celsius 0x0022 126 098 000 Old_age Always = - 26 196 Reallocated_Event_Count 0x0032 199 199 000 Old_age Always = - 1 197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always = - 36 198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline = - 32 199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always = - 0 200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline = - 40 In addition to the above clear indications of failure, "smartctl -t long" = dies almost immediately with a fatal error. Now I plan to dispose of the drive (appropriately, at a proper e-waste rec= ycling place) however there may be some confidential data on the thing that should be wi= ped first... because I'm paranoid. I used to own an old RadioShack bulk tape eraser (basically just a big ele= ctromagnet) that I would use on drives before disposing of them but I don't have that = any more. I could try using smartctl to initiate a secure erase, but for various rea= sons it would just be more convenient if I could just dd /dev/zero to the thing. But th= ere's a catch. According to what I have read, dd will halt if it encounters a write error= . That's a clear problem in this context. Also, according to the dd man page, the co= nv=3Dnoerror option for dd won't really be helpful in this case since that just prevent= s dd from stopping on _input_ errors. Any suggestions? If worse comes to worse I guess I will end up writing my= own tiny little C program to just write 4KB blocks to a designated output file whil= e ignoring all output errors, but I don't want to reinvent the wheel if somebody else= already created something I can use in this context. Suggestions welcome.