Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The matter is that my computer has 3Gb of memory ram. Therefore i think that i don't need too much swap memory size, and i really need free space in the hard disk. sorry by my English

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

Yes. You can change the size of the swap partition, by using GParted. You can install it from the Ubuntu Software Center.

Remember that gparted won't work on a mounted partition. When you are working on the swap partition, you have to unmount it first with swapoff. When you are done, to active the new swap space you do it with swapon.

NOTE: You might want to consider doing this from a live/bootable CD or USB, to be safe. Also keep in mind that anytime you deal with partitions, there is risk involved in doing so.

NOTE: When dealing with partitions, always make sure that a backup is available in case something goes wrong. You may consider Clonezilla

share|improve this answer
4  
It's inadvisable to change the partition table on the system drive from which the OS is running. When the size of a partition changes, that is done by editing the partition table. There are many good applications of GParted on installed Ubuntu systems, but this mistake is why it's not installed by default. To resize partitions, you should boot from an OS not installed on the physical drive where you're doing it. (So you can use an Ubuntu live CD/DVD/USB for this.) I'd recommend editing your answer to account for this. (If you prefer, though, I could post a separate answer.) –  Eliah Kagan Jul 14 '12 at 18:36
add comment

I think that your best option is to lower the "swappiness" value, dealing with the partition table of your HDD can be tricky and dangerous.

run this command

gksudo gedit /etc/sysctl.conf

add this line

vm.swappiness=0

restart the computer, the kernel will not use the swap, the swap will be mounted but unused.

you can set this between 0 and 100, the meaning of this option is about the percentage of use of the swap space, 0 = never use the swap.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.