# permissions problem on /dev/shm after udev upgrade[SOLVED]

## jserink

Hi All:

After my udev-200 upgrade (which I had put off for 3 weeks) everything network wise is fine...

my eth0 is not enp0s25 and wlan0 is wlp3s0. That all works....but I get this message when trying to start chromium:

[4601:4623:0425/221717:FATAL:shared_memory_posix.cc(176)] This is frequently caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to fix.

Similar error when I try and start my VM with:

qemu-kvm -boot c -hda /home/jserink/VMs/Win_7_Pro.img -cdrom /home/jserink/CDs/virtio-win-0.1-49.iso -m 6291 -smp 2 -usb -net nic,vlan=0,model=virtio,macaddr=52:54:00:00:EE:07 -net vde -rtc base=localtime -no-quit -vga qxl -global qxl.vram_size=128000 -name Win7 -monitor telnet:127.0.0.1:12997,server,nowait,ipv4 -spice port=15900,addr=127.0.0.1,disable-ticketing -device virtio-serial-pci -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 -chardev spicevmc,id=spicechannel0,name=vdagent &

Simple enough fix, at a root prompt I just to this:

chmod 1777 /dev/shm

But I should not have to do this.

I tried adding a 'rw' to fstab but that did not fix it:

jserinki7 jserink # cat /etc/fstab

# /etc/fstab: static file system information.

#

# noatime turns off atimes for increased performance (atimes normally aren't 

# needed); notail increases performance of ReiserFS (at the expense of storage 

# efficiency).  It's safe to drop the noatime options if you want and to 

# switch between notail / tail freely.

#

# The root filesystem should have a pass number of either 0 or 1.

# All other filesystems should have a pass number of 0 or greater than 1.

#

# See the manpage fstab(5) for more information.

#

# <fs>			<mountpoint>	<type>		<opts>		<dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

#/dev/sda2	/boot		ext2		noauto,noatime		1 2

/dev/sda10	/		ext4		noatime			0 1

/dev/sda5	none		swap		sw			0 0

/dev/sda6	/var		ext4		noatime			0 0

/dev/sda7	/usr		ext4		noatime			0 0

/dev/sda8	/opt		ext4		noatime			0 0

/dev/sda9	/tmp		ext4		noatime			0 0

/dev/sda11	/mnt/shr	ext3		noatime			0 0

/dev/sda3	/mnt/WindowsC	ntfs-3g		unamsk=000,users,noatime,uid=jserink,gid=users	0 0

/dev/sda12	/home		ext4		noatime			0 0

#/dev/cdrom	/mnt/cdrom	auto		noauto,user		0 0

#/dev/fd0	/mnt/floppy	auto		noauto			0 0

proc		/proc		proc		defaults		0 0

shm		/dev/shm	devtmpfs	nodev,nosuid,noexec,rw	0 0

tmpfs           /var/firefoxcache  devtmpfs        size=100M,mode=0777     0 0

#tmpfs           /var/chromiumcache  tmpfs       size=100M,mode=0777     0 0

cache-chromium /home/jserink/.cache/chromium devtmpfs defaults,noatime,mode=1777 0 0

Any gurus know how to fix this?

I want to avoid and ungly bootup hack in the local.d directory.

Cheers,

johnLast edited by jserink on Fri Apr 26, 2013 12:42 pm; edited 1 time in total

----------

## Hu

Why are you mounting devtmpfs at /dev/shm?  You should never mount devtmpfs explicitly.

----------

## PaulBredbury

I use in /etc/fstab:

```
shm /dev/shm tmpfs defaults,nodev,nosuid,mode=1777 0 0
```

Arch wiki has a slight variation.

----------

## jserink

 *Hu wrote:*   

> Why are you mounting devtmpfs at /dev/shm?  You should never mount devtmpfs explicitly.

 

Because of this:

2. devtmpfs support:

You need at least version 2.6.32 of the kernel for devtmpfs

functionality. Once you have this, make sure CONFIG_DEVTMPFS=y is set

in the kernel configuration. See the gentoo udev guide for the option in

make menuconfig [1].

If you have a line for /dev in /etc/fstab, make sure it is configured

for file system type devtmpfs (not tmpfs or any other type). Also, you

can remove this line if you prefer, since devtmpfs is mounted

automatically.

I changed it to this:

shm		/dev/shm	tmpfs	nodev,nosuid,noexec,rw	0 0

And it works now.

Cheers,

John

----------

## SamuliSuominen

 *jserink wrote:*   

> 
> 
> I changed it to this:
> 
> shm		/dev/shm	tmpfs	nodev,nosuid,noexec,rw	0 0
> ...

 

There shouldn't be /dev/shm line in /etc/fstab at all, you are just replicating the defaults there as it's automounted already with those options. Some outdated guides are telling people to put

that line to /etc/fstab, but that's all they are, outdated guides.

----------

## PaulBredbury

 *ssuominen wrote:*   

> it's automounted

 

By what?

----------

## SamuliSuominen

 *PaulBredbury wrote:*   

>  *ssuominen wrote:*   it's automounted 
> 
> By what?

 

udev (udev, udev-mount init scripts, devtmpfs)

----------

## jserink

I've removed the shm entry from my fstab and everything still works so it appears it does not need to be there.

Good tip.

jserink@jserinki7 ~ $ cat /etc/fstab

# /etc/fstab: static file system information.

#

# noatime turns off atimes for increased performance (atimes normally aren't 

# needed); notail increases performance of ReiserFS (at the expense of storage 

# efficiency).  It's safe to drop the noatime options if you want and to 

# switch between notail / tail freely.

#

# The root filesystem should have a pass number of either 0 or 1.

# All other filesystems should have a pass number of 0 or greater than 1.

#

# See the manpage fstab(5) for more information.

#

# <fs>			<mountpoint>	<type>		<opts>		<dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

#/dev/sda2	/boot		ext2		noauto,noatime		1 2

/dev/sda10	/		ext4		noatime			0 1

/dev/sda5	none		swap		sw			0 0

/dev/sda6	/var		ext4		noatime			0 0

/dev/sda7	/usr		ext4		noatime			0 0

/dev/sda8	/opt		ext4		noatime			0 0

/dev/sda9	/tmp		ext4		noatime			0 0

/dev/sda11	/mnt/shr	ext3		noatime			0 0

/dev/sda3	/mnt/WindowsC	ntfs-3g		unamsk=000,users,noatime,uid=jserink,gid=users	0 0

/dev/sda12	/home		ext4		noatime			0 0

#/dev/cdrom	/mnt/cdrom	auto		noauto,user		0 0

#/dev/fd0	/mnt/floppy	auto		noauto			0 0

proc		/proc		proc		defaults		0 0

#shm		/dev/shm	tmpfs	nodev,nosuid,noexec,rw	0 0

tmpfs           /var/firefoxcache  devtmpfs        size=100M,mode=0777     0 0

#tmpfs           /var/chromiumcache  tmpfs       size=100M,mode=0777     0 0

cache-chromium /home/jserink/.cache/chromium devtmpfs defaults,noatime,mode=1777 0 0

Cheers,

john

----------

## boospy

Ok, what is right here? I haven't an entry in the fstab, because i read that is deprecated for shm. But when i boot the system i see always a error message that shm is not mounted and should be, it is a Errormessage when the kernel starts. For example, here is needet: http://wiki.gentoo.org/wiki/Steam#Kernel

I have steam, but never mounted shm... 

But when i do an

```
mount | grep shm

tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
```

i see it is mounted automaticly... confuse...

Best Regards

boospy

----------

