Creating swap space in a Primary or an Extended partition
During installation, I have a choice of creating swap space in a Primary or an Extended partition.
Which should I choose?
During installation, I have a choice of creating swap space in a Primary or an Extended partition.
Which should I choose?
Hi Abel
Either will work. There is no technical advantage to doing it one way or the other, but there are
only a limited number of primary partitions that can be created, so if you plan on installing
more than one operating system you might want to put the swap space in an Extended
partition and save a Primary partition for other uses.
Note: If you have Microsoft Windows installed, it may not boot if you have more than one
primary partition installed on the bootable disk drive (what Windows sees as C:). In this case,
Linux would have to be installed in an Extended partition, or in a Primary partition on a second
hard disk drive. For more information, refer to the lilo (Linux LOader) documentation on a
Linux system, using the command: man lilo (no, man is not a politically incorrect
command it is merely short for manual). If you do not yet have a Linux system set up where
you can read the lilo documentation there are a couple of other options available:
1. If you are installing from a CD set, look for a directory or separate CD (as in Red Hat 6.2) containing
documentation, possibly in HTML format.
2. Visit Linux Web sites, such as  and, for online documentation.
The swap space in Linux and the swap file in Microsoft Windows are just the same. They are both used as load balancer. When the computer’s physical RAM is almost full, some of the data being transferred to and from the memory are transferred or relocated to the swap file.
The swap file acts as an extension to the physical RAM of the machine. Although it extends the capacity or capability of the computer to hold more data, access time in swap file is much slower compared to the physical RAM because the data stored in the swap file are stored in the hard drive.
To determine the amount of swap to use, we can use this formula:
If M < 2
               S = M *2
Else
               S = M + 2
M is for memory and S is for swap. To explain the formula, if the physical RAM [M] is less than or equal to 2 GB, swap [S] should be equal to twice the amount of RAM. So that means if you have 2 GB RAM your swap will be 4 GB. But if your RAM is above 2 GB let’s say 3 GB, you will only need to add 2 GB to the amount of RAM for the swap so that puts to 5 GB. So for a computer with 3 GB RAM you will have 5 GB of swap.
Generally, there is really no difference if you put your swap either in primary or extended partition. But there are incidents where users are having problems booting when the swap is set to the primary partition.
So I guess it’s up to you where you should place it.