ramfs – temporarily mount filesystem in ram to speed things up

ram is faster than disk, this is less and less true with ssd, but in many situations it is still true, and can be useful to use the ram to serve files at high speed access.

Example script thatĀ first unmount a directory, then copy the content of another and mount it in ram:

# unmount
umount /var/www/servemequick
# mount
# copy source to temporary backup
cp -Rv /var/www/servemequick ./servemequick
# mount new ram directory with same path as source
mount -t tmpfs -o size=1g tmpfs /var/www/servemequick/
# copy backup to mounted new ram directory
cp -Rv ./servemequick/* /var/www/servemequick

This entry was posted in Uncategorized. Bookmark the permalink.