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





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















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.










share|improve this question















migrated from serverfault.com Feb 20 '14 at 22:49


This question came from our site for system and network administrators.

























    1















    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.










    share|improve this question















    migrated from serverfault.com Feb 20 '14 at 22:49


    This question came from our site for system and network administrators.





















      1












      1








      1








      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.










      share|improve this question
















      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.







      windows hard-drive ssd chkdsk bad-blocks






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 14 '14 at 20:38









      Chenmunka

      2,79481931




      2,79481931










      asked Feb 20 '14 at 22:25









      user301234user301234

      1816




      1816




      migrated from serverfault.com Feb 20 '14 at 22:49


      This question came from our site for system and network administrators.









      migrated from serverfault.com Feb 20 '14 at 22:49


      This question came from our site for system and network administrators.
























          1 Answer
          1






          active

          oldest

          votes


















          0















          1. Check disk adds an entry to the bad cluster table that is hidden and buried in c:system volume information folder. Chkdsk hides bad sectors. It tells the file system not to use that sector, but does not fix anything.


          2. Sometimes yes, sometimes no. It could mean the hard drives internal detection method has not found it yet.


          3. The disk attempts to copy as much data as it can to the new sector. If it can't be read the new sector is blank or has random data in it.


          4. That is one reason it is done, but it can't always clear all bad sectors. Another valid reason, is privacy. If you sell your computer or hard drive you don't want the next person looking at your data. A 3rd valid reason is to get rid of a really tough virus/rootkit, or etc.


          5. Generally, in the vast majority of cases a power failure does not cause bad sectors. If you have a really really old drive that is already in poor health it might cause a bad sector. You can corrupt the contents of the sector, but the sector itself will remain fully functional. It is usually possible to simple copy over the damaged file with a good copy and all is well.



          If you think of a sector as say a whiteboard(the replacement of the chalkboard). The space is evenly divide into sectors when the power goes off the computer stops writing what is working on and forgets the rest. Therefore, the sector is incomplete, but not physically damaged. Now going back to the whiteboard, image someone slams a brick into it, now there is physically unusable space and that is a bad sector.






          share|improve this answer
























          • Thank you for a detailed response. I sincerely appreciate it! Just some clarifications/amplifications: 1. Chkdsk does not trigger the disk's firmware to mark bad sectors, it's purely high-level? Ex: 0 bad sectors on drive. Chkdsk runs and repairs filesystem. Your low level tool would still see 0 bad sectors?...3. It's fascinating how the OS can't read a bad sector but the disk's firmware sometimes can. Is it b/c it can skip the ECC/CRC check? Again, I really can't thank you enough for your time.

            – user301234
            Feb 21 '14 at 15:40











          • Yes, chkdsk does not always trigger the firmware to mark a sector bad. chkdsk reports "####kb in bad sectors", but only it is run. You could have 100 bad sectors near the end of the hard drive and never know about them unless you do a chkdsk /R or chkdsk /B. If you do have 100 bad sectors you need to replace the drive. It does not skip ECC is reads the sector several different ways/times and hopes that the ECC data will be able to fix the data from one of the reads. A low level tool,depending on how low it is, will see ALL of the bad sectors and how many have been remapped.

            – cybernard
            Feb 22 '14 at 6:25












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f719636%2fbad-sectors-vs-spare-reserve-sectors-and-how-the-os-and-disk-interpret-them%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0















          1. Check disk adds an entry to the bad cluster table that is hidden and buried in c:system volume information folder. Chkdsk hides bad sectors. It tells the file system not to use that sector, but does not fix anything.


          2. Sometimes yes, sometimes no. It could mean the hard drives internal detection method has not found it yet.


          3. The disk attempts to copy as much data as it can to the new sector. If it can't be read the new sector is blank or has random data in it.


          4. That is one reason it is done, but it can't always clear all bad sectors. Another valid reason, is privacy. If you sell your computer or hard drive you don't want the next person looking at your data. A 3rd valid reason is to get rid of a really tough virus/rootkit, or etc.


          5. Generally, in the vast majority of cases a power failure does not cause bad sectors. If you have a really really old drive that is already in poor health it might cause a bad sector. You can corrupt the contents of the sector, but the sector itself will remain fully functional. It is usually possible to simple copy over the damaged file with a good copy and all is well.



          If you think of a sector as say a whiteboard(the replacement of the chalkboard). The space is evenly divide into sectors when the power goes off the computer stops writing what is working on and forgets the rest. Therefore, the sector is incomplete, but not physically damaged. Now going back to the whiteboard, image someone slams a brick into it, now there is physically unusable space and that is a bad sector.






          share|improve this answer
























          • Thank you for a detailed response. I sincerely appreciate it! Just some clarifications/amplifications: 1. Chkdsk does not trigger the disk's firmware to mark bad sectors, it's purely high-level? Ex: 0 bad sectors on drive. Chkdsk runs and repairs filesystem. Your low level tool would still see 0 bad sectors?...3. It's fascinating how the OS can't read a bad sector but the disk's firmware sometimes can. Is it b/c it can skip the ECC/CRC check? Again, I really can't thank you enough for your time.

            – user301234
            Feb 21 '14 at 15:40











          • Yes, chkdsk does not always trigger the firmware to mark a sector bad. chkdsk reports "####kb in bad sectors", but only it is run. You could have 100 bad sectors near the end of the hard drive and never know about them unless you do a chkdsk /R or chkdsk /B. If you do have 100 bad sectors you need to replace the drive. It does not skip ECC is reads the sector several different ways/times and hopes that the ECC data will be able to fix the data from one of the reads. A low level tool,depending on how low it is, will see ALL of the bad sectors and how many have been remapped.

            – cybernard
            Feb 22 '14 at 6:25
















          0















          1. Check disk adds an entry to the bad cluster table that is hidden and buried in c:system volume information folder. Chkdsk hides bad sectors. It tells the file system not to use that sector, but does not fix anything.


          2. Sometimes yes, sometimes no. It could mean the hard drives internal detection method has not found it yet.


          3. The disk attempts to copy as much data as it can to the new sector. If it can't be read the new sector is blank or has random data in it.


          4. That is one reason it is done, but it can't always clear all bad sectors. Another valid reason, is privacy. If you sell your computer or hard drive you don't want the next person looking at your data. A 3rd valid reason is to get rid of a really tough virus/rootkit, or etc.


          5. Generally, in the vast majority of cases a power failure does not cause bad sectors. If you have a really really old drive that is already in poor health it might cause a bad sector. You can corrupt the contents of the sector, but the sector itself will remain fully functional. It is usually possible to simple copy over the damaged file with a good copy and all is well.



          If you think of a sector as say a whiteboard(the replacement of the chalkboard). The space is evenly divide into sectors when the power goes off the computer stops writing what is working on and forgets the rest. Therefore, the sector is incomplete, but not physically damaged. Now going back to the whiteboard, image someone slams a brick into it, now there is physically unusable space and that is a bad sector.






          share|improve this answer
























          • Thank you for a detailed response. I sincerely appreciate it! Just some clarifications/amplifications: 1. Chkdsk does not trigger the disk's firmware to mark bad sectors, it's purely high-level? Ex: 0 bad sectors on drive. Chkdsk runs and repairs filesystem. Your low level tool would still see 0 bad sectors?...3. It's fascinating how the OS can't read a bad sector but the disk's firmware sometimes can. Is it b/c it can skip the ECC/CRC check? Again, I really can't thank you enough for your time.

            – user301234
            Feb 21 '14 at 15:40











          • Yes, chkdsk does not always trigger the firmware to mark a sector bad. chkdsk reports "####kb in bad sectors", but only it is run. You could have 100 bad sectors near the end of the hard drive and never know about them unless you do a chkdsk /R or chkdsk /B. If you do have 100 bad sectors you need to replace the drive. It does not skip ECC is reads the sector several different ways/times and hopes that the ECC data will be able to fix the data from one of the reads. A low level tool,depending on how low it is, will see ALL of the bad sectors and how many have been remapped.

            – cybernard
            Feb 22 '14 at 6:25














          0












          0








          0








          1. Check disk adds an entry to the bad cluster table that is hidden and buried in c:system volume information folder. Chkdsk hides bad sectors. It tells the file system not to use that sector, but does not fix anything.


          2. Sometimes yes, sometimes no. It could mean the hard drives internal detection method has not found it yet.


          3. The disk attempts to copy as much data as it can to the new sector. If it can't be read the new sector is blank or has random data in it.


          4. That is one reason it is done, but it can't always clear all bad sectors. Another valid reason, is privacy. If you sell your computer or hard drive you don't want the next person looking at your data. A 3rd valid reason is to get rid of a really tough virus/rootkit, or etc.


          5. Generally, in the vast majority of cases a power failure does not cause bad sectors. If you have a really really old drive that is already in poor health it might cause a bad sector. You can corrupt the contents of the sector, but the sector itself will remain fully functional. It is usually possible to simple copy over the damaged file with a good copy and all is well.



          If you think of a sector as say a whiteboard(the replacement of the chalkboard). The space is evenly divide into sectors when the power goes off the computer stops writing what is working on and forgets the rest. Therefore, the sector is incomplete, but not physically damaged. Now going back to the whiteboard, image someone slams a brick into it, now there is physically unusable space and that is a bad sector.






          share|improve this answer














          1. Check disk adds an entry to the bad cluster table that is hidden and buried in c:system volume information folder. Chkdsk hides bad sectors. It tells the file system not to use that sector, but does not fix anything.


          2. Sometimes yes, sometimes no. It could mean the hard drives internal detection method has not found it yet.


          3. The disk attempts to copy as much data as it can to the new sector. If it can't be read the new sector is blank or has random data in it.


          4. That is one reason it is done, but it can't always clear all bad sectors. Another valid reason, is privacy. If you sell your computer or hard drive you don't want the next person looking at your data. A 3rd valid reason is to get rid of a really tough virus/rootkit, or etc.


          5. Generally, in the vast majority of cases a power failure does not cause bad sectors. If you have a really really old drive that is already in poor health it might cause a bad sector. You can corrupt the contents of the sector, but the sector itself will remain fully functional. It is usually possible to simple copy over the damaged file with a good copy and all is well.



          If you think of a sector as say a whiteboard(the replacement of the chalkboard). The space is evenly divide into sectors when the power goes off the computer stops writing what is working on and forgets the rest. Therefore, the sector is incomplete, but not physically damaged. Now going back to the whiteboard, image someone slams a brick into it, now there is physically unusable space and that is a bad sector.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 21 '14 at 3:28









          cybernardcybernard

          10.5k31828




          10.5k31828













          • Thank you for a detailed response. I sincerely appreciate it! Just some clarifications/amplifications: 1. Chkdsk does not trigger the disk's firmware to mark bad sectors, it's purely high-level? Ex: 0 bad sectors on drive. Chkdsk runs and repairs filesystem. Your low level tool would still see 0 bad sectors?...3. It's fascinating how the OS can't read a bad sector but the disk's firmware sometimes can. Is it b/c it can skip the ECC/CRC check? Again, I really can't thank you enough for your time.

            – user301234
            Feb 21 '14 at 15:40











          • Yes, chkdsk does not always trigger the firmware to mark a sector bad. chkdsk reports "####kb in bad sectors", but only it is run. You could have 100 bad sectors near the end of the hard drive and never know about them unless you do a chkdsk /R or chkdsk /B. If you do have 100 bad sectors you need to replace the drive. It does not skip ECC is reads the sector several different ways/times and hopes that the ECC data will be able to fix the data from one of the reads. A low level tool,depending on how low it is, will see ALL of the bad sectors and how many have been remapped.

            – cybernard
            Feb 22 '14 at 6:25



















          • Thank you for a detailed response. I sincerely appreciate it! Just some clarifications/amplifications: 1. Chkdsk does not trigger the disk's firmware to mark bad sectors, it's purely high-level? Ex: 0 bad sectors on drive. Chkdsk runs and repairs filesystem. Your low level tool would still see 0 bad sectors?...3. It's fascinating how the OS can't read a bad sector but the disk's firmware sometimes can. Is it b/c it can skip the ECC/CRC check? Again, I really can't thank you enough for your time.

            – user301234
            Feb 21 '14 at 15:40











          • Yes, chkdsk does not always trigger the firmware to mark a sector bad. chkdsk reports "####kb in bad sectors", but only it is run. You could have 100 bad sectors near the end of the hard drive and never know about them unless you do a chkdsk /R or chkdsk /B. If you do have 100 bad sectors you need to replace the drive. It does not skip ECC is reads the sector several different ways/times and hopes that the ECC data will be able to fix the data from one of the reads. A low level tool,depending on how low it is, will see ALL of the bad sectors and how many have been remapped.

            – cybernard
            Feb 22 '14 at 6:25

















          Thank you for a detailed response. I sincerely appreciate it! Just some clarifications/amplifications: 1. Chkdsk does not trigger the disk's firmware to mark bad sectors, it's purely high-level? Ex: 0 bad sectors on drive. Chkdsk runs and repairs filesystem. Your low level tool would still see 0 bad sectors?...3. It's fascinating how the OS can't read a bad sector but the disk's firmware sometimes can. Is it b/c it can skip the ECC/CRC check? Again, I really can't thank you enough for your time.

          – user301234
          Feb 21 '14 at 15:40





          Thank you for a detailed response. I sincerely appreciate it! Just some clarifications/amplifications: 1. Chkdsk does not trigger the disk's firmware to mark bad sectors, it's purely high-level? Ex: 0 bad sectors on drive. Chkdsk runs and repairs filesystem. Your low level tool would still see 0 bad sectors?...3. It's fascinating how the OS can't read a bad sector but the disk's firmware sometimes can. Is it b/c it can skip the ECC/CRC check? Again, I really can't thank you enough for your time.

          – user301234
          Feb 21 '14 at 15:40













          Yes, chkdsk does not always trigger the firmware to mark a sector bad. chkdsk reports "####kb in bad sectors", but only it is run. You could have 100 bad sectors near the end of the hard drive and never know about them unless you do a chkdsk /R or chkdsk /B. If you do have 100 bad sectors you need to replace the drive. It does not skip ECC is reads the sector several different ways/times and hopes that the ECC data will be able to fix the data from one of the reads. A low level tool,depending on how low it is, will see ALL of the bad sectors and how many have been remapped.

          – cybernard
          Feb 22 '14 at 6:25





          Yes, chkdsk does not always trigger the firmware to mark a sector bad. chkdsk reports "####kb in bad sectors", but only it is run. You could have 100 bad sectors near the end of the hard drive and never know about them unless you do a chkdsk /R or chkdsk /B. If you do have 100 bad sectors you need to replace the drive. It does not skip ECC is reads the sector several different ways/times and hopes that the ECC data will be able to fix the data from one of the reads. A low level tool,depending on how low it is, will see ALL of the bad sectors and how many have been remapped.

          – cybernard
          Feb 22 '14 at 6:25


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f719636%2fbad-sectors-vs-spare-reserve-sectors-and-how-the-os-and-disk-interpret-them%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How do I know what Microsoft account the skydrive app is syncing to?

          Grease: Live!

          When does type information flow backwards in C++?