/dev/shm 调整大小

os: centos 7.4.1708

/dev/shm 默认大小为物理内存的一半,如果需要调整大小,可以修改 /etc/fstab

版本

# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core) 

/dev/shm

# df -hT
Filesystem              Type      Size  Used Avail Use% Mounted on
devtmpfs                devtmpfs  2.0G     0  2.0G   0% /dev
tmpfs                   tmpfs     2.0G   52K  2.0G   1% /dev/shm
tmpfs                   tmpfs     2.0G  9.0M  2.0G   1% /run
tmpfs                   tmpfs     2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mapper/centos-root xfs        47G   20G   28G  42% /
/dev/sda1               xfs      1014M  161M  854M  16% /boot
tmpfs                   tmpfs     396M   12K  396M   1% /run/user/42
tmpfs                   tmpfs     396M     0  396M   0% /run/user/0

# vi /etc/fstab
tmpfs                   /dev/shm                tmpfs   defaults,size=2560M        0 0

# mount -o remount /dev/shm
# df -hT
Filesystem              Type      Size  Used Avail Use% Mounted on
devtmpfs                devtmpfs  2.0G     0  2.0G   0% /dev
tmpfs                   tmpfs     2.5G   52K  2.5G   1% /dev/shm
tmpfs                   tmpfs     2.0G  9.0M  2.0G   1% /run
tmpfs                   tmpfs     2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mapper/centos-root xfs        47G   20G   28G  42% /
/dev/sda1               xfs      1014M  161M  854M  16% /boot
tmpfs                   tmpfs     396M   12K  396M   1% /run/user/42
tmpfs                   tmpfs     396M     0  396M   0% /run/user/0

你可能感兴趣的:(#,linux,rhel,centos,shm,/dev/shm)