Andrew Benton wrote:
> On Fri, 15 Apr 2011 17:01:21 -0500
> Bruce Dubbs <bruce.du...@gmail.com> wrote:
> 
>> Following some of the discussion lately on file placement, we may want 
>> to consider doing the following:
>>
>> 1. In 6.5. Creating Directories
>>    a. Create /run
>>
>> 2. Mount a tmpfs in /etc/init.d/mountkernfs on /run.  This also requires 
>> a change to /etc/init.d/mountfs.
>>
>> The purpose of this is to move a lot of things (.udev, etc) out of /dev 
>> and eventually will end up holding files presently on /var/run and 
>> /var/lock.
>>
>> Thoughts?
> 
> How large should the tmpfs mounted on /run (or /var/run) be? If it's
> not specified in /etc/fstab (or on the command line of the mount
> command) then the default is to allocate half of RAM to the tmpfs,
> which seems a little excessive. At the moment on this system /var/run
> contains about 24Kb of files and /dev 128 Kb. Would a tmpfs of a
> megabyte be enough for now?

"tmpfs puts everything into the kernel internal caches and grows and
shrinks to accommodate the files it contains and is able to swap
unneeded pages out to swap space. It has maximum size limits which can
be adjusted on the fly via 'mount -o remount ...'"

The max size probably doesn't make a lot of difference because it will 
swap if it grows too much.  On a large system that I use, we have:

120K    /var/run
4.0K    /var/lock
0       /dev/shm
120K    /dev/.udev

So I'd say that 1M would be plenty, but we may not need to allocate any 
limits.

On a new Ubuntu system I'm playing with, I have:

$ df -h /var/run
Filesystem            Size  Used Avail Use% Mounted on
none                  1.5G   84K  1.5G   1% /var/run

But it looks like that is almost all overhead:

find /var/run -type f -exec ls -l {} \;
-rw-r--r-- 1 root root      5 Apr 15 15:55 cups/cupsd.pid
-rw-r--r-- 1 root root    135 Apr 15 15:55 cups/printcap
-r--r----- 1 root lpadmin  32 Apr 15 15:55 cups/certs/0
-rw-r--r-- 1 root root     37 Apr 15 15:56 console/bdubbs
---------- 1 root root      0 Apr 15 15:55 crond.reboot
-rw-r--r-- 1 root root      5 Apr 15 15:55 atd.pid
-rw-r--r-- 1 root root      5 Apr 15 15:55 acpid.pid
-rw-r--r-- 1 root root      5 Apr 15 15:55 crond.pid
-rw------- 1 bdubbs bdubbs 57 Apr 15 15:56 gdm/auth-for-bdubbs...
-rw-r--r-- 1 root root      0 Apr 15 15:55 gdm/firstserver.stamp
-rw------- 1 gdm gdm       57 Apr 15 15:55 gdm/auth-for-gdm...
-rw-r--r-- 1 root root      4 Apr 15 15:55 gdm.pid
-rw-r--r-- 1 root root      4 Apr 15 15:55 console-kit-daemon.pid
-rw-r--r-- 1 root root    518 Apr 15 15:56 ConsoleKit/database
-rw-r--r-- 1 root root      3 Apr 15 15:55 NetworkManager.pid
-rw-r--r-- 1 avahi avahi    4 Apr 15 15:55 avahi-daemon/pid
-rw-r--r-- 1 root root      4 Apr 15 15:55 sshd.pid
-rw-r--r-- 1 root root      4 Apr 15 15:55 rsyslogd.pid
-rw-r--r-- 1 root root      4 Apr 15 15:55 dbus/pid
-rw------- 1 root root     16 Apr 15 15:55 network/ifstate
-rw-r--r-- 1 root root      0 Apr 15 15:55 network-interface-security
-rw-r--r-- 1 root root      0 Apr 15 15:55 udev-configure-printer...
-rw-r--r-- 1 root root      4 Apr 15 15:55 upstart-udev-bridge.pid
-rw-r--r-- 1 root root    334 Apr 15 15:55 motd
-rw-rw-r-- 1 root utmp   3840 Apr 15 16:55 utmp

That's only about 5K.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to