How to add a sector to the list of badblocks for ext4?











up vote
1
down vote

favorite












dumpe2fs -b /dev/sdd1
can dump blocks that are known to be bad by ext4.



How do I manually add a block to that list without redoing mkfs ?










share|improve this question


























    up vote
    1
    down vote

    favorite












    dumpe2fs -b /dev/sdd1
    can dump blocks that are known to be bad by ext4.



    How do I manually add a block to that list without redoing mkfs ?










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      dumpe2fs -b /dev/sdd1
      can dump blocks that are known to be bad by ext4.



      How do I manually add a block to that list without redoing mkfs ?










      share|improve this question













      dumpe2fs -b /dev/sdd1
      can dump blocks that are known to be bad by ext4.



      How do I manually add a block to that list without redoing mkfs ?







      ext4 bad-blocks






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      Benoit-Pierre DEMAINE

      142




      142






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          From man 8 e2fsck:




          -l filename

          Add the block numbers listed in the file specified by filename to the list of bad blocks. The format of this file is the same as the one generated by the badblocks(8) program. Note that the block numbers are based on the blocksize of the filesystem. Hence, badblocks(8) must be given the blocksize of the filesystem in order to obtain correct results. As a result, it is much simpler and safer to use the -c option to e2fsck, since it will assure that the correct parameters are passed to the badblocks program.



          -L filename

          Set the bad blocks list to be the list of blocks specified by filename. (This option is the same as the -l option, except the bad blocks list is cleared before the blocks listed in the file are added to the bad blocks list.)




          I've seen few output files from badblocks that were not empty, so I can tell the general format is simple: one decimal number per line. Numbering starts from 0 but as far as I know e2fsck -l won't accept 0 and will complain about few initial blocks (where some crucial filesystem metadata exist).



          Example file content:



          12345
          678900


          My tests were limited. Try the solution on a scratch monkey first.






          share|improve this answer























            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',
            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%2f1374911%2fhow-to-add-a-sector-to-the-list-of-badblocks-for-ext4%23new-answer', 'question_page');
            }
            );

            Post as a guest
































            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            From man 8 e2fsck:




            -l filename

            Add the block numbers listed in the file specified by filename to the list of bad blocks. The format of this file is the same as the one generated by the badblocks(8) program. Note that the block numbers are based on the blocksize of the filesystem. Hence, badblocks(8) must be given the blocksize of the filesystem in order to obtain correct results. As a result, it is much simpler and safer to use the -c option to e2fsck, since it will assure that the correct parameters are passed to the badblocks program.



            -L filename

            Set the bad blocks list to be the list of blocks specified by filename. (This option is the same as the -l option, except the bad blocks list is cleared before the blocks listed in the file are added to the bad blocks list.)




            I've seen few output files from badblocks that were not empty, so I can tell the general format is simple: one decimal number per line. Numbering starts from 0 but as far as I know e2fsck -l won't accept 0 and will complain about few initial blocks (where some crucial filesystem metadata exist).



            Example file content:



            12345
            678900


            My tests were limited. Try the solution on a scratch monkey first.






            share|improve this answer



























              up vote
              0
              down vote













              From man 8 e2fsck:




              -l filename

              Add the block numbers listed in the file specified by filename to the list of bad blocks. The format of this file is the same as the one generated by the badblocks(8) program. Note that the block numbers are based on the blocksize of the filesystem. Hence, badblocks(8) must be given the blocksize of the filesystem in order to obtain correct results. As a result, it is much simpler and safer to use the -c option to e2fsck, since it will assure that the correct parameters are passed to the badblocks program.



              -L filename

              Set the bad blocks list to be the list of blocks specified by filename. (This option is the same as the -l option, except the bad blocks list is cleared before the blocks listed in the file are added to the bad blocks list.)




              I've seen few output files from badblocks that were not empty, so I can tell the general format is simple: one decimal number per line. Numbering starts from 0 but as far as I know e2fsck -l won't accept 0 and will complain about few initial blocks (where some crucial filesystem metadata exist).



              Example file content:



              12345
              678900


              My tests were limited. Try the solution on a scratch monkey first.






              share|improve this answer

























                up vote
                0
                down vote










                up vote
                0
                down vote









                From man 8 e2fsck:




                -l filename

                Add the block numbers listed in the file specified by filename to the list of bad blocks. The format of this file is the same as the one generated by the badblocks(8) program. Note that the block numbers are based on the blocksize of the filesystem. Hence, badblocks(8) must be given the blocksize of the filesystem in order to obtain correct results. As a result, it is much simpler and safer to use the -c option to e2fsck, since it will assure that the correct parameters are passed to the badblocks program.



                -L filename

                Set the bad blocks list to be the list of blocks specified by filename. (This option is the same as the -l option, except the bad blocks list is cleared before the blocks listed in the file are added to the bad blocks list.)




                I've seen few output files from badblocks that were not empty, so I can tell the general format is simple: one decimal number per line. Numbering starts from 0 but as far as I know e2fsck -l won't accept 0 and will complain about few initial blocks (where some crucial filesystem metadata exist).



                Example file content:



                12345
                678900


                My tests were limited. Try the solution on a scratch monkey first.






                share|improve this answer














                From man 8 e2fsck:




                -l filename

                Add the block numbers listed in the file specified by filename to the list of bad blocks. The format of this file is the same as the one generated by the badblocks(8) program. Note that the block numbers are based on the blocksize of the filesystem. Hence, badblocks(8) must be given the blocksize of the filesystem in order to obtain correct results. As a result, it is much simpler and safer to use the -c option to e2fsck, since it will assure that the correct parameters are passed to the badblocks program.



                -L filename

                Set the bad blocks list to be the list of blocks specified by filename. (This option is the same as the -l option, except the bad blocks list is cleared before the blocks listed in the file are added to the bad blocks list.)




                I've seen few output files from badblocks that were not empty, so I can tell the general format is simple: one decimal number per line. Numbering starts from 0 but as far as I know e2fsck -l won't accept 0 and will complain about few initial blocks (where some crucial filesystem metadata exist).



                Example file content:



                12345
                678900


                My tests were limited. Try the solution on a scratch monkey first.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited yesterday

























                answered yesterday









                Kamil Maciorowski

                22.2k155072




                22.2k155072






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1374911%2fhow-to-add-a-sector-to-the-list-of-badblocks-for-ext4%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest




















































































                    Popular posts from this blog

                    Aardman Animations

                    Are they similar matrix

                    “minimization” problem in Euclidean space related to orthonormal basis