From nobody Tue Sep 20 05:45:55 2022 X-Original-To: freebsd-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 4MWrBG1b09z4dCgP for ; Tue, 20 Sep 2022 05:45:58 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MWrBF4J9Gz3XXT for ; Tue, 20 Sep 2022 05:45:57 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: by mail-pl1-x62c.google.com with SMTP id v1so1318704plo.9 for ; Mon, 19 Sep 2022 22:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date; bh=USu/pM4FcaRVM/aF1wJ7itkq1KRdmYR7PYYDfNj91pA=; b=c9MN71LYUE3Teysl7BoKEM09q5Ioh2gz8STcU4iQApVbqay5RxZrhUmc/23M5/0Aum WvQ11njKmer6doZNTjb7M9WZVbsTK321aSbKBJOz/+fs5GxbHdQ0EAS0mOkkefGPQ9iB 500doi5pLQcxUqoYZBevQ5+ova2FYcqiK1+RM0K+OS+DoTCjVmd1Sm9roENtfIQXkzK5 Cj9gB3oru9TmVuUkKoRcEjhHtxg7cqHE2XNdHp5YfuVRTus4WeqEc2xHRcnTuW1/5EBb Gj9ohMt1iSbnxt7fvlO6BxcgKlGtPZ7RpIMFC70eWWANeyDAuT+QBZ03T6ph7Rx4BBAr CsPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=USu/pM4FcaRVM/aF1wJ7itkq1KRdmYR7PYYDfNj91pA=; b=6QoZwmpkrcFlN3QN5We4O11fbjdV9z84A1p7lFtqYJzsQZ3lYdplCMN0DVO30YQjfg rnMdoxm/y26q6G55heMmVprebud09NoUUhOTBOYVCsJ6HGrF9MFc9vP+RiXc4/vukl6h vpE9diSMwpT4RcNLYCTbzLDKhY0pn2s/5SUEqnWsTcyEmmjBNAgcs53qSI2te+OWmkzJ Q+OFxhmcQyELfMtKzcHq8ChUMPH5HYN/PN8aXcQSrvkaj5TJrHAQhPrDH60X0bU0bZ3J uiQFnJ7mN2Tp6lpefCEqZr2uxpnmoQVnWGsqvlo1ULeuKqIjSX96RLG7N/Hs9jPDBAe4 oQ1g== X-Gm-Message-State: ACrzQf24PElw9De23mZid1JxZcixFiyLx5d94NBRnHcDePVOEaGyFoTs BlOCu4kbiC0h/yUrheDnSrpsdydRKBIWAtpDiTU5e4gqv03gJZWe X-Google-Smtp-Source: AMsMyM5HkJ5ebJ1c059gc+70QI+3YnsWj2qCzuFS1KMqt+qBPN3Vdt2FijNKlsnuCQqXYloL2sjkEGqZtZnpo3aNo7Q= X-Received: by 2002:a17:90a:d982:b0:203:814d:dde6 with SMTP id d2-20020a17090ad98200b00203814ddde6mr2093728pjv.66.1663652755730; Mon, 19 Sep 2022 22:45:55 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Received: by 2002:a17:902:ccc9:b0:175:41cd:2693 with HTTP; Mon, 19 Sep 2022 22:45:55 -0700 (PDT) In-Reply-To: References: From: grarpamp Date: Tue, 20 Sep 2022 01:45:55 -0400 Message-ID: Subject: Re: disk non-destructive bad-block write/fix? To: freebsd-questions@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4MWrBF4J9Gz3XXT X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=c9MN71LY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of grarpamp@gmail.com designates 2607:f8b0:4864:20::62c as permitted sender) smtp.mailfrom=grarpamp@gmail.com X-Spamd-Result: default: False [-2.79 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-0.98)[-0.977]; NEURAL_HAM_MEDIUM(-0.94)[-0.942]; NEURAL_HAM_SHORT(-0.87)[-0.872]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62c:from]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org] X-ThisMailContainsUnwantedMimeParts: N > throwing a lot of errors USB... reseat cables. > Is there a way to exercise the free blocks on a ufs disk and move all > defective ones to the bad-block list? That's function of the hw, not the fs. If you want to nuke the fs and do that to the disk dd if=/dev/urandom of=/dev/da0 bs=1m If not, then you can pray to hit most of the fs data areas with dd if=/dev/urandom of=/mnt/bigrandfile bs=1m but that's a prayer. Better to buy enough media to have backups of backups. > Or is that already happening in the above scenario? Yes most firmwares modepages are set to automatically write-reallocate, you can fiddle those using the scsi/ata/usb spec and camcontrol. Store a sha256 of all the files, read them back to verify and compare to that. > The disk is about 40% full There's probably not a shrinkfs, and without checking where those existing extents are, attempting to create a tailing 60% fs to move the 40% into to write-realloc it... could end up footshot. > wondering if the whole rest of it is trashed dd if=/dev/da0 of=/dev/null bs=1m conv=noerror But that's only a read test, not a write test.