Ubuntu – Sharing of swap partiton between linux systems


I have a laptop on which I have installed Ubuntu 12.04 and Windows
Now just for learning purposes I am going to install Backtrack OS on it.

My laptop has 4 GB of RAM so according to the recommendation I have allocated 8 GB of swap space on my hard drive.

can I share the swap space between these two OS (Backtrack and Ubuntu)

I really don't want to waste 8 GB of more space for swap (because as I have noticed it is rarely used and as far as I know OS doesn't store any data in swap space, does it?)
So is there a way with which I can share this 8 GB swap partition? If yes how?

Best Answer

Yes, you can share swap area with two or more operating systems. To share swap area, create the swap area when you install the first operating system and then when you install the second one, do not create a new swap area, instead just use the first OS's swap area as the mount point for swap area of the second OS.

If you have already installed both OS's, use gparted to create a common swap area and then add it to your /etc/fstab file to automount it at boot-time.

Just in case you would like to know the drawbacks of using a shared swap area, refer this question on StackExchange:

Related Question