Question HDD and badblock

Status
Not open for further replies.

Thread Starter

classicsamus87

Joined Oct 1, 2020
24
HDDs have an automatic function that allocates and isolates defective sectors (badbloccks) preventing files from being written to these sectors? what is the name of this function
 

nsaspook

Joined Aug 27, 2009
16,325
Is this automatic function present on the HDD or Windows? is this function SMART or is it different?
With modern disk drives the bad-blocks function runs on the HDD firmware as it reads raw data from the heads and should be transparent to the OS.

SMART is mainly a statistical front-end to the underlying HDD error detection/correction firmware the gives probability of failure data to a OS level process.
https://www.linuxjournal.com/article/6983
 

eetech00

Joined Jun 8, 2013
4,705
HDDs have an automatic function that allocates and isolates defective sectors (badbloccks) preventing files from being written to these sectors? what is the name of this function
In window its call "chkdsk" and is run from a cmd window.

It will check for errors on the HD and will fix corrupted parts of the filesystem if it can, otherwise it will mark bad blocks so they won't be used.
 

Papabravo

Joined Feb 24, 2006
22,082
In window its call "chkdsk" and is run from a cmd window.

It will check for errors on the HD and will fix corrupted parts of the filesystem if it can, otherwise it will mark bad blocks so they won't be used.
That DOS program is an anachronistic holdover from the days before bad sector management was part of the HDD firmware. I'm pretty sure it's use is deprecated.
 

Thread Starter

classicsamus87

Joined Oct 1, 2020
24
Year 2000 HDDs have firmware with this technology to automatically allocate and isolate badblock bad sectors? I did a lot of research on HDD firmware but I didn't find this information and the name of the technology because SMART is only diagnostic
 

sagor

Joined Mar 10, 2019
1,049
Bad block replacement is automatic. It is done by the HDD firmware, replacing a mapping of the bad block to point to a good spare block. There are only so many spares, once those run out, bad block replacement fails. SMART only shows the status of the drive, and can show how many bad blocks have been replaced so far. (Relocated Sector Count).
That said, once you start getting more than a few bad sectors, that is an indicator that the drive is starting to fail, time to replace it.
 

nsaspook

Joined Aug 27, 2009
16,325
That DOS program is an anachronistic holdover from the days before bad sector management was part of the HDD firmware. I'm pretty sure it's use is deprecated.
Correct.
Chkdsk is using HDD firmware functionality to scan on modern systems. Most soft bad-block errors are repaired transparently to the OS while hard bad-block errors (typically hardware failures so they can’t be fixed by software) are reported up the OS chain to the file-system where programs like Chkdsk repair file structure using redundant data structures not physical disk-blocks. On the physical disk the bad sector will be reallocated from a good sector pool, so reads and writes to that sector will go elsewhere.
 

Thread Starter

classicsamus87

Joined Oct 1, 2020
24
Some people are unaware and do not know how to use the chkdsk command


Year 2000 HDDs have firmware with this technology to automatically allocate and isolate badblock bad sectors?
 

nsaspook

Joined Aug 27, 2009
16,325
Some people are unaware and do not know how to use the chkdsk command


Year 2000 HDDs have firmware with this technology to automatically allocate and isolate badblock bad sectors?
Running chkdsk finds bad sectors by using the HDD firmware (on modern drives using SATA/SAS commands) to read physical layer blocks and the HDD firmware actually repairs or replaces the physical layer bad-block(s). Chkdsk then uses that physical block information in a attempt to repair OS level file-system logical block errors.

Be careful of when you run chkdsk in repair mode as it can transform a bad disk with recoverable data (accidental file deletion, file corruption,viruses or malware) into a smoking pile of cow dung.
 

sagor

Joined Mar 10, 2019
1,049
If the operating system hits a "bad block" in normal use, the disk will flag that block for replacement. This shows up as a "Current Pending Sector". How soon it happens depends on a lot of factors. I've seen it last until a reboot (re-initialization), where the HDD firmware does the re-allocation on a restart of the drive. CHKDSK is a tool that forces a check and re-mapping of bad sectors (if scanned as such), but a bad sector can also be "found" by normal use of the HDD by the operating system.
 

Thread Starter

classicsamus87

Joined Oct 1, 2020
24
chkdsk is manual so this function of relocating and isolating defective sectors of hdd should be automatically and if hdd in the year 2000 had this function


I contacted seagate and wd and they don't know about these functions just say if my hd has badblock replace it with a new hdd
 

nsaspook

Joined Aug 27, 2009
16,325
chkdsk is manual so this function of relocating and isolating defective sectors of hdd should be automatically and if hdd in the year 2000 had this function


I contacted seagate and wd and they don't know about these functions just say if my hd has badblock replace it with a new hdd
Chkdsk functionality is built into the OS background file checking in any modern system including Windows. Running the command line version should rarely be needed.

If you contacted some call center in 'Timbuktu' that's exactly what they've been told to say, some person at a phone bank has no actual knowledge of this subject. Seagate and WD have HD tools that interact directly with the firmware (for low-level defect detection and formatting) so obviously they know about the functions in that firmware.

https://www.seagate.com/files/staticfiles/support/downloads/seatools/seatools-dos-guide.pdf
 

Thread Starter

classicsamus87

Joined Oct 1, 2020
24
I just want to know the name of this automatic relocation and isolation function of HDD badblocks and whether year 2000 HDDS has this function
 

nsaspook

Joined Aug 27, 2009
16,325
'Error detection and correction' and yes, modern drives all have this function in the drive firmware so it's automatic and transparent (mainly) to the user of the HDD.
 

Papabravo

Joined Feb 24, 2006
22,082
ECC stands for Error Correction Code. It refers to a set of check bits that are appended to the data of a sector. It is used to detect errors in a sector of data, and in some cases can be used to correct errors in a sector. The use of such codes dates back to early mass storage devices like magnetic drums, 7-track, and 9-track Magnetic tape. Using these codes to correct errors is computationally intensive and was a challenge for processors of that era. Also you have to remember that disk storage drives had a much smaller capacity a half a century ago. With multi terabyte storage capacities it is just so much more efficient to correct the error once and stop using ANY questionable sectors going forward. Ask yourself this question. What percentage of 2TB is one 4K byte sector. That is:
\[ \frac{2^{12}} {2^{41}}=2^{-29} \approx 186.3\;\text nano\% \]
 
Status
Not open for further replies.
Top