Why is my directory empty and large?
This commit is contained in:
18
2006-03-02-why-is-my-directory-empty-and-large.html
Normal file
18
2006-03-02-why-is-my-directory-empty-and-large.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<!--# set var="title" value="Why is my directory empty and large?" -->
|
||||||
|
<!--# set var="date" value="March 2, 2006" -->
|
||||||
|
|
||||||
|
<!--# include file="include/top.html" -->
|
||||||
|
|
||||||
|
<p>This is more a curiosity question than a problem. Try this:</p>
|
||||||
|
|
||||||
|
<pre><code>mkdir temp
|
||||||
|
cd temp
|
||||||
|
seq 1 30000 | xargs touch
|
||||||
|
ls -lhd .
|
||||||
|
find . -type f | xargs rm
|
||||||
|
ls -lhd .
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Doing this on ext3 shows a 432k directory that stays that size even after the files are removed. It appears that ext3 practices lazy deletion, leaving the directory structures intact. It probably assumes that a directory that was large once will be large again, so it can save the allocation expense in the future.</p>
|
||||||
|
|
||||||
|
<!--# include file="include/bottom.html" -->
|
||||||
@@ -40,6 +40,7 @@
|
|||||||
<li>2009-Sep-11: <a href="2009-09-11-confusing-bind-with-cnames.html">Confusing BIND with CNAMEs</a></li>
|
<li>2009-Sep-11: <a href="2009-09-11-confusing-bind-with-cnames.html">Confusing BIND with CNAMEs</a></li>
|
||||||
<li>2009-Feb-19: <a href="2019-02-19-the-odd-case-of-my-mugging.html">The odd case of my mugging</a></li>
|
<li>2009-Feb-19: <a href="2019-02-19-the-odd-case-of-my-mugging.html">The odd case of my mugging</a></li>
|
||||||
<li>2009-Feb-03: <a href="2009-02-03-5-packet-tcp-connection.html">5-packet TCP connection?</a></li>
|
<li>2009-Feb-03: <a href="2009-02-03-5-packet-tcp-connection.html">5-packet TCP connection?</a></li>
|
||||||
|
<li>2006-Mar-02: <a href="2006-03-02-why-is-my-directory-empty-and-large.html">Why is my directory empty and large?</a></li>
|
||||||
<li>2006-Feb-26: <a href="2006-02-26-why-isnt-mod_auth_pam-working-with-nis.html">Why isn’t mod_auth_pam working with NIS?</a></li>
|
<li>2006-Feb-26: <a href="2006-02-26-why-isnt-mod_auth_pam-working-with-nis.html">Why isn’t mod_auth_pam working with NIS?</a></li>
|
||||||
<li>2006-Feb-26: <a href="2006-02-26-sctp-part-1.html">SCTP Part #1</a></li>
|
<li>2006-Feb-26: <a href="2006-02-26-sctp-part-1.html">SCTP Part #1</a></li>
|
||||||
<li>2006-Feb-13: <a href="2006-02-13-is-sleep-effected-by-time-changes.html">Is sleep(3) effected by time changes?</a></li>
|
<li>2006-Feb-13: <a href="2006-02-13-is-sleep-effected-by-time-changes.html">Is sleep(3) effected by time changes?</a></li>
|
||||||
|
|||||||
17
markdown/2006-03-02-why-is-my-directory-empty-and-large.md
Normal file
17
markdown/2006-03-02-why-is-my-directory-empty-and-large.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!--# set var="title" value="Why is my directory empty and large?" -->
|
||||||
|
<!--# set var="date" value="March 2, 2006" -->
|
||||||
|
|
||||||
|
<!--# include file="include/top.html" -->
|
||||||
|
|
||||||
|
This is more a curiosity question than a problem. Try this:
|
||||||
|
|
||||||
|
mkdir temp
|
||||||
|
cd temp
|
||||||
|
seq 1 30000 | xargs touch
|
||||||
|
ls -lhd .
|
||||||
|
find . -type f | xargs rm
|
||||||
|
ls -lhd .
|
||||||
|
|
||||||
|
Doing this on ext3 shows a 432k directory that stays that size even after the files are removed. It appears that ext3 practices lazy deletion, leaving the directory structures intact. It probably assumes that a directory that was large once will be large again, so it can save the allocation expense in the future.
|
||||||
|
|
||||||
|
<!--# include file="include/bottom.html" -->
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
1. 2009-Sep-11: [Confusing BIND with CNAMEs](2009-09-11-confusing-bind-with-cnames.html)
|
1. 2009-Sep-11: [Confusing BIND with CNAMEs](2009-09-11-confusing-bind-with-cnames.html)
|
||||||
1. 2009-Feb-19: [The odd case of my mugging](2019-02-19-the-odd-case-of-my-mugging.html)
|
1. 2009-Feb-19: [The odd case of my mugging](2019-02-19-the-odd-case-of-my-mugging.html)
|
||||||
1. 2009-Feb-03: [5-packet TCP connection?](2009-02-03-5-packet-tcp-connection.html)
|
1. 2009-Feb-03: [5-packet TCP connection?](2009-02-03-5-packet-tcp-connection.html)
|
||||||
|
1. 2006-Mar-02: [Why is my directory empty and large?](2006-03-02-why-is-my-directory-empty-and-large.html)
|
||||||
1. 2006-Feb-26: [Why isn’t mod\_auth\_pam working with NIS?](2006-02-26-why-isnt-mod_auth_pam-working-with-nis.html)
|
1. 2006-Feb-26: [Why isn’t mod\_auth\_pam working with NIS?](2006-02-26-why-isnt-mod_auth_pam-working-with-nis.html)
|
||||||
1. 2006-Feb-26: [SCTP Part #1](2006-02-26-sctp-part-1.html)
|
1. 2006-Feb-26: [SCTP Part #1](2006-02-26-sctp-part-1.html)
|
||||||
1. 2006-Feb-13: [Is sleep(3) effected by time changes?](2006-02-13-is-sleep-effected-by-time-changes.html)
|
1. 2006-Feb-13: [Is sleep(3) effected by time changes?](2006-02-13-is-sleep-effected-by-time-changes.html)
|
||||||
|
|||||||
Reference in New Issue
Block a user