Linux Move swap space from one location to another location

Posted on in Categories , , , , , last updated February 27, 2007

Q. How do I move swap space from one location / partition to another location under Fedora Core Linux server?

A. Swap partition or file used by most modern operating systems. This space on a disk in which the system can write portions of memory to. Usually this is a dedicated partition, but it may also be a swapfile.

There is no command or method exists that allows you to move swap space from one location to another. You can turnoff current swap space with swapoff command in the original location.
# swapoff /dev/device

Next create a new swap space with mkswap. Just follow these instructions for adding a swap space.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Leave a Comment