Why is /home twice as big as expected?

Clash 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?
filesystems disk-usage
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.
add a comment |Â
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?
filesystems disk-usage
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.
add a comment |Â
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?
filesystems disk-usage
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
filesystems disk-usage
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.
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.
add a comment |Â
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
add a comment |Â
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.
OnLinedPaper is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password