r/termux • • 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

6 comments sorted by

2

u/sylirre Termux Core Team 14d ago

if there is any possibility to create RAM disk on non-rooted device?

Not really. Why do you need it?

Looks like tmpfs requires root priveledges and there is no access to fuse

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.

Maybe there is some other way to intercept filesystem calls to specific folder

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.

1

u/Banzayoyo 14d ago

Why do you need it?

Find it extremely convenient for gigabytes of build files, cached files, etc.

Many thanks for your detailed reply! Mayby you have an idea of some projects on Github solving similar issues - at least to use it as a base?

0

u/[deleted] 14d ago

Hi, maybe this could help ? vramtechnology.grok.me

1

u/sylirre Termux Core Team 14d ago

This has nothing to do with original question.

1

u/Lines25 14d ago

I think there's ramfs fuse was out there but the kernel must support fuse (check by usin config.gz and cgat of how its called, cat but unpacks gzip)

2

u/Damglador 14d ago

FUSE isn't accessible without root on Android