Saturday, July 4, 2015

windows - Bad sectors vs spare/reserve sectors and how the OS and disk interpret them

From what I understand, there are two fundamental ways sectors are marked bad:



  • OS performs IO read/write instruction. The sector is replaced with a spare and marked bad.

  • Disk's low-level instructions perform garbage collection (i.e. replace and mark bad sectors with spare sectors), silent from the OS and the user.


I have a few questions by which I'm still perplexed.



  1. When a tool like Windows Chkdsk performs repairs, is it marking the sector bad at the file-system level (high) or sector level (low)?


  2. If the OS reports a bad sector to the user (i.e. again, Chkdsk), does that mean the hard drive has run out of spare sectors?


  3. When the disk replaces bad sectors with spare ones, does it always move/copy the data to the spare? Or, at times, data cannot be moved/copied from the bad sector to the spare? If it's the latter, what data is stored in the bad sector and spare sector?


  4. I understand it's possible to do a low-level format of the disk by zeroing out all the sectors. Is this done to clear logical bad sectors (i.e. failed ECC/CRC check) and mark physical bad sectors?


  5. Finally, let's say Windows shuts down due to a power failure and the disk was still writing to a sector. The machine boots and Chkdsk starts up. If there are spare sectors, whether the error is purely logical (i.e. ECC failure) or physical, will it report to the user that there are no errors because the bad sector has been replaced with a spare?



Thank you very much.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...