Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Sep 2022 16:47:40 +1000
From:      Ian Smith <smithi@nimnet.asn.au>
To:        grarpamp <grarpamp@gmail.com>
Cc:        Gary Aitken <freebsd@dreamchaser.org>,questions@freebsd.org
Subject:   Re: disk non-destructive bad-block write/fix?
Message-ID:  <AA23BE19-C587-4D60-81DA-4695DC2E6421@nimnet.asn.au>
In-Reply-To: <CAD2Ti28Bdm9kZq5umziXPizMXQdV5LZkYixogWmR0=6CBaM11w@mail.gmail.com>
References:  <d687eb29-a3fb-7d91-a2c6-c1e4e1dc7e31@dreamchaser.org> <CAD2Ti28Bdm9kZq5umziXPizMXQdV5LZkYixogWmR0=6CBaM11w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 20 September 2022 3:45:55 pm AEST, grarpamp <grarpamp@gmail=2Ecom> wrote=
:
 > > throwing a lot of errors
 >=20
 > USB=2E=2E=2E reseat cables=2E

Or try another one/s, if external=2E

But first I'd skip to your last point ie read testing, which also could ca=
tch a bad cable=2E  If it's just or mainly that, much angst relieved=2E

 > > Is there a way to exercise the free blocks on a ufs disk and move
 > all
 > > defective ones to the bad-block list?
 >=20
 > That's function of the hw, not the fs=2E

Unless the disk is really ancient, ISTR badblocks(ono) from 2=2E6-REL days=
=2E

 > If you want to nuke the fs and do that to the disk
 > dd if=3D/dev/urandom of=3D/dev/da0 bs=3D1m
 >=20
 > If not, then you can pray to hit most of the fs data areas with
 > dd if=3D/dev/urandom of=3D/mnt/bigrandfile bs=3D1m
 >=20
 > but that's a prayer=2E

And closer to last resort =2E=2E=2E

 > Better to buy enough media to have backups of backups=2E

Ack, and it's so cheap these days=2E

 > > Or is that already happening in the above scenario?
 >=20
 > Yes most firmwares modepages are set to automatically
 > write-reallocate, you can fiddle those using the scsi/ata/usb
 > spec and camcontrol=2E
 >=20
 > Store a sha256 of all the files,
 > read them back to verify and compare to that=2E
 >=20
 > > The disk is about 40% full
 >=20
 > 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=2E=2E=2E could end up footshot=2E

Again, be sure cables are good before such desperate measures=2E

 > > wondering if the whole rest of it is trashed
 >=20
 > dd if=3D/dev/da0 of=3D/dev/null bs=3D1m conv=3Dnoerror
 >=20
 > But that's only a read test, not a write test=2E

But nice and safe, for starters - and with noerror reporting all bad bits=
=2E

cheers, Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AA23BE19-C587-4D60-81DA-4695DC2E6421>