Ubuntu

Swap partition out, swap file in on Ubuntu 17.04

If you’ve downloaded and installed the latest Ubuntu 17.04, one of the new features you probably didn’t notice is that the system was installed without a dedicated swap partition.

That’s because a new installation of Ubuntu 17.04 uses a swap file, instead of a swap partition. Yup, just like Windows, swap file has come to Ubuntu.

For the uninitiated, swap is an area of disk space that the OS may use as virtual memory, or RAM. An OS will use it as if it’s RAM when it begins to run out of real memory. Swap-fueled operations tend to be slower, but it’s either that or the computer/server may freeze, if it’s completely out of memory.

Related Post:  Upgrade Ubuntu 16.10 to Ubuntu 17.04. Your swap partition will be retained

On my test installation of Ubuntu 17.04 desktop, I found a 2 GB swap file under the root directory. Check yours. I’m sure you’ll find it too. Can you find the swap file in this listing?

Figure 1: Long listing of the root file system showing the swap file

And if you launch the Disk tool, you’ll find that the system was installed using just one partition, that is, the root partition.

Ubuntu 17.04 swap file
Figure 2: Disk tool showing the root partition on Ubuntu 17.04

But that doesn’t mean that a dedicated swap partition is gone for good, because the installer’s partition editor still has the option to create one during installation.

Ubuntu 17.04 swap file
Figure 3: The Ubuntu 17.04 installer still supports configuring a dedicated swap partition

The advantage of a swap file over a swap partition is that the former is easier to resize. An LVM-based swap can be resized even easier and faster than a swap file, but when LVM is not in play, a swap file is easier to administrate. More information about Ubuntu 17.04 is available here.

Related Post:  How to install Ansible on your favorite Linux distribution

Subscribe to LinuxBSDos.com

Subscribe to receive the latest articles in your Inbox

Trust me, you'll not be spammed...

Please share:

We Recommend These Vendors and Free Offers

Register now for Blockchain & Cryptocurrency Con 2018, international conference on blockchain technnology in Dallas, TX (USA), Feb. 23-24, 2018. Students can register at a 50% discount.

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).

Deploy an SSD Cloud server in 55 seconds on DigitalOcean. Built for developers and starting at $5:00/month (20 GB SSD, 512 MB of RAM).

Want to become an expert ethical hacker and penetration tester? Request your free video training course of Online Penetration Testing and Ethical Hacking

Whether you're new to Linux or are a Linux guru, you can learn a lot more about the Linux kernel by requesting your free ebook of Linux Kernel In A Nutshell.


6 Comments

  1. I know it’s about abstraction levels, but I completely don’t understand why they’re pushing these changes to masses. What’s the point in it ? I will always stick to physical partition as it’s one layer less than file sitting on OS.

  2. I don’t like this…..why is Ubuntu trying to become more and more like Windows?….I’ll stick to my swap PARTITION thank you very much!….I don’t doubt that the swap file might be faster, but I just like things the way they’ve always been, and I can find things where I know they’ll be!!

  3. finid
    Well that’s hardware dependent too wise guy..

  4. You can easily disable it, create a new swap file where ever you want it.
    Use the mkswap, swapon and swapoff tools. ‘dd’ or Gparted* for the “moving” part. Then remove the old one. If you got lots if RAM (16GB or more) you won’t need it anyway. You can even set it’s priority in ‘/etc/sysctl.conf’ to ‘vm.swappiness=1’ if you are not bothered by the space it take up in your root partition.
    *I think Gparted can create Swapfiles too, not sure..

Leave a Comment

Your email address will not be published. Required fields are marked *

*