Shriramana, On Sunday 04 September 2005 06:39, Shriramana Sharma wrote:
Sunday 04 Sep 2005 18:20 samaye James Knott alekhiit:
Is there, then, a way to empty /tmp and swap everytime I shutdown?
You could create a symlink from /tmp to /dev/shm. This means that your /tmp will be on a RAM disk.
I would not recommend this. Some programs write sizeable files to /tmp.
And also means that my RAM will be hogged for this purpose, yes?
As for swap, you'd have to write junk to the partition on shut down.
How?
Just copy /dev/null to the swap area.
Or you could simply have enough RAM, that you don't need a swap.
How do you say about 1.5 GB? (Don't have it now, but planning to get.)
Of course, it depends on the use you make of the system, but in all likelihood you can get away with out swap with that much RAM. Youc an also swap to a file instead of to a partition. Then during your shutdown processesing, you can easily overwrite it with random numbers. Although now that I think of it, it's no easier than doing the same with a partition. If you're going to take this approach (overwriting your swap area) be sure to disable it as an active swap area first and be sure that you re-run "mkswap" ("man mkswap") before attempting to reactivate for swapping. Lastly, if you're going to copy from a boundless file such as /dev/null to a plain file, then use the "dd" command at copy exactly as many (kilo- or mega-) bytes as the file alrady holds. Otherwise it will just grow until all the disk space is occupied. Copying to a partition will fail if you try to overwrite its limits. Randall Schulz