Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab
Date: Wed, 08 May 2013 14:43:53
Message-Id: CAEH5T2MazERFj=PSrxMAb7y_hsPr5TXm+fAJaYKdh6PdWrmWgQ@mail.gmail.com
In Reply to: [gentoo-user] Setting size of /dev/shm or cleaning up ancient /etc/fstab by Walter Dnes
1 On Wed, May 8, 2013 at 12:55 AM, Walter Dnes <waltdnes@××××××××.org> wrote:
2 > I'm running mdev, so that may be related. Here's my story... a script
3 > I run to automatically process digital photos started blowing up on me.
4 > After much bashing of head against brick wall, I determined that
5 > /dev/shm now has an absolute max size of 10 megabytes! Any larger files
6 > could not be written to it. Here's all the uncommented stuff in /etc/fstab
7 >
8 >
9 > /dev/sda5 / ext2 noatime,nodiratime,async 0 1
10 > /dev/sda7 /home reiserfs noatime,nodiratime,async,notail 0 1
11 > /home/bindmounts/opt /opt auto bind 0 0
12 > /home/bindmounts/var /var auto bind 0 0
13 > /home/bindmounts/usr /usr auto bind 0 0
14 > /home/bindmounts/tmp /tmp auto bind 0 0
15 > /dev/sda6 none swap sw 0 0
16 > /dev/cdrom /mnt/cdrom iso9660 noauto,users,ro 0 0
17 > /dev/sr0 /mnt/dvd auto noauto,users,ro 0 0
18 > devpts /dev/pts devpts defaults 0 0
19 > none /dev/shm tmpfs rw,noatime,noexec,nosuid,nodev 0 0
20 >
21 > Meanwhile, my netbook, with the /dev/shm line commented out, runs just
22 > fine and handles large files in /dev/shm. I followed the example at
23 > http://wiki.gentoo.org/wiki/Complete_Handbook/Configuring_the_system
24 > with slightly more paranoid settings, e.g. noexec. What gives?
25
26 You can forcefully specify the size of /dev/shm like this:
27
28 none /dev/shm tmpfs defaults,size=10G 0 0
29
30 But it should default to 50% of your system RAM... weird... do you
31 have any local scripts that are remounting it, maybe?
32
33 There's a lot more information in the kernel documentation:
34 /usr/src/linux//Documentation/filesystems/tmpfs.txt
35
36
37 The default fstab from latest baselayout does not contain /dev/shm at all:
38
39 # /etc/fstab: static file system information.
40 #
41 # noatime turns off atimes for increased performance (atimes normally aren't
42 # needed); notail increases performance of ReiserFS (at the expense of storage
43 # efficiency). It's safe to drop the noatime options if you want and to
44 # switch between notail / tail freely.
45 #
46 # The root filesystem should have a pass number of either 0 or 1.
47 # All other filesystems should have a pass number of 0 or greater than 1.
48 #
49 # See the manpage fstab(5) for more information.
50 #
51
52 # <fs> <mountpoint> <type> <opts>
53 <dump/pass>
54
55 # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
56 /dev/BOOT /boot ext2 noauto,noatime 1 2
57 /dev/ROOT / ext3 noatime 0 1
58 /dev/SWAP none swap sw 0 0
59 /dev/cdrom /mnt/cdrom auto noauto,ro 0 0
60 /dev/fd0 /mnt/floppy auto noauto 0 0