Slax author's Blog (RSS)
03
October2012
Dynamic size filesystem
I was searching for a way how to create a dynamic-size file for Slax changes so it could be loop-mounted. Didn't find anything useful thus had to write own filesystem driver for it using fuse. And that's how dynsizeFS has born. I plan to include it in Slax as a default way to store changes.
How does it work? After mounted, it provides a virtual 2GB file, which is in fact stored on disk in two other files - index file (which remembers block locations) and data file (which holds the data blocks). The data file extends its size on the fly as needed. It doesn't shrink, though, but for our purposes it is perfectly fine. After creation of EXT2 filesystem, it consumes only 4MB of disk space. I couldn't put there XFS thought, due to the lack of mkfs.xfs support in busybox.
If you are interested, grab dynsizeFS sources from here. It is a fuse-based filesystem driver. For now, the 2GB max file size seems OK, but I would like to enable any size in general. Unfortunately I am unable to. Any number bigger than 2GB makes some integer overflows during the filesystem compilation, I am really confused regarding this, since -D_FILE_OFFSET_BITS=64 is defined properly. Fuse simply refuses to create a bigger file.
Am I missing anything? Is there any programmer who could show me a better way how to support even bigger files?

User comments

