Question:
I have an old Fedora installation on my system. I have just upgraded my RAM from 256 to 512 MB. My swap partition is also of 512 MB. Is there any way by which I can increase my swap space to 1 GB without formatting and reinstalling my OS.
Answer:
Sure you can increase the size of swap without reinstalling the OS. This can be done by either adding a new
swap partition or creating a swap file, instead. Here, I will discuss the steps to add a new swap file to increase the swap size as this is possible even if you do not have free unpartitioned space in your hard disk for creating new partitions, but have free space on one of your partitions. To make a swap file of 1 GB,
multiply 1024 MB and 1024 to get a block size. Now, at a shell prompt, as the root user, type the following
command with the count being equalto the desired block size:
dd if=/dev/zero of=/swapfile bs=1024 count&#