9

On Ubuntu 13.04 /dev/shm is symlink to /run/shm and /run/shm is just subdirectory of /run. /run is some tmpfs which is mounted but ………… I can't find by what and how (surely it is not present in /etc/fstab and I can't grep anything sensible in /etc/init*).

While usually this directory need no attention, both while trying to setup Oracle, and while trying to setup DB2, I faced errors which in the end turned out to mean „/dev/shm is too small”. Net is full of advice how to mount --rebind run to make it bigger, but this operation nicely breaks apps which use /run and are already running at the moment rebind happens (and there are a lot of them, especially on desktop, including things like upstart, networkmanager, or udev).

My questions:

  1. Where exactly is the code which mounts /run, when does it happen?

  2. What should I change to increase /run size at the moment it is created? (on my laptop it takes 10% of memory - 600MB on 6GB laptop - I'd like to give it 1GB)

  3. If 2 is impossible, what is the proper moment to rebind /run to resize it - so it happens before anythning starts actually using /run?

  4. Does there exist any documentation on the subject? While there are many posts and notes about /run as such, I couldn't find anything about configuring it.

2
  • 3
    For the sake of history: I found that best way to resolve oracle problems was to ... binary-edit $ORACLE_HOME/bin/oracle and change strings /dev/shm into /run/shm (fortunately they are of the same lenght). Oracle wrongly calculates size in case of symlink
    – Mekk
    Jan 30, 2014 at 23:04
  • @Mekk; Brilliant ! Used: "vi /u01/app/oracle/product/11.2.0/xe/bin# vi oracle" then "Shift-Colon" then "%s/\/dev\/shm/\/run\/shm" and ENTER. Worked like a champ.
    – Nicholas
    Apr 11, 2015 at 15:13

1 Answer 1

10

In Ubuntu those mounts are configured in /lib/init/fstab, and as it says there in the default comments, to override the settings you can simply copy the line to /etc/fstab and modify as you see fit.

# /lib/init/fstab: static file system information.
#
# These are the filesystems that are always mounted on boot, you can
# override any of these by copying the appropriate line from this file into
# /etc/fstab and tweaking it as you see fit.  See fstab(5).
2
  • For me, despite having customized the size value of /run, it was still mounted using the 10% of physical memory default. When I type mount, the entry is listed with my updated value (in this case 50%), but my actual allocated size for my /run directory is still 10%. Is there something I'm missing here? Jul 31, 2017 at 17:09
  • @RyanGriffith, with the switch to systemd, /lib/init/fstab is gone, however systemd is supposed to still check /etc/fstab, and it worked for me when I tried it on 17.04. Aug 5, 2017 at 22:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .