need swap when installing from CD host system?

Richard Lightman richard at nezumi.plus.com
Wed Oct 23 13:00:17 PDT 2002


* Chris Lingard <chris at stockwith.co.uk> [2002-10-23 20:31]:
> 
> Guess I am old fashioned, just does not seem right to have no swap
> I think of it as an emergency reserve.  Funny enough, when it compiles
> gcc or glibc it sometimes uses a tiny bit of swap, though this depends
> on kernel version
> 
The kernel copies some things to swap while it has plenty of memory
on the assumption that the swap device has nothing better to do now,
but will probably be busy when it is really needed. If the kernel
ever really needs that swap space, it is entirely because you
allocated it.

> >> the root partition is another 30Mb of memory).
> >> 
> > Why? If the cd is your root partition, only the pages of programs
> > you need are actually using ram. The rest will be swap in from the
> > drive as required. If you want to keep the foot print on the cd
> > small, use mkzisofs. That way you can choose which files are compressed
> > and which aren't.
> > 
> No,  the CD is mounted on the root partition.  I want it to look like
> a real Linux system, so I have a writable root, /dev and /etc
> 
That is no reason to assign 30MB of ram. Any number you choose is
a compromize between enough to be useful, and not filling up ram.
tmpfs will grow and shrink to match its contents. It takes space
from vm, so it will use ram or swap depending on what is available,
and what files were accessed recently. If the user wants 2GB of
temporary storage, all he needs to do is add enough swap space:

$ free
             total       used       free     shared    buffers     cached
Mem:        127120     123256       3864          0       1112       8160
-/+ buffers/cache:     113984      13136
Swap:      2301936     958160    1343776

I really do have about 900MB in a tmpfs here - gcc is compiling in one.
The only thing to remember is to umount before swapoff. If I tried to
swapoff now, all that stuff in tmpfs would be fetched back into memory,
and the kernel would start killing processes to make it fit...


Richard
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list