tags:

views:

5

answers:

0

Is there a way to determine the amount of metadata stored for tmpfs given the partition size and the number of files and size of files currently on the fs?

My goal is to determine the amount of space available for an additional file. Empirically I've been able to determine for one file below size 64k there doesn't seem to be any metadata. I'm able to store a 64kb file on a 64kb partition. After this it seems like 8k bytes are taken up for metadata; a 1024k partition can only hold a file of size 1016k. After 2124k it jumps to 12k and so on. For a 16gb partition I am looking at ~32mb of metadata.

I've also found the metadata size goes up when I have multiple files and I would like to be able to calculate the impact of multiple files if possible.

I've tried using statfs and statvfs to determine the free space but i'm not able to determine the impact of the additional metadata. Thank you for any help or explanation that can be provided.