0

Possible Duplicate:
Is it safe to turn swap off permanently?

In my PC there is two OS, windows7 and Ubuntu . I installed Ubuntu after the installation of Windows 7. During installation i provided one windows partition as swap area. After the completion of installation I changed the swap area in to ntfs using windows. now i use ubuntu without swap area. any problem......

ani
  • 21
  • 3
  • i like to know there is any relation with swap area and speed of computer os (ubuntu) – ani Nov 13 '12 at 15:33

2 Answers2

1

Swap partition considerations

Swap area is necessary only to supplement RAM. Simplifying a bit: When your computer is running short of Ram it uses Swap as virtual RAM.

In my experience, Ubuntu uses very little RAM when compared to other OS's. SO if you have, say 4 Gb of RAM, it is unlikely you'll ever need it unless you run programs that require a lot of RAM (photo and video editing are examples).

In any case it is good to have a Swap area just in case. 3 to 4 Gb should be enough.

How to add a swap partition

To create a Swap partition you'll need to modify your partitions using gparted. If you want to reduce the Ubuntu partition by 4gb to make space for Swap you'll have to boot from a liveDVD or live USB because you cannot modify a partition that is mounted.

How to create a swap partition depends on your current partition table. You can only have 4 primary partitions. So if you do not have an extended partition (which can contain many logical partitions) and you already have 4 primary partitions, you'll have to delete one partition, create a new extended one and then recreate two new partitions or whatever is needed. Make sure you keep a backup of anything important on the drive, because partitioning is a low-level operation and a mistake or a power failure at the wrong moment might cause data loss.

So boot from a liveDVD or liveUSB Ubuntu, run gparted, reduce the Ubuntu partition by 4 Gb or so. create a new partition setting it as swap.

Update Grub

After you do this you might need to update grub by typing sudo update-grub in a terminal before restarting your computer.

If you require more specific information, specify how your disk is partitioned.

To Do
  • 15,502
  • 1
    i have only 2 GB ram. intel i3 processor, hdd 300GB. I provided single partition of 85 GB for ubuntu. Is there any option for providing swap area after installation of ubuntu. if yes then how ? – ani Nov 13 '12 at 15:46
  • Yes. See modified answer. – To Do Nov 13 '12 at 15:51
  • Helo To Do please help – ani Nov 13 '12 at 15:52
  • no modification in the above answer – ani Nov 13 '12 at 15:54
  • i have only 2 GB ram. intel i3 processor, hdd 300GB. I provided single partition of 85 GB for ubuntu. Is there any option for providing swap area after installation of ubuntu. if yes then how – ani Nov 13 '12 at 15:58
  • partition details are as follows: – ani 14 mins ago

    windows have c, d partition and one system partition (automaticaly done during windows installation) one partition in ubuntu –

    – ani Nov 13 '12 at 16:49
  • So you already have 4 partitions. What is the D partition? If all four are primary partitions the easy way to add a 5th partition is to delete your current Ubuntu one and reinstall. But if the Ubuntu installation created an extended partition then you may follow the instructions in my answer. Otherwise you may delete the d partition, create an extended partition and the two logical ones. You will have to sudo update-grub after doing this for grub to work. – To Do Nov 13 '12 at 17:34
0

Not sure about this but I believe that swap is also used to save what is in the RAM when you hibernate the computer, as it will last even when power is off.

If I'm correct you may not be able to hibernate.

Presbitero
  • 1,155
  • 3
  • 11
  • 22