How to resize /dev/shm?
·
Answer a question
On Ubuntu 18.04, When I run
$ df -h,
I see this result:
Filesystem Size Used Avail Use% Mounted on
...
tmpfs 3,9G 73M 3,8G 2% /dev/shm
...
/dev/shm has a 3.9G size.
How could I change the size of /dev/shm?
Answers
- Edit file
/etc/fstab(withsudoif needed). - In this file, try to locate a line like this one :
none /dev/shm tmpfs defaults,size=4G 0 0.
Case 1 - This line exists in your /etc/fstab file:
- Modify the text after
size=. For example if you want an 8G size, replacesize=4Gbysize=8G. - Exit your text editor, then run (with
sudoif needed)$ mount -o remount /dev/shm.
Case 2 - This line does NOT exists in your /etc/fstab file:
- Append at the end of the file the line
none /dev/shm tmpfs defaults,size=4G 0 0, and modify the text aftersize=. For example if you want an 8G size, replacesize=4Gbysize=8G. - Exit your text editor, then run (with
sudoif needed)$ mount /dev/shm.
更多推荐




所有评论(0)