What is /dev/shm and how to mount /dev/shm
Introduction:
/dev/shm is nothing but implementation of traditional shared memory concept. It is an efficient means of passing data between programs. One program will create a memory portion, which other processes (if permitted) can access. This will result into speeding up things on Linux. shm / shmfs is also known as tmpfs, which is a common name for a temporary file storage facility on many Unix-like operating systems. It is intended to appear as a mounted file system, but one which uses virtual memory instead of a persistent storage device. If you type mount command you will see /dev/shm as a tempfs file system. Therefore, it is a file system, which keeps all files in virtual memory. Everything in tmpfs is temporary in the sense that no files will be created on your hard drive. If you unmount a tmpfs instance, everything stored therein is lost. By default almost all Linux distros configured to use /dev/shm.
Useage:
/dev/shm is used to improve the performance of application software for eg. Oracle.
Generally speaking, IO intensive tasks that benefit from fast, No-HDD-read/write-space, such as video encoding, gaming, etc. can make extensive use out of shm.
Commands:
For temporary mounting-
mount -o remount,size=5G /dev/shm
For permanent mounting,paste the below given bolded line in /etc/fstab:
#vi /etc/fstab
none /dev/shm tmpfs defaults,size=5G 0 0
save and close the /etc/fstab file.
# mount -o remount /dev/shm
& Verify the mounting.
# df -Th
Recent Comments