How do I secure shared memory on a Linode using Ubuntu?

Linode Staff

I'm attempting to add the /dev/shm mount point to the /etc/fstab file to secure shared memory on my ubuntu 14.04 Linode but every time I attempt to reboot the server it fails to boot with the following error:

An error occurred while mounting /dev/shm.
keys:Press S to skip mounting or M for manual recovery

Here's the /etc/fstab entry I'm using:

none /dev/shm tmpfs defaults,size=8G 0 0

2 Replies

Since you're using a more recent version of Ubuntu I believe that you'll need to specify the mount point as /run/shm rather than /dev/shm

I did this on a new Ubuntu 14.04 and I was able to get it working using that mountpoint:

none /run/shm tmpfs defaults,size=8G 0 0

root@ubuntu:~# mount
/dev/sda on / type ext4 (rw,errors=remount-ro)
none on /proc type proc (rw,noexec,nosuid,nodev)
none on /proc/sys/fs/binfmtmisc type binfmtmisc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,size=8G)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name)

This was really helpful. Thank you.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct