Space used by files on a reiser partitition.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I thought that, on a reiserfs, small files do not use the whole sector, but are instead stored somewhere in the "directory". I have done tests, creating a thousand files in a single directory. If the files are 1K each, the space used reported by du and df are not consistent: df (disk free) space before and after creating 1000 files 1Kb each. Filesystem 1K-blocks Used Available Use% Mounted on before: /dev/hdb12 9526168 3575564 5950604 38% /Disco40/nuevo after: /dev/hdb12 9526168 3576756 5949412 38% /Disco40/nuevo ---------- ------------------------------------------------ difference: 1192 Kb 1192 Kb du says: cer@nimrodel:~> du /Disco40/nuevo/GranPrueba/ 4031 /Disco40/nuevo/GranPrueba/ cer@nimrodel:~> du -c /Disco40/nuevo/GranPrueba/* ... 4 /Disco40/nuevo/GranPrueba/Zero_9_99 4000 total Ie, du says that the directory occupies 4 Mb, whereas the space being occupied in the disk (as said by df) is 1.16 Mb. The 4 Mb figure would be consistent with the space occupied by a thousand blocks of 4Kb each, the sector size of the reiserfs partition. If I repeat with a thousand files of 10 bytes each (sufficiently small that reiserfs stores them in the directory structure, instead of blocks), the results are similar: Filesystem 1K-blocks Used Available Use% Mounted on /dev/hdb12 9526168 3575564 5950604 38% /Disco40/nuevo /dev/hdb12 9526168 3575712 5950456 38% /Disco40/nuevo 148 (148 Kb means about 151 bytes per file) du: 4031 Kb /Disco40/nuevo/GranPrueba So... either reiserfs does not save space when storing small files, as the documentation says, or df is calculating space based on a 4 Kb granularity, as would be for a "normal" file system. Is it a bug of df? Am I getting it wrong somewhere? - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDVEcotTMYHG2NR9URAjldAJ4qmqGj6fsdlIKeJLHnmFTAIMH2NwCgmDAQ iBjD09K4uAoyl8ZxRXH0J0w= =hgx9 -----END PGP SIGNATURE-----
On Monday 17 October 2005 19:51, Carlos E. R. wrote: <snip>
So... either reiserfs does not save space when storing small files, as the documentation says, or df is calculating space based on a 4 Kb granularity, as would be for a "normal" file system.
Is it a bug of df? Am I getting it wrong somewhere?
From the FAQ at http://namesys.com/faq.html#du: "du says ReiserFS makes space efficiency worse. Use df not du, or use "raw" option for du if your du supports that. st_blocks summed up is less accurate than st_size for ReiserFS because we pack tails, and st_blocks rounds numbers up." Note that du as provided in the GNU coreutils doesn't support the "raw" option. -- Homepage http://scottj.org XFce desktop environment http://www.xfce.org Goodies for the XFce desktop http://xfce-goodies.berlios.de
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2005-10-17 at 20:34 -0500, Scott Jones wrote:
Is it a bug of df? Am I getting it wrong somewhere?
From the FAQ at http://namesys.com/faq.html#du:
"du says ReiserFS makes space efficiency worse.
Use df not du, or use "raw" option for du if your du supports that. st_blocks summed up is less accurate than st_size for ReiserFS because we pack tails, and st_blocks rounds numbers up."
Note that du as provided in the GNU coreutils doesn't support the "raw" option.
I see. It makes sense now. Well, thanks to you and Randall for the clarification. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDVQA+tTMYHG2NR9URAoooAJ42Ao65eDN3ajjCBoF56EA0o68BdwCfQopm C7C3pp7U9okKdQss6TKxIes= =U9CD -----END PGP SIGNATURE-----
Carlos, On Monday 17 October 2005 17:51, Carlos E. R. wrote:
Hi,
...
So... either reiserfs does not save space when storing small files, as the documentation says, or df is calculating space based on a 4 Kb granularity, as would be for a "normal" file system.
Is it a bug of df? Am I getting it wrong somewhere?
I don't have facts to supply, but I don't think "df" knows about the various clever ways different file systems store file content. Thus it reports size used based on the allocation units alone. Assuming that's true, whether it's a bug or a feature may be a point of contention between the tool's author and / or maintainer and its users.
-- Cheers, Carlos Robinson
Randall Schulz
participants (3)
-
Carlos E. R.
-
Randall R Schulz
-
Scott Jones