Click to See Complete Forum and Search --> : Please tell me about Linux Swap file
WaveSurfer
05-06-2001, 05:43 AM
As a former windows user I always erased my swap file and deleted temporary files. In linux Im not sure what to do. Is linux the same in this way. Are there any Erasor type packages where you can schedule these tasks to be done ??
Stween
05-06-2001, 07:03 AM
I dont know about deleting temp files, but you can forget the whole deleting the swap file thing anyway...
Linux uses a swap partition, not a swap file. This means the swap space available is always the same size and always in the same place, and as far as i know makes it faster and more stable than windows swap file method. You cant, and really have no need nor want to, delete it...
Why on earth would you want to delete your windows swap file anyway?? Its not like it fills up ur drive and doesnt let you write anything....
WaveSurfer
05-06-2001, 07:33 AM
Stween,
Im no computer expert but have had the misfortune to loose valuable business information to a competitor which was on a Windows machine. Because of this unfortunate experience I have looked at file encryption and security of my info. It seems that in Windows if you have just typed out a confidential document on a word processor or encrypted a file some of that data or even your private key could be on the swap file in Windows. This is why there are quite a few packages availble to take care of this problem. Loose some money because of sloppy computer security and it will sharpen your interest in these matters.
So Im interested in the Linux Swap partition for the very same reasons and have switched to Linux because Im told it is far more secure in all ways. So my question is still how is the swap partiton normally managed for those with an eye for security.
Lorithar
05-06-2001, 10:54 AM
*umm*
Unlike windows the linux system doesn't use the swap file as religiously. Actually ... using your swap space in linux is a bad thing, usually indicating a serious problem with memory management. Applications are NOT allowed access to the swap space...it is the exclusive province of the OS. Since the swap space is for paging out current memory when there is insufficient physical memory present, the data in the pages on disk is only current. Perhaps after a kernel fault, there may be data on the swap partition that is relevant to the issue you raise, but only if the system overloaded working ram prior to the failure.
On my system the ONLY time I've seen it use the swap space has been when I brought up a kernel without the ppp components built in and my autoconnect scripts spawned at an insane rate, without shutting down ... eventually chewing through all 192Mb I have installed.
I believe that you could put a function in your shutdown and startup scripts to wipe it clean, although specifically how I don't know. Beyond that ... I suspect that you may have to ask the kernel.org people for further details...
As for temp files, you can make sure that there are no issues, by setting a script that periodically wipes /tmp clean... I have one that blows away anything in /tmp that does not have a specific extention other than .tmp every four hours... although I'm still trying to get it to gracefully handle sawfish runtime files ... (sawfish creates a user directory for every user logged on running sawfish and puts the display and desktop and temp files in there ... it doesn't appear to update the files much , but at least fuser finds the owner ... and can tell if the owner is still active)
Check out freshmeat for prewritten scripts and whatnot .. .there is somewhere a kernel add-on which can use ssl (openssl) keys for temp files, and since the key is built on the fly, and is one time only (for the life of the app) ... this makes for very secure temp files... dunno where I saw that though ... and it seems rather a lot of work for this sort of security ..
Look up steganography if you are *really* paranoid ... it is a method of burying data of one type in a file of a different type of data .. .going as far as entire filesystems ...
WaveSurfer
05-06-2001, 08:06 PM
Thanks Lorithar exactly the info Im after. Are there any groups sites that cover this topic ??
The_Stack
05-07-2001, 12:27 PM
You can attempt to create a new swap area, disable your old swap area, enable the new swap area, then reformat your old swap area. It is also possible to use a "swap file" instead of a swap area, so technically you could have two swap files and just switch between then, erasing and recreating the swap files as needed.
read the following man pages for details:
man mkswap
man swapoff
man swapon
Good Luck!