Why are du -h / du / df / df -h not refreshing when extracting a large file












3














I am running tar in the background, eg:



tar xfvz large_file.tar.gz    &


It does extract my file, but when I then launch du -h, du, df or df -h, the output remains the same, and I have to wait few minutes for it to refresh.



Is there any workaround? That's not really a problem, I am asking this for my own Unix culture about du & df & so on.










share|improve this question





























    3














    I am running tar in the background, eg:



    tar xfvz large_file.tar.gz    &


    It does extract my file, but when I then launch du -h, du, df or df -h, the output remains the same, and I have to wait few minutes for it to refresh.



    Is there any workaround? That's not really a problem, I am asking this for my own Unix culture about du & df & so on.










    share|improve this question



























      3












      3








      3







      I am running tar in the background, eg:



      tar xfvz large_file.tar.gz    &


      It does extract my file, but when I then launch du -h, du, df or df -h, the output remains the same, and I have to wait few minutes for it to refresh.



      Is there any workaround? That's not really a problem, I am asking this for my own Unix culture about du & df & so on.










      share|improve this question















      I am running tar in the background, eg:



      tar xfvz large_file.tar.gz    &


      It does extract my file, but when I then launch du -h, du, df or df -h, the output remains the same, and I have to wait few minutes for it to refresh.



      Is there any workaround? That's not really a problem, I am asking this for my own Unix culture about du & df & so on.







      filesystems mount kernel disk-usage






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 12 at 8:37









      Kusalananda

      121k16228372




      121k16228372










      asked Dec 12 at 8:25









      user325489

      182




      182






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Probably the data has not actually been written to disk yet but is still in the page cache ("dirty pages"). Check with



          grep Dirty /proc/meminfo


          You can try to run sync before df/du. That should force any data in the page cache to be written to disk.






          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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f487519%2fwhy-are-du-h-du-df-df-h-not-refreshing-when-extracting-a-large-file%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









            1














            Probably the data has not actually been written to disk yet but is still in the page cache ("dirty pages"). Check with



            grep Dirty /proc/meminfo


            You can try to run sync before df/du. That should force any data in the page cache to be written to disk.






            share|improve this answer




























              1














              Probably the data has not actually been written to disk yet but is still in the page cache ("dirty pages"). Check with



              grep Dirty /proc/meminfo


              You can try to run sync before df/du. That should force any data in the page cache to be written to disk.






              share|improve this answer


























                1












                1








                1






                Probably the data has not actually been written to disk yet but is still in the page cache ("dirty pages"). Check with



                grep Dirty /proc/meminfo


                You can try to run sync before df/du. That should force any data in the page cache to be written to disk.






                share|improve this answer














                Probably the data has not actually been written to disk yet but is still in the page cache ("dirty pages"). Check with



                grep Dirty /proc/meminfo


                You can try to run sync before df/du. That should force any data in the page cache to be written to disk.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 12 at 19:47









                Kusalananda

                121k16228372




                121k16228372










                answered Dec 12 at 19:44









                WerKater

                713




                713






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2funix.stackexchange.com%2fquestions%2f487519%2fwhy-are-du-h-du-df-df-h-not-refreshing-when-extracting-a-large-file%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

                    List directoties down one level, excluding some named directories and files

                    list processes belonging to a network namespace

                    list systemd RuntimeDirectory mounts