DebianThis forum is for the discussion of Debian Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The "dd" part looks alright, but I think your suppose to include the block count with the mkswap command:
# mkswap /swap 524288
Also, I believe your suppose to run the "sync" command after you run mkswap to make sure the format info has been written to the new swap file.
You can do it that way with a swap file, but most people would use a separate swap partition. It's suppose to give better performance because the blocks on a swap partition will always be contigous. Not so if you use a swap file.
it works thnx. well i already have a swap partition, however every linux documentation says that my swap space should be at least my RAM multiplied by two. well i have 512MB of RAM, and i've got no free space on my HDD where i could make another swap partition, so i need a swapfile.
Originally posted by jogurt666 it works thnx. well i already have a swap partition, however every linux documentation says that my swap space should be at least my RAM multiplied by two. well i have 512MB of RAM, and i've got no free space on my HDD where i could make another swap partition, so i need a swapfile.
That can be misleading you really do not need much swap space when you start to get larger amounts of ram installed. I noticed when I had 512mb in my main computer the /swap rarely if ever got used and when I put another 256mb in it then the /swap never gets used.
That's an old rule that has little relevance with todays high memory configurations. You don't need 1GB of swap if you have 512MB of ram. Check your memory usage and see how often you even go into swap with 512MB of ram. Hardly at all I'd venture to guess unless your doing some really intensive, wierd multitasking. 500MB of swap is more than enough with your ram and I doubt that you'll ever use even a fraction of that swap. I wouldn't bother with the swap file unless your running into a lot of out of memory conditions.
well i thought that i may run out of it, since my system hangs sometimes. i've got no idea why. during kernel configuration i've chosen my processor type (that is Athlon) and enabled kernel support for big memory systems. it now works more stabile, but sometimes still hangs. if not by adding swap, how can i root the problem out?
I read an interesting article somewhere that advocates a swap partition (not always the biggest though) regardless of RAM size. Had to do with swapping out processes that were inactive. I wish I remembered where I found that...
1. A good way to know if your swap is being used is to put a "system monitor" applet into your Gnome/KDE panel and configure it toshow swap. Note that memory will always appear almost full, unless you change the color for buffer/cache
2. There is a good reason to always have some swap: if a process for any reason go crazy and starts forking on and on, without swap it may fill memory before you actually know, making it hard even to manage to kill it. If you have swap, after a while the pc will not hang, but slow down a lot, so further forks will not be as fast, and you can get a console and killall the process.
An effective way with number values is to have TOP running in a minimized terminal. Then you have a numerical value to work with. I suggest something really light like RXVT, which will snap to attention and not take up mant more resources