What is Swap Partition in Linux?

In this article, we will find out what the Swap partition in Linux is after all.

What is Swap Partition in Linux?

What is Swap Partition in Linux?

Swap is similar to the memory expansion feature on smartphones offered by some manufacturers recently. In short, it uses the phone’s internal storage like RAM if the RAM runs out of space. Similarly, on Linux, the Swap partition keeps your computer from crashing by storing volatile data on the internal memory (HDD/SSD) if your physical RAM is full.

Creating a Swap partition is not necessary to install Linux, but if your computer has less RAM and more storage space, then you can make use of your hard drive to create a Swap partition as it can be useful in some cases.

How much space is needed for the Swap partition?

If your computer has the characteristics we mentioned above, then you should create a Swap partition, but the question is how much space should you create?

There’s certainly no limit to the size of the Swap partition you can create, but the general view is “Swap partition capacity is half of your RAM.” However, only create a Swap partition if you are sure that you will run memory-intensive programs and perform a lot of tasks, otherwise you will essentially be wasting storage space that you could use to store other things.

How to Create Swap Partition in Linux

After creating the / and /home partitions, the next step will be to create the Swap partition. All you need to do is create an empty partition sized depending on the amount of RAM you have (2GB to 4GB of Swap partition space minimum if you have 8GB RAM). In the options select “use it as swap” or any word related to Swap and click create. You can then continue with the installation.

What is Swap Partition in Linux?  16

In addition, you can also install Ubuntu side-by-side with the latest Windows 10 here.

Leave a Reply