public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab
@ 2013-05-08  5:55 Walter Dnes
  2013-05-08  6:43 ` Alan McKinnon
  2013-05-08 14:43 ` [gentoo-user] " Paul Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Walter Dnes @ 2013-05-08  5:55 UTC (permalink / raw
  To: Gentoo Users List

  I'm running mdev, so that may be related.  Here's my story... a script
I run to automatically process digital photos started blowing up on me.
After much bashing of head against brick wall, I determined that
/dev/shm now has an absolute max size of 10 megabytes!  Any larger files
could not be written to it.  Here's all the uncommented stuff in /etc/fstab


/dev/sda5               /         ext2     noatime,nodiratime,async        0 1
/dev/sda7               /home     reiserfs noatime,nodiratime,async,notail 0 1
/home/bindmounts/opt    /opt      auto     bind                            0 0
/home/bindmounts/var    /var      auto     bind                            0 0
/home/bindmounts/usr    /usr      auto     bind                            0 0
/home/bindmounts/tmp    /tmp      auto     bind                            0 0
/dev/sda6               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      iso9660         noauto,users,ro 0 0
/dev/sr0                /mnt/dvd        auto            noauto,users,ro  0 0
devpts  /dev/pts devpts defaults 0 0
none              /dev/shm        tmpfs rw,noatime,noexec,nosuid,nodev 0 0

  Meanwhile, my netbook, with the /dev/shm line commented out, runs just
fine and handles large files in /dev/shm.  I followed the example at
http://wiki.gentoo.org/wiki/Complete_Handbook/Configuring_the_system
with slightly more paranoid settings, e.g. noexec.  What gives?

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab
  2013-05-08  5:55 [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab Walter Dnes
@ 2013-05-08  6:43 ` Alan McKinnon
  2013-05-09 20:49   ` [gentoo-user] [SOLVED] " Walter Dnes
  2013-05-08 14:43 ` [gentoo-user] " Paul Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Alan McKinnon @ 2013-05-08  6:43 UTC (permalink / raw
  To: gentoo-user

On 08/05/2013 07:55, Walter Dnes wrote:
>   I'm running mdev, so that may be related.  Here's my story... a script
> I run to automatically process digital photos started blowing up on me.
> After much bashing of head against brick wall, I determined that
> /dev/shm now has an absolute max size of 10 megabytes!  Any larger files
> could not be written to it.  Here's all the uncommented stuff in /etc/fstab
> 
> 
> /dev/sda5               /         ext2     noatime,nodiratime,async        0 1
> /dev/sda7               /home     reiserfs noatime,nodiratime,async,notail 0 1
> /home/bindmounts/opt    /opt      auto     bind                            0 0
> /home/bindmounts/var    /var      auto     bind                            0 0
> /home/bindmounts/usr    /usr      auto     bind                            0 0
> /home/bindmounts/tmp    /tmp      auto     bind                            0 0
> /dev/sda6               none            swap            sw              0 0
> /dev/cdrom              /mnt/cdrom      iso9660         noauto,users,ro 0 0
> /dev/sr0                /mnt/dvd        auto            noauto,users,ro  0 0
> devpts  /dev/pts devpts defaults 0 0
> none              /dev/shm        tmpfs rw,noatime,noexec,nosuid,nodev 0 0
> 
>   Meanwhile, my netbook, with the /dev/shm line commented out, runs just
> fine and handles large files in /dev/shm.  I followed the example at
> http://wiki.gentoo.org/wiki/Complete_Handbook/Configuring_the_system
> with slightly more paranoid settings, e.g. noexec.  What gives?
> 


a tmpfs defaults to half ram size. If yours is 10M, then quite obviously
you run some code somewhere that does it different :-)

You could go through the effort of tracking down why. Unless this is a
default behaviour of mdev which needs debugging, pathcing and fixing, I
don't think you should spend any brain cycles on this, just add this to
the mount options

size=50%

-- 
Alan McKinnon
alan.mckinnon@gmail.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab
  2013-05-08  5:55 [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab Walter Dnes
  2013-05-08  6:43 ` Alan McKinnon
@ 2013-05-08 14:43 ` Paul Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Hartman @ 2013-05-08 14:43 UTC (permalink / raw
  To: gentoo-user

On Wed, May 8, 2013 at 12:55 AM, Walter Dnes <waltdnes@waltdnes.org> wrote:
>   I'm running mdev, so that may be related.  Here's my story... a script
> I run to automatically process digital photos started blowing up on me.
> After much bashing of head against brick wall, I determined that
> /dev/shm now has an absolute max size of 10 megabytes!  Any larger files
> could not be written to it.  Here's all the uncommented stuff in /etc/fstab
>
>
> /dev/sda5               /         ext2     noatime,nodiratime,async        0 1
> /dev/sda7               /home     reiserfs noatime,nodiratime,async,notail 0 1
> /home/bindmounts/opt    /opt      auto     bind                            0 0
> /home/bindmounts/var    /var      auto     bind                            0 0
> /home/bindmounts/usr    /usr      auto     bind                            0 0
> /home/bindmounts/tmp    /tmp      auto     bind                            0 0
> /dev/sda6               none            swap            sw              0 0
> /dev/cdrom              /mnt/cdrom      iso9660         noauto,users,ro 0 0
> /dev/sr0                /mnt/dvd        auto            noauto,users,ro  0 0
> devpts  /dev/pts devpts defaults 0 0
> none              /dev/shm        tmpfs rw,noatime,noexec,nosuid,nodev 0 0
>
>   Meanwhile, my netbook, with the /dev/shm line commented out, runs just
> fine and handles large files in /dev/shm.  I followed the example at
> http://wiki.gentoo.org/wiki/Complete_Handbook/Configuring_the_system
> with slightly more paranoid settings, e.g. noexec.  What gives?

You can forcefully specify the size of /dev/shm like this:

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

But it should default to 50% of your system RAM... weird... do you
have any local scripts that are remounting it, maybe?

There's a lot more information in the kernel documentation:
/usr/src/linux//Documentation/filesystems/tmpfs.txt


The default fstab from latest baselayout does not contain /dev/shm at all:

# /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/BOOT               /boot           ext2            noauto,noatime  1 2
/dev/ROOT               /               ext3            noatime         0 1
/dev/SWAP               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-user] [SOLVED] Setting size of /dev/shm or cleaning up ancient /etc/fstab
  2013-05-08  6:43 ` Alan McKinnon
@ 2013-05-09 20:49   ` Walter Dnes
  0 siblings, 0 replies; 4+ messages in thread
From: Walter Dnes @ 2013-05-09 20:49 UTC (permalink / raw
  To: gentoo-user

On Wed, May 08, 2013 at 08:43:53AM +0200, Alan McKinnon wrote
> 
> a tmpfs defaults to half ram size. If yours is 10M, then quite obviously
> you run some code somewhere that does it different :-)
> 
> You could go through the effort of tracking down why. Unless this is a
> default behaviour of mdev which needs debugging, pathcing and fixing, I
> don't think you should spend any brain cycles on this, just add this to
> the mount options
> 
> size=50%

  I think I found the root of the problem, in /etc/init.d/mdev

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 replaced "size=10M" with "size=50%" and rebooted.  It now works
properly.  Bug https://bugs.gentoo.org/show_bug.cgi?id=469226 filed.

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-09 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08  5:55 [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab Walter Dnes
2013-05-08  6:43 ` Alan McKinnon
2013-05-09 20:49   ` [gentoo-user] [SOLVED] " Walter Dnes
2013-05-08 14:43 ` [gentoo-user] " Paul Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox