Why is /home twice as big as expected?

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











up vote
7
down vote

favorite












I was checking my disk usage today, and ran the following commands (using sudo so I didn't get "permission denied")



$ du -hs /home
26G /home

$ ls -la /home
total 24
drwxr-xr-x 4 root root 4096 Dec 27 2017 .
drwxr-xr-x 25 root root 4096 Oct 1 17:39 ..
drwxrwxr-x 3 root root 4096 Dec 27 2017 .ecryptfs
drwx------ 53 paper paper 12288 Oct 6 14:38 paper`

$ du -hs /home/*
13G /paper


Why is my /home directory exactly twice the size of my user directory, which looks like the only thing in /home?










share|improve this question









New contributor




OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    7
    down vote

    favorite












    I was checking my disk usage today, and ran the following commands (using sudo so I didn't get "permission denied")



    $ du -hs /home
    26G /home

    $ ls -la /home
    total 24
    drwxr-xr-x 4 root root 4096 Dec 27 2017 .
    drwxr-xr-x 25 root root 4096 Oct 1 17:39 ..
    drwxrwxr-x 3 root root 4096 Dec 27 2017 .ecryptfs
    drwx------ 53 paper paper 12288 Oct 6 14:38 paper`

    $ du -hs /home/*
    13G /paper


    Why is my /home directory exactly twice the size of my user directory, which looks like the only thing in /home?










    share|improve this question









    New contributor




    OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      7
      down vote

      favorite









      up vote
      7
      down vote

      favorite











      I was checking my disk usage today, and ran the following commands (using sudo so I didn't get "permission denied")



      $ du -hs /home
      26G /home

      $ ls -la /home
      total 24
      drwxr-xr-x 4 root root 4096 Dec 27 2017 .
      drwxr-xr-x 25 root root 4096 Oct 1 17:39 ..
      drwxrwxr-x 3 root root 4096 Dec 27 2017 .ecryptfs
      drwx------ 53 paper paper 12288 Oct 6 14:38 paper`

      $ du -hs /home/*
      13G /paper


      Why is my /home directory exactly twice the size of my user directory, which looks like the only thing in /home?










      share|improve this question









      New contributor




      OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I was checking my disk usage today, and ran the following commands (using sudo so I didn't get "permission denied")



      $ du -hs /home
      26G /home

      $ ls -la /home
      total 24
      drwxr-xr-x 4 root root 4096 Dec 27 2017 .
      drwxr-xr-x 25 root root 4096 Oct 1 17:39 ..
      drwxrwxr-x 3 root root 4096 Dec 27 2017 .ecryptfs
      drwx------ 53 paper paper 12288 Oct 6 14:38 paper`

      $ du -hs /home/*
      13G /paper


      Why is my /home directory exactly twice the size of my user directory, which looks like the only thing in /home?







      filesystems disk-usage






      share|improve this question









      New contributor




      OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 2 days ago





















      New contributor




      OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      OnLinedPaper

      383




      383




      New contributor




      OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      OnLinedPaper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          20
          down vote



          accepted










          Try executing shopt dotglob in that same shell.



          Chances are that dotglob is off, which causes * expansion (globbing) to not include files and directories the names of which begin with . (including the special directory entries . and .. which I'm fairly certain are never included in wildcard expansion; imagine the mayhem caused if rm -rf ./* expanded so as to include ./..).



          Thus, when you run du -hs /home it counts everything in that directory, but du -hs /home/* expands to only du -hs /home/paper and so only the latter directory is counted.



          Since presumably /home/.ecryptfs contains the encrypted data, it makes sense that it would be about the same size as the decrypted data. Therefore, the files effectively get counted twice, but only when you point du at the parent directory.



          If you shopt -s dotglob to turn on the dotglob setting in that shell session, then run sudo du -hs /home/* again, you will likely see that it shows as the same size as if you run sudo du -hs /home.



          Another way to demonstrate this is to put echo at the beginning of the command. So, for example, instead of du -hs /home/* you could try echo du -hs /home/* which will show how the * is expanded by the shell.




          As an aside, I do recommend that you not start to habitually run everything through sudo. Use sudo when you must, but not otherwise. There should be no need, for example, to run ls -la /home as the superuser; the directory /home is likely to be world readable.






          share|improve this answer


















          • 1




            +1 for explaining the answer! Sure enough, /home/.ecryptfs is the same size as /home/paper. I was using "sudo" in case the directories I wasn't allowed to see were what was taking up all that extra space - I rarely use it otherwise, and I'll remove it from the original question to not confuse others.
            – OnLinedPaper
            2 days ago











          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
          );



          );






          OnLinedPaper is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473678%2fwhy-is-home-twice-as-big-as-expected%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
          20
          down vote



          accepted










          Try executing shopt dotglob in that same shell.



          Chances are that dotglob is off, which causes * expansion (globbing) to not include files and directories the names of which begin with . (including the special directory entries . and .. which I'm fairly certain are never included in wildcard expansion; imagine the mayhem caused if rm -rf ./* expanded so as to include ./..).



          Thus, when you run du -hs /home it counts everything in that directory, but du -hs /home/* expands to only du -hs /home/paper and so only the latter directory is counted.



          Since presumably /home/.ecryptfs contains the encrypted data, it makes sense that it would be about the same size as the decrypted data. Therefore, the files effectively get counted twice, but only when you point du at the parent directory.



          If you shopt -s dotglob to turn on the dotglob setting in that shell session, then run sudo du -hs /home/* again, you will likely see that it shows as the same size as if you run sudo du -hs /home.



          Another way to demonstrate this is to put echo at the beginning of the command. So, for example, instead of du -hs /home/* you could try echo du -hs /home/* which will show how the * is expanded by the shell.




          As an aside, I do recommend that you not start to habitually run everything through sudo. Use sudo when you must, but not otherwise. There should be no need, for example, to run ls -la /home as the superuser; the directory /home is likely to be world readable.






          share|improve this answer


















          • 1




            +1 for explaining the answer! Sure enough, /home/.ecryptfs is the same size as /home/paper. I was using "sudo" in case the directories I wasn't allowed to see were what was taking up all that extra space - I rarely use it otherwise, and I'll remove it from the original question to not confuse others.
            – OnLinedPaper
            2 days ago















          up vote
          20
          down vote



          accepted










          Try executing shopt dotglob in that same shell.



          Chances are that dotglob is off, which causes * expansion (globbing) to not include files and directories the names of which begin with . (including the special directory entries . and .. which I'm fairly certain are never included in wildcard expansion; imagine the mayhem caused if rm -rf ./* expanded so as to include ./..).



          Thus, when you run du -hs /home it counts everything in that directory, but du -hs /home/* expands to only du -hs /home/paper and so only the latter directory is counted.



          Since presumably /home/.ecryptfs contains the encrypted data, it makes sense that it would be about the same size as the decrypted data. Therefore, the files effectively get counted twice, but only when you point du at the parent directory.



          If you shopt -s dotglob to turn on the dotglob setting in that shell session, then run sudo du -hs /home/* again, you will likely see that it shows as the same size as if you run sudo du -hs /home.



          Another way to demonstrate this is to put echo at the beginning of the command. So, for example, instead of du -hs /home/* you could try echo du -hs /home/* which will show how the * is expanded by the shell.




          As an aside, I do recommend that you not start to habitually run everything through sudo. Use sudo when you must, but not otherwise. There should be no need, for example, to run ls -la /home as the superuser; the directory /home is likely to be world readable.






          share|improve this answer


















          • 1




            +1 for explaining the answer! Sure enough, /home/.ecryptfs is the same size as /home/paper. I was using "sudo" in case the directories I wasn't allowed to see were what was taking up all that extra space - I rarely use it otherwise, and I'll remove it from the original question to not confuse others.
            – OnLinedPaper
            2 days ago













          up vote
          20
          down vote



          accepted







          up vote
          20
          down vote



          accepted






          Try executing shopt dotglob in that same shell.



          Chances are that dotglob is off, which causes * expansion (globbing) to not include files and directories the names of which begin with . (including the special directory entries . and .. which I'm fairly certain are never included in wildcard expansion; imagine the mayhem caused if rm -rf ./* expanded so as to include ./..).



          Thus, when you run du -hs /home it counts everything in that directory, but du -hs /home/* expands to only du -hs /home/paper and so only the latter directory is counted.



          Since presumably /home/.ecryptfs contains the encrypted data, it makes sense that it would be about the same size as the decrypted data. Therefore, the files effectively get counted twice, but only when you point du at the parent directory.



          If you shopt -s dotglob to turn on the dotglob setting in that shell session, then run sudo du -hs /home/* again, you will likely see that it shows as the same size as if you run sudo du -hs /home.



          Another way to demonstrate this is to put echo at the beginning of the command. So, for example, instead of du -hs /home/* you could try echo du -hs /home/* which will show how the * is expanded by the shell.




          As an aside, I do recommend that you not start to habitually run everything through sudo. Use sudo when you must, but not otherwise. There should be no need, for example, to run ls -la /home as the superuser; the directory /home is likely to be world readable.






          share|improve this answer














          Try executing shopt dotglob in that same shell.



          Chances are that dotglob is off, which causes * expansion (globbing) to not include files and directories the names of which begin with . (including the special directory entries . and .. which I'm fairly certain are never included in wildcard expansion; imagine the mayhem caused if rm -rf ./* expanded so as to include ./..).



          Thus, when you run du -hs /home it counts everything in that directory, but du -hs /home/* expands to only du -hs /home/paper and so only the latter directory is counted.



          Since presumably /home/.ecryptfs contains the encrypted data, it makes sense that it would be about the same size as the decrypted data. Therefore, the files effectively get counted twice, but only when you point du at the parent directory.



          If you shopt -s dotglob to turn on the dotglob setting in that shell session, then run sudo du -hs /home/* again, you will likely see that it shows as the same size as if you run sudo du -hs /home.



          Another way to demonstrate this is to put echo at the beginning of the command. So, for example, instead of du -hs /home/* you could try echo du -hs /home/* which will show how the * is expanded by the shell.




          As an aside, I do recommend that you not start to habitually run everything through sudo. Use sudo when you must, but not otherwise. There should be no need, for example, to run ls -la /home as the superuser; the directory /home is likely to be world readable.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 17 hours ago

























          answered 2 days ago









          Michael Kjörling

          16.2k84799




          16.2k84799







          • 1




            +1 for explaining the answer! Sure enough, /home/.ecryptfs is the same size as /home/paper. I was using "sudo" in case the directories I wasn't allowed to see were what was taking up all that extra space - I rarely use it otherwise, and I'll remove it from the original question to not confuse others.
            – OnLinedPaper
            2 days ago













          • 1




            +1 for explaining the answer! Sure enough, /home/.ecryptfs is the same size as /home/paper. I was using "sudo" in case the directories I wasn't allowed to see were what was taking up all that extra space - I rarely use it otherwise, and I'll remove it from the original question to not confuse others.
            – OnLinedPaper
            2 days ago








          1




          1




          +1 for explaining the answer! Sure enough, /home/.ecryptfs is the same size as /home/paper. I was using "sudo" in case the directories I wasn't allowed to see were what was taking up all that extra space - I rarely use it otherwise, and I'll remove it from the original question to not confuse others.
          – OnLinedPaper
          2 days ago





          +1 for explaining the answer! Sure enough, /home/.ecryptfs is the same size as /home/paper. I was using "sudo" in case the directories I wasn't allowed to see were what was taking up all that extra space - I rarely use it otherwise, and I'll remove it from the original question to not confuse others.
          – OnLinedPaper
          2 days ago











          OnLinedPaper is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          OnLinedPaper is a new contributor. Be nice, and check out our Code of Conduct.












          OnLinedPaper is a new contributor. Be nice, and check out our Code of Conduct.











          OnLinedPaper is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473678%2fwhy-is-home-twice-as-big-as-expected%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)