[SOLVED] mdev tmpfs 10 megabyte max limit?

Walter Dnes waltdnes at waltdnes.org
Thu May 9 20:08:16 UTC 2013


On Thu, May 09, 2013 at 12:26:34PM +0200, Harald Becker wrote
> Hi Walter !
>
> > Yesterday, it started blowing up on me.  After painfull debugging, I
> > discovered that /dev/shm now only 10 megabytes.
>
> Did you change your kernel and or other system start information?
>
> tmpfs has a mount option to specify the maximum size. As /dev/shm is
> usually for small shared memory regions (POSIX) it gets limited to
> smaller size than 50% of available RAM.
>
> Try 'mount -oremount,size=100M /dev/shm' ... but this is all not
> Busybox related.

  That was almost, but not quite, the correct answer.  More spelunking
shows that there is no built-in limit for /dev/shm per se.  However, 
/dev/shm is mounted on top of /dev.
And /etc/mtab showed...

mdev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0

  On a physical disk, you can't allocate a 1 gig mount on a 10 megabyte
partition.  Similarly, you can't mount allocate a 1 gig /dev/shm on top
of a 10 meg /dev.  So the solution was to...

mount -oremount,size=500M /dev

  That gives me up to 500 megabytes, minus a bit of /dev overhead.

Last minute edit...
===================
  I think I've finally found the root of the problem, in /etc/init.d/mdev
in Gentoo...

mount_it()
{
        if fstabinfo --quiet /dev ; then
                mount -n /dev
        else
                # Some devices require exec, Bug #92921
                mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
        fi
}

  I may have to file a bug at bugs.gentoo.org

-- 
Walter Dnes <waltdnes at waltdnes.org>


More information about the busybox mailing list