[CentOS] Does devtmps and tmpfs use underlying hard disk storage or Physical Memory (RAM)

Sun Apr 21 02:09:03 UTC 2019
Steven Tardy <sjt5atra at gmail.com>

On Fri, Apr 19, 2019 at 8:51 PM Kaushal Shriyan <kaushalshriyan at gmail.com>

> Does devtmpfs and tmpfs use underlying hard disk storage or does it uses
> Physical Memory (RAM). What is the purpose of devtmpfs which is mounted on
> /dev, tmpfs mounted on /dev/shm and so on and so forth. What is the
> difference between devtmpfs and tmpfs?

tmpfs *tries* not to use disk. /dev/shm is great to use as *fast* large
scratch space.

Have used /dev/shm to greatly speed up a daily process to parse web server
logs. Didn’t /seem/ like the process was IO or disk bound. . . Until I
threw the logs in /dev/shm and a multi hour process completed in 1/4 the

Have used /dev/shm for other “things”.

There is /dev/ram# which should never be written to disk, but has the
problem of being much much smaller (4MB iirc) and no filesystem access. So
you’d have to `mkfs /dev/ram#` and then `mount /dev/ram# /somewhere`.

Once used /dev/ram# for USB camera “security system”. The camera gave
large-ish files and couldn’t figure out how to get the camera app to output
to stdOut to then shrink the file to a tiny jpeg with pipes. So had the
camera write to /dev/ram and then read the file from /dev/ram through
`convert` or something to jpeg-ify the image. Greatly sped up (like 2-3x)
how often that could save images.

Happy learning how to Linux. (: