Discussion Locked

Swap Space

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to increase the swap space in Red Hat 7.3 configured with Grub.when thwe machine is up and working,i find high response time.hence want to increase the swap space,pls let me know how its done.

Thanks

5 replies

by alveden

There are two options.

Options 1
The easiest is, if you have unpartition disk space, is to
1. create a new partition, tag it as linux swap, using fdisk.
2. mkswap /dev/hda# [# = the new partition number]
3. Add a line that look like this intothe fstab file.
/dev/hda# swap swap defaults 0 0
4. Reboot or type swapon /dev/hda#.

Option 2.
If you do not have any unpartition space but a lot of space in you mounted volume.
1. run the command
dd if=/dev/zero of=[/newswap] bs=1000000 count=20
Where newswap is a file and should reside in the partition with the most freespace. This should give you addtional 20MB ... if you want to increase it to 128MB ... just modify the count=20 to count=128.
2. mkswap /newswap
3. Add this line in to your fstab file
/newswap swap swap defaults 0 0
4. Reboot or type swapon /newswap.

by roger

Converting hard drive space to a partition as suggested by your first responder will work. However, it may actually slow down your system if the swaps are taking place on the same drive that you are reading or writing data on. I would suggest thatyou install an additional hard disk and configure space on that disk as swap space with the directions you were given first. Swap space is always more efficient if it is not located within a formatted file system.

This discussion is closed to new replies.