linux - Backing tempfs with disk instead of RAM/SWAP -


i want limit size of folder, process cannot write more x mb data folder. looks not possible in linux folders can done on tempfs filesystem.

so can create tempfs filesystem , set size limit on it.

but problem tempfs backed ram (and swap) not acceptable case run out of disk space. can tempfs existing folder on disk?

i want create around 50 such directories , set cap of 500mb on each of those.

edit 1: following command do?

sudo mount -t tmpfs /tmp /tmp/mnt/aks2

i guess mounts folder /tmp mountpoint /tmp/mnt/aks2 . mean /tmp/mnt/aks2 mount point backed /tmp folder instead of ram? if yes why -t tmpfs in command?

no. create filesystem in file of maximum size desired , loopmount instead.

e.g.:

dd if=/dev/zero of=image.img bs=1mib count=500 mke2fs image.img sudo mount image.img /mnt 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -