• data-preserving HDD diagnostic program?

    From Winston@21:1/5 to All on Thu Aug 15 11:29:45 2024
    Is there a good FreeBSD HDD diagnostic program?

    The SATA III disk drive I'd like to test is either partially failing or
    has corrupted data. MS Win10's "repair" of the drive isn't fixing it.
    For that and other reasons, I suspect the drive has partially died
    (such as maybe 1 head died or something).

    In any case, I'd like to test it while preserving the data on it.
    E.g., read a block and save its content, write 0101s, verify 0101s,
    write 1010s, verify 1010s, write back original content, verify, print
    map of what failed.

    It's maybe not all that hard to write such a program, but there are
    probably things like disabling low-level retries and any FreeBSD
    caching I know less about.

    In any case, is there such a diagnostic?

    TIA,
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Winston@21:1/5 to All on Thu Aug 15 11:34:35 2024
    I should add: yes, I discovered recoverdisk(1) which looks like a good
    way to copy the disk if I've bought a replacement.
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to Winston on Fri Aug 16 05:51:22 2024
    On Thu, 15 Aug 2024 11:29:45 -0400, Winston wrote:

    Is there a good FreeBSD HDD diagnostic program?

    The SATA III disk drive I'd like to test is either partially failing or
    has corrupted data. MS Win10's "repair" of the drive isn't fixing it.
    For that and other reasons, I suspect the drive has partially died
    (such as maybe 1 head died or something).

    In any case, I'd like to test it while preserving the data on it.
    E.g., read a block and save its content, write 0101s, verify 0101s,
    write 1010s, verify 1010s, write back original content, verify, print
    map of what failed.

    It's maybe not all that hard to write such a program, but there are
    probably things like disabling low-level retries and any FreeBSD
    caching I know less about.

    In any case, is there such a diagnostic?


    Look in /usr/ports/sysutils. There are several tools such as
    smartmontools, hdrecover, recoverdm, etc.

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Winston@21:1/5 to I originally on Fri Aug 16 10:10:13 2024
    I originally asked:
    Is there a good FreeBSD HDD diagnostic program?

    The SATA III disk drive I'd like to test is either partially failing
    or has corrupted data. MS Win10's "repair" of the drive isn't fixing
    it. For that and other reasons, I suspect the drive has partially died
    (such as maybe 1 head died or something).

    to which Marco Moock <mm+usenet-es@dorfdsl.de> kindly replied:
    badblocks can use a read-only mode and also a non-destructive write mode.

    "badblocks"? 'pkg rquery %n badblocks' finds no such program.
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Fri Aug 16 15:25:42 2024
    On 15.08.2024 um 11:29 Uhr Winston wrote:

    Is there a good FreeBSD HDD diagnostic program?

    The SATA III disk drive I'd like to test is either partially failing
    or has corrupted data. MS Win10's "repair" of the drive isn't fixing
    it. For that and other reasons, I suspect the drive has partially died
    (such as maybe 1 head died or something).

    First, create an image of your disk NOW if you need anything that is
    still on your disk. Next time create an automatic backup, so you don't
    depend on such tools.

    badblocks can use a read-only mode and also a non-destructive write
    mode. Be aware: Your disk can fail at any time, don't do more
    experiments without a backup than needed.


    --
    kind regards
    Marco

    Send spam to 1723714185muell@cartoonies.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Fri Aug 16 16:20:07 2024
    On 16.08.2024 um 10:10 Uhr Winston wrote:

    "badblocks"? 'pkg rquery %n badblocks' finds no such program.

    I haven't checked, but here it is listed: https://man.freebsd.org/cgi/man.cgi?query=badblocks&apropos=0&sektion=&manpath=freebsd-ports&format=html#end


    --
    kind regards
    Marco

    Send spam to 1723795813muell@cartoonies.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Detlef Sax@21:1/5 to Marco Moock on Fri Aug 16 16:38:57 2024
    On Fri, 16 Aug 2024 16:20:07 +0200, Marco Moock wrote:
    On 16.08.2024 um 10:10 Uhr Winston wrote:

    "badblocks"? 'pkg rquery %n badblocks' finds no such program.

    I haven't checked, but here it is listed: https://man.freebsd.org/cgi/man.cgi?query=badblocks&apropos=0&sektion=&manpath=freebsd-ports&format=html#end

    pkg which /usr/local/sbin/badblocks
    /usr/local/sbin/badblocks was installed by package e2fsprogs-core-1.47.1

    Sorry but I assume it's only for Linux-filesystems.

    sysutils/smartmontools seem to me the right tool to examine a disk on
    hardware issues.


    Detlef
    --
    https://www.12schrittefrei.de/
    https://www.noart.de/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Fri Aug 16 21:26:08 2024
    On 16.08.2024 um 16:38 Uhr Detlef Sax wrote:

    /usr/local/sbin/badblocks was installed by package
    e2fsprogs-core-1.47.1

    Sorry but I assume it's only for Linux-filesystems.

    IIRC it simply reads (and optionally) writes to the disk - regardless
    of the content.
    In the manpage are some options for parsing the read stuff to
    filesystem programs, but this seems optional to me.

    --
    kind regards
    Marco

    Send spam to 1723819137muell@cartoonies.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Winston@21:1/5 to I originally on Fri Aug 16 18:17:57 2024
    I originally asked:
    Is there a good FreeBSD HDD diagnostic program?

    The SATA III disk drive I'd like to test is either partially failing or
    has corrupted data.

    to which "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu>
    kindly replied:
    There are several tools such as smartmontools, ...

    Wow! I've been interested in finding something that reads and displays
    the S.M.A.R.T. disk info for a while, mostly for another disk that died
    last year, and I see smartctl does that! Bonus! Thanks,
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Detlef Sax@21:1/5 to Marco Moock on Sat Aug 17 08:25:44 2024
    On Fri, 16 Aug 2024 21:26:08 +0200, Marco Moock wrote:
    On 16.08.2024 um 16:38 Uhr Detlef Sax wrote:

    /usr/local/sbin/badblocks was installed by package
    e2fsprogs-core-1.47.1

    Sorry but I assume it's only for Linux-filesystems.

    IIRC it simply reads (and optionally) writes to the disk - regardless
    of the content.
    In the manpage are some options for parsing the read stuff to
    filesystem programs, but this seems optional to me.

    Correcting troubles in ufs filesystems is usually a job for fsck (8).
    It's shipped together with FreeBSD and is not a 3rd party tool in the
    ports intended for linux filesystems.

    Detlef
    --
    https://www.12schrittefrei.de/
    https://www.noart.de/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Winston@21:1/5 to All on Sun Aug 18 00:09:04 2024
    Getting smartmontools turned out to be even more valuable:

    It reports that one of my currently working disk drives expects itself
    to die in the next 24 hours!

    Thanks again for recommending it!
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)