I'm (re)installing Ubuntu on my Toshiba NB100 netbook (Intel Atom, 120GB HD, 2GB RAM). Already have a partition I call "Stuff" with all my media and docs. Will be deleting the one I had Win7 on (making it the swap), and then there is a recovery one.

How big a swap partition should I create?


See https://help.ubuntu.com/community/SwapFaq

Here is an excerpt:

How much swap do I need?

For less than 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM depending upon the amount of hard disk space available for the system because of diminishing returns.

For more modern systems (>1GB), if you use hibernation, your swap space should minimum be equal to your physical memory (RAM) size, otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. The only downside to having more swap space than you will actually use is the disk space you will be reserving for it.

The "diminishing returns" means that if you need more swap space then twice your RAM size, you'd better add more RAM as Hard Disk Drive (HDD) access is about 10³ slower then RAM access, so something that would take 1 second, suddenly takes more than 15 minutes! And still more than a minute on a fast Solid State Drive (SSD).


For a netbook, you'll probably want to be able to hibernate the computer. The process of hibernation requires that all the data¹ in RAM be written out to the hard disc, in swap, which means that it's a good idea to have at least as much swap space as RAM. If you don't need to hibernate the computer you won't need that much swap.

Now, the trick is that this swap space doesn't actually have to be a dedicated swap partition. Like Windows, the kernel can use swap files on your regular filesystem², and they're just as fast as a swap partition. It's much easier to add more swap with a swap file than to re-partition, though. See the FAQ from this answer for instructions on how to add swap files.

So, in short, don't worry about how much swap you need; if you need more, you can easily add it.

¹: This is not quite true - before writing the data in RAM to swap, the kernel will remove from memory everything that it can. This will generally include a lot of program code (because the kernel can just read it back from the disc) and all the disc cache, etc.

²: This capability is actually filesystem-dependent. Most linux filesystems support having swap files on them - ext4, which is the default, certainly does. The new btrfs filesystem is an exception, so if you're playing with that you'll need a swap partition.


Usually it should be equal to your RAM which makes it 2GB which should be enough for day to day applications.


I think a rule said - for 1 gb or less of RAM swap must be the double of the RAM. - more than 1 gb you dont need to use more than 2 gb of swap.


swap area can be seen as a virtual ram for your Linux System. it is basically used when the physical memory (RAM) is full. and if the system needs more memory resources, then the inactive pages in memory are moved to the swap space. generally, swap should be half the size of the physical memory. 2GB is enough size for the swap if the RAM is 4GB. it would be more than enough if the Size of swap is equal to or more than the RAM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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