Originally Posted by Ashhere
Can you please explain a bit more. I mean if I need to set the memory in a drive,say D(hope its possible),of size 1gb, how to specify the arguments?
If you have at least 256 Meg of RAM you can probably run without any swap at all. Use the swapoff command to turn swap off completely:
Then you can do whatever you want to do with your swap partition, make it bigger, smaller, create two or more, or whatever. After you get the swap partition(s) set up the way you want then you format the swap partition(s) with the mkswap command (see: man mkswap)
You can also create one or more swap files instead of swap partitions but as michaelk said swap partitions run faster than swap files.
You then change /etc/fstab to describe your new swap configuration correctly. Then you turn swap on with the swapon command: