Other HOWTO share labeled swap between FreeBSD & Linux

You can't unless you run mkswap on Linux before using it. If FreeBSD writes to the swap partition the Linux swap metadata will be destroyed or corrupted making it unusable by Linux. To get around this you'll need to create a systemd service to mkswap the swap partition and enable it.

FreeBSD, like all other UNIX/UNIX-like variants except for Linux simply uses swap without swap metadata. Linux needs its swap metadata in order to use swap.
 
You can't unless you run mkswap on Linux before using it. If FreeBSD writes to the swap partition the Linux swap metadata will be destroyed or corrupted making it unusable by Linux. To get around this you'll need to create a systemd service to mkswap the swap partition and enable it.

This is not really needed anymore with this workaround that prevents the metadata from being overwritten.

But even without this patch, swapon calls mkswap if needed as you can see here. Only labeled swap in /etc/fstab would be unusable without this workaround.
 
Actually, the partition marking that Linux does is an excellent idea. FreeBSD should use one, too, and there is no reason to use a different on-disk format than Linux.
 
swapon shall not overwrite the header!

swapon: Do not overwrite Linux swap header

Hope I'm not breaking any rule wrt shameless self-promotion. I just want people to test it lol.
 
Don't put the Linux partition into hibernate while using the FreeBSD partition because Linux writes to swap on hibernate, and FreeBSD would overwrite that.
 
Back
Top