e2fsck -n + how to know if need to run e2fsck in order to fix corrupted blocks?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












we want to check the filesystem on the disks as /deb/sdc .... /dev/sdg on each linux redhat machine



the target is to find what are the disks that required e2fsck ( as e2fsck -y /dev/sdb . etc )



according to man page



-n Open the filesystem read-only, and assume an answer of `no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at
the same time as the -p or -y options.


when we run the command ( only example )



 e2fsck -n /dev/sdXX


we get



e2fsck 1.42.9 (28-Dec-2013)
Warning! /dev/sdc is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/sdc: clean, 94/1310720 files, 156685/5242880 blocks


so what need to capture from e2fsck output , that required to run e2fsck ?



e2fsck process



init 1

umount /dev/sdXX

e2fsck -y /dev/sdXX ( or e2fsck -C /dev/sdXX for full details )

init 3






share|improve this question


























    up vote
    0
    down vote

    favorite












    we want to check the filesystem on the disks as /deb/sdc .... /dev/sdg on each linux redhat machine



    the target is to find what are the disks that required e2fsck ( as e2fsck -y /dev/sdb . etc )



    according to man page



    -n Open the filesystem read-only, and assume an answer of `no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at
    the same time as the -p or -y options.


    when we run the command ( only example )



     e2fsck -n /dev/sdXX


    we get



    e2fsck 1.42.9 (28-Dec-2013)
    Warning! /dev/sdc is mounted.
    Warning: skipping journal recovery because doing a read-only filesystem check.
    /dev/sdc: clean, 94/1310720 files, 156685/5242880 blocks


    so what need to capture from e2fsck output , that required to run e2fsck ?



    e2fsck process



    init 1

    umount /dev/sdXX

    e2fsck -y /dev/sdXX ( or e2fsck -C /dev/sdXX for full details )

    init 3






    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      we want to check the filesystem on the disks as /deb/sdc .... /dev/sdg on each linux redhat machine



      the target is to find what are the disks that required e2fsck ( as e2fsck -y /dev/sdb . etc )



      according to man page



      -n Open the filesystem read-only, and assume an answer of `no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at
      the same time as the -p or -y options.


      when we run the command ( only example )



       e2fsck -n /dev/sdXX


      we get



      e2fsck 1.42.9 (28-Dec-2013)
      Warning! /dev/sdc is mounted.
      Warning: skipping journal recovery because doing a read-only filesystem check.
      /dev/sdc: clean, 94/1310720 files, 156685/5242880 blocks


      so what need to capture from e2fsck output , that required to run e2fsck ?



      e2fsck process



      init 1

      umount /dev/sdXX

      e2fsck -y /dev/sdXX ( or e2fsck -C /dev/sdXX for full details )

      init 3






      share|improve this question














      we want to check the filesystem on the disks as /deb/sdc .... /dev/sdg on each linux redhat machine



      the target is to find what are the disks that required e2fsck ( as e2fsck -y /dev/sdb . etc )



      according to man page



      -n Open the filesystem read-only, and assume an answer of `no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at
      the same time as the -p or -y options.


      when we run the command ( only example )



       e2fsck -n /dev/sdXX


      we get



      e2fsck 1.42.9 (28-Dec-2013)
      Warning! /dev/sdc is mounted.
      Warning: skipping journal recovery because doing a read-only filesystem check.
      /dev/sdc: clean, 94/1310720 files, 156685/5242880 blocks


      so what need to capture from e2fsck output , that required to run e2fsck ?



      e2fsck process



      init 1

      umount /dev/sdXX

      e2fsck -y /dev/sdXX ( or e2fsck -C /dev/sdXX for full details )

      init 3








      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '17 at 14:44

























      asked Nov 12 '17 at 14:27









      yael

      2,0251145




      2,0251145




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          You probably are looking for the output of tune2fs rather than e2fsck



          tune2fs -l /dev/sdXX |grep "Filesystem state|Last checked|Check interval"


          which should yield something like this:



          Filesystem state: clean
          Last checked: Mon Nov 28 16:03:44 2016
          Check interval: 31536000 (12 months)





          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f404047%2fe2fsck-n-how-to-know-if-need-to-run-e2fsck-in-order-to-fix-corrupted-blocks%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
            1
            down vote



            accepted










            You probably are looking for the output of tune2fs rather than e2fsck



            tune2fs -l /dev/sdXX |grep "Filesystem state|Last checked|Check interval"


            which should yield something like this:



            Filesystem state: clean
            Last checked: Mon Nov 28 16:03:44 2016
            Check interval: 31536000 (12 months)





            share|improve this answer
























              up vote
              1
              down vote



              accepted










              You probably are looking for the output of tune2fs rather than e2fsck



              tune2fs -l /dev/sdXX |grep "Filesystem state|Last checked|Check interval"


              which should yield something like this:



              Filesystem state: clean
              Last checked: Mon Nov 28 16:03:44 2016
              Check interval: 31536000 (12 months)





              share|improve this answer






















                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                You probably are looking for the output of tune2fs rather than e2fsck



                tune2fs -l /dev/sdXX |grep "Filesystem state|Last checked|Check interval"


                which should yield something like this:



                Filesystem state: clean
                Last checked: Mon Nov 28 16:03:44 2016
                Check interval: 31536000 (12 months)





                share|improve this answer












                You probably are looking for the output of tune2fs rather than e2fsck



                tune2fs -l /dev/sdXX |grep "Filesystem state|Last checked|Check interval"


                which should yield something like this:



                Filesystem state: clean
                Last checked: Mon Nov 28 16:03:44 2016
                Check interval: 31536000 (12 months)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 26 '17 at 4:46









                RubberStamp

                1,4551216




                1,4551216



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f404047%2fe2fsck-n-how-to-know-if-need-to-run-e2fsck-in-order-to-fix-corrupted-blocks%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)