Is bin ever written to?
sarunas at math.dartmouth.edu
Tue Dec 23 22:39:33 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
> On Tue, Dec 23, 2008 at 10:09 PM, Loïc Grenié <loic.grenie at gmail.com> wrote:
>> 2008/12/23 Knapp <magick.crow at gmail.com>:
>>> On Tue, Dec 23, 2008 at 8:22 PM, Smoot Carl-Mitchell <smoot at tic.com> wrote:
>>>> On Tue, 2008-12-23 at 20:05 +0100, Knapp wrote:
>>>>> I was wondering if anything in a set up system ever needs to write to
>>>>> /bin or /sbin or /usr/bin or /usr/sbin?
>>>>> I was thinking of putting them in a ram disk with SquashFS to speed up
>>>>> the system but it can only read and not write.
>>>>> As far as I know the only time writing is needed is with a system update.
>>>> You are correct. The only time the "bin" directories are written is
>>>> during system updates.
>>>> I am not sure how much improvement you will see by putting the common
>>>> system commands in a ram disk. The demand paging system keeps
>>>> frequently accessed pages in memory anyway. The only way to know is to
>>>> try it and see what kind of improvement you see.
>>>> Smoot Carl-Mitchell
>>> Any other ideas of what might best be on a ram disk?
>>> All the hidden home files was suggested because programs like FF might
>>> be speeded up and then at shutdown the ramdisk could be written to the
>>> home dir. This posses a risk, if there is a power outage but other
>>> than that should be safe.
>> The kernel writers usually says that it's much better to NOT use a ramdisk
>> and let the kernel do the cache (it's also much safer in case of power
>> outage). You lose the first time you read a file, but the rest of the time it
>> remains in memory (in you read it often). Except if you have a very
>> specific use, you'd better not put anything on your ramdisk and not do
>> any ramdisk.
>> The first time you read a file, the kernel copies it into memory.
>> It remains
>> there unless there is not enough memory for the rest of the system. In that
>> case the least used files are canceled from memory. This means that the
>> kernel will create a "virtual ramdisk" in the cache where all the
>> files that you
>> use often will remain. Each of those "usual" files will be read only
>> once during
>> each normal session. If you use all your memory for some memory intensive
>> program, the cache will be canceled, but your memory will be available for
>> your program (which will not, or less, swap) instead of being locked for a
> OK, then how do you explain the increadible speed of distros like Damn
> Small Linux with a ram boot? Even big programs like FF run in a blink
> on my 386 laptop.
Well, maybe 'cause it's "damn small"?
> On my amd 64 bit machine stating FF takes time even
> if I do it 2 times in a row. I want that sort of speed on my much
> faster desktop!
You can use strace and compare number of files opened in both cases. All
the files in your FF profile, add-ons/plugins, libraries etc. It's not
just /usr/bin/firefox. Do you want all that in RAM disk?...
You may also experiment with the swappiness setting in sysfs, i.e.
balance in RAM usage (see, for ex., here:
In practice however a faster hard disk or RAID setup will most likely
make the biggest difference.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the ubuntu-users