Malcolm V wrote:
I'm writing a program to calculate space lost to the difference between block size and filesize (Surely this has been done before, but I couldn't find it from a quick few googles).

It's actually a difficult task, and impossible to do in a
way that is portable between filesystems and even between
features of a filesystem.

The issues are:
 - indirect blocks
 - extent-based allocation
 - clusters
 - the special treatment of small files
 - the existence of file meta-data (such as SELinux labels
   and ACLs)

Then there is the question of how to correctly allocate
overheads
 - the journal on journalling filesystems
 - directories
 - any reserved free space not usable by non-root users
   (eg, is root charged for that reserved 5% of the disk)

I occassionally wonder if multiuser filesystems are a good
idea at all.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to