Linux – Is it safe to share a swap partition with more than one Linux OS

linuxswap

I have one swap partition, and 3 installed Linux OSes. So I'm just wondering, are there any safety risks or potential problems that can come about as a result of having all 3 OSes use this partition?

Only one of them can be booted at any given time, and each one releases the swap partition when powering off/rebooting. So if I were to, say, shut down Fedora and boot into Arch, could there be issues relating to the swap? Like data from the previous OS being used by the currently booted OS? So far I haven't ran into any issues.

Should I just create a separate swap partition for each OS? I know that trying to share a hibernation file/swap partition could create issues, since another OS could try to hibernate from another OS'es data. But I don't use hibernation, since my installs are on an SSD. I've had issues with hibernation in the past (like Windows acting wonky).

Best Answer

Yes as long as you don't try anything weird such as hibernating one OS, then booting directly into another and expecting no issues. (One version of hibernation will save the ram directly into the swap partition.).

All you need to do is make sure that each O/S you've installed mounts the correct swap partition.

Related Question