Issue
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
?
Solution
- Edit file
/etc/fstab
(withsudo
if 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=4G
bysize=8G
. - Exit your text editor, then run (with
sudo
if needed)$ mount -o remount /dev/shm
.
Case 2 - This line does NOT exist in your /etc/fstab
file:
- At the end of the file, append 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=4G
bysize=8G
. - Exit your text editor, then run (with
sudo
if needed)$ mount /dev/shm
.
Answered By - Manu NALEPA Answer Checked By - Mildred Charles (WPSolving Admin)