I have 16GB of RAM and the core system is run on 128GB sddisk. So I don't have space to use 16/32 GB for swap.

Can I create swap on another hard disk? Or it has to be on the same disk as the system?


What are the steps to migrate swap from /dev/sdc3 to /dev/sdb. The file fstab looks like this

# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=6d9c9f84-02f0-4f59-b57f-6a4ebd06b87f /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=4B73-5222  /boot/efi       vfat    defaults        0       1
# /home was on /dev/sda4 during installation
UUID=b0233bff-100f-4741-ad00-29ffc6f26057 /home           ext4    defaults        0       2
# swap was on /dev/sda3 during installation
UUID=1a3ad087-9ba3-4312-9307-a84dade9e1bf none            swap    sw              0       0
  • hmmm... I've yet to see a linux installation where the 'core system' would take over 30 GB space :)
    – mike3996
    Dec 16, 2014 at 18:31
  • You are right about core system, but I meant to /home as well which is on the sddisk and already consumed 30GB of space (out of 70GB).
    – ubuntico
    Dec 16, 2014 at 18:35
  • Take a look at How to increase swap space? as it could be best solution for almost any situation nowdays. Of course you could also create multiple swap partitions and/or files (using different physical storage media) to make it faster. Dec 16, 2014 at 22:06

2 Answers 2



You can choose to do this at the time of installation, or you can make a swap partition with a tool such as gparted and then activate the swap with swapon. Add it to your fstab to make it available on boot.

For help with making the swap partition: How do I restore a swap partition I accidentally deleted?

For help with turning swap on: You literally just type sudo swapon into a terminal

For help with adding to your fstab: How do I add a swap partition after system installation?

  • Can you write a step to migrate swap from sdc3 to sdb disk?
    – ubuntico
    Dec 16, 2014 at 17:49
  • Just edited my post, let me know if those links help
    – Mitch
    Dec 16, 2014 at 17:50

Since you have 16GB of RAM, there is no need for a 'swap' partition. Also, the 'swap should be 1-2 times the RAM' rule is only valid for systems having less RAM, ie < 2GB.

You can create a swap partition on a separate drive by using mkswap and swapon.

Eg - To to migrate swap from /dev/sdc3 to /dev/sdb1 -

swapoff /dev/sdc3

mkswap /dev/sdb1

swapon /dev/sdb1

and edit swap entry in /etc/fstab.

  • I am trying to enable hibernate and the system is not waking so I read that I have to make swap as large as RAM to make hibernate work. Now, how do you set the size of swap? Do I have to make swapon on each startup?
    – ubuntico
    Dec 16, 2014 at 17:53
  • 1
    Create a new partition in the drive ie /dev/sdb1. Now, use the commands mkswap and swapon to create a swap partition and edit the fstab entry so that the system knows where the swap is located. This is a one-time process. Dec 16, 2014 at 18:00
  • You can set the size at creation time. Dec 23, 2018 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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