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
?
/etc/fstab
(with sudo
if needed).none /dev/shm tmpfs defaults,size=4G 0 0
.Case 1 - This line exists in your /etc/fstab
file:
size=
. For example if you want an 8G size, replace size=4G
by size=8G
.sudo
if needed) $ mount -o remount /dev/shm
.Case 2 - This line does NOT exist in your /etc/fstab
file:
none /dev/shm tmpfs defaults,size=4G 0 0
, and modify the text after size=
. For example, if you want an 8G size, replace size=4G
by size=8G
.sudo
if needed) $ mount /dev/shm
.