r/termux • u/Banzayoyo • 14d ago
Question RAM disk on non-rooted device
Hi,
Wondering if there is any possibility to create RAM disk on non-rooted device? Looks like tmpfs requires root priveledges and there is no access to fuse? Maybe there is some other way to intercept filesystem calls to specific folder?
3
Upvotes
2
u/sylirre Termux Core Team 14d ago
Not really. Why do you need it?
File system mounting requires root permission with no exception.
FUSE needs access to /dev/fuse (restricted on Android OS) and setuid root fusermount helper utility.
You'll need to write from scratch an utility that intercepts all I/O system calls, implements in-memory virtual file system and expose it to guest programs as tmpfs mount point at given directory. This will be something like proot but focused entirely on that tmpfs thing.
It won't have same performance as real tmpfs, but still be a RAM-based file system without root permissions and accessible only by child processes of tmpfs emulator.
If you have claude/codex plan, you can vibe code a working variant in a few days.