badblocks replacement successor for huge disks?
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-integer-as-start-end-values>
On Wed, 22 Dec 2021 17:27:03 +0100 cagsm <cumandgets0mem00f@gmail.com> 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-integer-as-start-end-values>
At the end of https://wiki.archlinux.org/title/badblocks is one suggestion. Other sources suggest badblocks is obsolete. Just run SMART and if it shows any bad blocks, replace the disk.
Dave Howorth wrote:
Other sources suggest badblocks is obsolete. Just run SMART and if it shows any bad blocks, replace the disk.
badblocks is from another era. MFM formatted 5.25" drives and such. I second the suggestion, just run SMART, regularly. smartd, iow. -- Per Jessen, Zürich (-2.0°C)
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-integer-as-start-end-values>
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)
thanks for the replies. just wondering what the actual reasoning would be to not make badblocks use all blocks any more and limit it to 32bit counters, and disabling it for huge disks. some original author of that tool is even an suse employee or something i think, would like to hear why they decided to simply not traverse all the blocks of a huge block device. is this some limitation in some actual hardware layers or apis that cant themselves deal with larger than 32bit counters for those blocks or something? ty
On 22.12.21 22:49, Carlos E. R. wrote:
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-integer-as-start-end-values>
I don't think badblocks was "only" for floppies. It was useful with hard disks before SMART became prevalent, somewhere after 2000.
I venture to say that it isn't SMART itself, but the fact that modern HDDs (and SSDs) have enough "intelligence" to do their own bad blocks re-assignment, so from the outside one would not find any bad blocks by eg reading the disk from begin to end (might take some time anyway). The old HDDs addressed the data according to the physical layout: cylinder/head/sector (CHS) while the more modern disks have Linear Block Addresses (LBA) allowing the HDD logic to put more sectors/track on the outer tracks than on the inner tracks and also to do bad sector management by keeping spare sectors around the disk and re-assign bad sectors without the user noticing. NB There are disk commands that can be used to read the mapping table (which can be read out in physical addresses: CHS) and so discover eg if most bad sectors are under one head or more on the inside of the disk. For SCSI/SAS this is "READ DEFECT DATA", I don't recall the corresponding SATA command, it may be vendor specific.(*) SMART will tell you how many bad blocks have already been re-assigned and if there are only a very few replacement blocks left, then the disk should be replaced.
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.
You may not be able to buy disk drives WITHOUT ANY defects, especially consumer grade drives but also server grade drives! Vendors pack so much data on the platters that it is virtually impossible NOT to have any bad sectors (*)
It depends a lot. What does scares me, is a growing list of bad sectors.
Very true (*) Josef (*) My previous employer was a server manufacturer and we also did our own mass storage device qualification and inspection: from every palette of incoming disk drives, a certain percentage was selected *randomly* and shipped to the test center, the rest was "frozen", and if more than a certain number of disks failed the tests (eg initially had more than <n> bad sectors), the whole palette was returned to the vendor (for quite some time management thought that "the vendors will never dare send us bad disks, so why bother testing?", then customers began to complain and we re-introduced testing and then this happened quite often until the vendors learned their lesson). We also also investigated customer complaints. One of my tasks had been to first support but then to completely re-develop an extensive disk test suite, as the original code was unable to handle >32 bit LBAs and no SATA and it turned out to be impossible to just modify the code, so I went and re-wrote the whole caboodle. While I only developed the code base, which provided "primitives" for the tests, and the test people wrote scripts to test devices (some tests lasted more than a week with 100% disk load), I did have some interesting discussions with them. At this very moment the code of the test suite sleeps on a virtual machine (SLES11SP4) on a powered down machine, so I can't quickly check what the commands are. I anyone really wants to know more details, feel free to send me a PM next year and then I can check.
participants (5)
-
cagsm
-
Carlos E. R.
-
Dave Howorth
-
Josef Möllers
-
Per Jessen