Ubuntu – How to resize /run (to make /run/shm bigger) properly – and where is it’s’ size set

mount

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.

Best Answer

  • 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).