Glen
Glen

Reputation: 3

How to store data permanently under /tmp in linux?

Before anyone gets bent out of shape saying you're not supposed to do that and the like:

I am currently working with a router with very limited disk space running OpenWRT. I need to install a few programs. Looks like there is plenty of space under /tmp, but nowhere else due to how the file system is partitioned. Looking to store some files under /tmp permanently. I also preferably don't want to interfere with the normal system operation of purging /tmp on reboot however, so changing how often the purge happens (50 years...) isn't really what I'm looking for.

Brainstorms:

I'm a somewhat shallow/broad guy. Need some knowledge from some of the deep/narrow individuals among us.

Thanks.

ps: For reference: How to store data permanently in /tmp directory in linux

That thread doesn't answer what I'm trying to do and due to the format of this website it's not possible to add questions to existing questions, hence the new question posted here.

To clarify:

root@GL-AR150:/# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                10.0M     10.0M         0 100% /rom
tmpfs                    29.1M    796.0K     28.4M   3% /tmp
/dev/mtdblock5            4.3M    792.0K      3.5M  18% /overlay
overlayfs:/overlay        4.3M    792.0K      3.5M  18% /
tmpfs                   512.0K         0    512.0K   0% /dev

There is 3.5M free under /, which is not enough space for what I need to do. There is 28.4M free under /tmp.

Ideas?

Upvotes: 0

Views: 2477

Answers (1)

Chris Dodd
Chris Dodd

Reputation: 126203

By your df summary, /tmp is a tmpfs -- meaning it is not "real" storage -- its a RAM filesystem whose contents will be lost whenever the power goes off.

Upvotes: 1

Related Questions