While considering new partitioning schemes and filesystem choices for future installs and reinstalls, I realized that I had almost no idea what kind of files were on my system. I needed to see histograms of file sizes in particular directories in order to make better decisions for partitioning, filesystem selection and filesystem tuning.
I started playing with the du command to try and get some data and after a while I came up with the following:find . -type f -execdir du --apparent-size --block-size=512 '{}' \; | grep -o ^[0-9]* | sort -n | uniq -c
This series of commands produced the data I was looking for and I graphed it using OpenOffice Calc. Here is a summary of what I got for the directories of Portage. As expected, there were "lots of small files."
First, the Portage tree (no /distfiles here):
You can clearly see the portion of files less than 2k compared to the rest. There are a lot of them, but they do not take up the majority of the space.
Then the Portage cache:
Lots of 512b+ to 1k files here, represented by the yellow region.
Finally, the Portage installed packages database:
Lots of sub 512b files, but they do not take up a lot of the space.
In retrospect, I needed to use something better than OpenOffice to graph the data and I will update this post if I get to it. Since the histograms were quite skewed as you can see from the results above, here are some maps generated by FSview to give you a different view of the directories:
From left to right: the Portage tree, the Portage cache and the Portage installed packages database
No comments:
Post a Comment