On Sat, 8 Mar 2025, Miriami wrote:
Hi!
Would you recommend me a mature fuse filesystem, which uses a single
file as backing storage, and could self-growing in size?
It's like using a fuse ext4 filesystem, just that with self-growing -
I tried the fuse ext4 filesystem, but it seems that fuse ext4
filesystem requires the user to set up a 'disk size' at the beginning,
and could not automatically grow.
I would like the fuse filesystem to automatically grow as new files
are added in, just like how a SQLite database would grow as new
records being inserted. I have found quite a lot of projects seem to
meet this function, but seems that those projects are quite unmature.
It would be great if you know that there is a mature one. However, I
haven't found one listed in the Debian package system by trying some
'apt search' commands. During this process, I found a fuse filesystem
called gocryptfs, which seems to be really mature, and could
automatically grow as new files added in - however, gocryptfs stores
in a folder with multiple files, instead of storing all the filesystem
in one single file like SQLite.
In summary, I am looking for a fuse filesystem that:
1. Uses a single file as backing storage, like how SQLite uses one
single file for the database.
2. Is mature - if it is listed in the Debian package list that could
be queryed with 'apt search', I guess it should be quite mature and
reliable - however, it would be totally fine if the project isn't
available as packaged binary and building from source is required.
It would be totally okay if the filesystem temporaily creates files
other than the one files it uses as storage - just like how SQLite
generates temporary WAL or journal files during database I/O. Just
having only one file as storage 'most of the time' would be good.
Why do you want this? There are few if any filesystems that grow like
you're asking. The nearest I can think of is growisofs.
But if, instead, what you want is the backing store to grow then use a
sparse file as the backing store.
# truncate -s 1T file
# mke2fs -t ext4 file
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done
Creating filesystem with 268435456 4k blocks and 67108864 inodes
Filesystem UUID: 88f11c90-d61b-4394-add2-700968e375d9
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
# ls -al file
-rw-r--r-- 1 root root 1099511627776 Mar 8 14:46 file
# du -sch file
19M file
19M total
That's a 1T ext4 filesystem that is, when empty, using around 20M of
disk space.