On 22/12/2021 17.27, cagsm wrote:
just figured that badblocks tool was having 32bit value issues for sector numbers of sata hdd disks.
just what is the replacement or successor for badblocks? apparently people been discussing this even some upstream bugreport at redhat, but the information give was, that badblocks been actually invented for like floppy disks.
have never heard of anything else than badblocks so far. how to check largeish huge hdd media? any quick resolution of this problem? did i miss a tool ever since badblocks? ty.
https://bugzilla.redhat.com/show_bug.cgi?id=1306522 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764636 https://unix.stackexchange.com/questions/152171/badblocks-only-takes-32-bit-...
I don't think badblocks was "only" for floppies. It was useful with hard disks before SMART became prevalent, somewhere after 2000. I object to the notion of throwing away a disk at the first bad block, unless you have ample funds. I remember a time when hard disks came with a paper list of sectors that were known to be bad, and you had to type them in the low format command to map them out. I have a deep suspicion that the same thing is happening nowdays, but they are silently mapped out at the manufacturer site. In fact, I have used hard disks with known bad sectors for a decade after finding out, with no more errors. It depends a lot. What does scares me, is a growing list of bad sectors. If I remember correctly, the smartctl list people mention using badblocks for locating bad blocks, because the long smart test only outputs one. There is a "BadBlockHowto". See below. You can use: smartctl -l error /dev/diskdevice But, in words of the developer (Christian Franke): +++···················· This is the legacy SMART error log which only supports 28-bit LBAs. This drive apparently logs the LBA registers as 0xff for LBAs greater than 0x0fffffff. Other drives don't log anything in this case. Don't use '-l error', use '-l xerror' instead. Note that '-l xerror' is not included in '-a' but in '-x'. Try also '-l defects' which also included only in '-x'. If supported by the drive, this should print the LBAs of the 8 pending sectors counted in attribute 197/198. ····················++- He also said: +++···················· Some recent drives support the "Pending Defects log". Try 'smartctl -l defects'. This is included in 'smartctl -x' but not in '-a'.
But you could use "dd" or some other disk tools/commands. dd should output when a read error occurs and should also print the sector(s). Look at the manpage and use "noerror".
After such a read scan, some of the bad LBAs should appear in the "SMART (Extended Comprehensive) Error Log." Note: Use 'smartctl -x' because '-a' only prints legacy SMART logs which only support 28-bit LBAs. I often use GNU ddrescue (https://www.gnu.org/software/ddrescue/) for read scans. It writes a map file of good/bad/non-tried byte ranges. This allows to interrupt the scan at any time and resume it later. There is also an option to limit the read rate. See the Bad Blocks HOWTO for a real world use case: https://www.smartmontools.org/wiki/BadBlockHowto#Recoveringamostlyunreadable... ····················++- So we have options to smartctl: -l xerror -l defects -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)