[H-GEN] Out of disk space errors?

Stephen Thorne stephen.thorne at gmail.com
Wed May 18 21:02:16 EDT 2005


On 19/05/05, David Duffy <david at audiovisualdevices.com.au> wrote:
> Robert Brockway wrote:
> >On Sun, 15 May 2005, David Harrison wrote:
> >
> >>Has anyone seen this behaviour before? Short of a reboot (which I'm trying to
> >>
> >>
> >
> >Yes, it is a function of how Unix uses files.  If you remove a file the
> >space is only freed once the process holding the file exits.  Figure out
> >which daemon or other process was using the files and stop and restart
> >them.
> >
> >The best option is to use fuser or lsof before deleting the file to see
> >who has it.
> >
> >You may be able to examine /proc to see who is holding the files.
> >
> >A reboot works only because it stop the proceses involved.
> >
> 
> Related to this, I have a question. I recently ran out of space on my
> Debian box.
> Running df indicated heaps of room left but when I used the "file
> properties" via
> my Windows box to get the size of all files, it indicated that one
> directory tree
> that had thousands of tiny clipart files in it was hogging about 20
> times as much
> disk space than what the files really added up to in raw sizes. I gather
> that this is
> to do with cluster sizes and the files being much smaller than them. I
> deleted that
> whole directory and it now shows 22% space used and the problem is gone.
> Is there any way to store heaps of very small files without wasting space?

An 'Easy' way is to store them in a loopback filesystem that is
configured to have small block and inode sizes. As I don't know
anything about the performance of such a solution, I'm going to say
that this is probably going to be shockingly slow, but will at least
save you some disk space. -T news is tweaked for filesystems with lots
of small files I'm led to believe. Fiddle with block and inode sizes
if you want to get wastage down further.

You might be able to save more space if your outer filesystem is
configured for sparse files, or if you use the 'cloop' compressed
loopback module that knoppix uses.

Create a 256meg loopback fs:

dd if=/dev/zero of=dummyfs count=256K bs=1024
echo y|/sbin/mkfs.ext3 -q -T news dummyfs
mkdir dummy
sudo mount -o loop -t ext3 dummyfs dummy

-- 
Stephen Thorne
Development Engineer




More information about the General mailing list