I have two swap partitions in fstab :
/dev/sda8 none swap sw,pri=1 0 0
/dev/sdb8 none swap sw,pri=1 0 0
How to set swap in /etc/initramfs-tools/conf.d/resume
file?
According to SwapFaq this will not work for 12.04:
INFO: This will not work for 12.04, resume from hibernate work differently in 12.04.
How to do it in Ubuntu 12.04?
Check UUID
Then
to pull up the boot loader configuration. Look for the line GRUB_CMDLINE_LINUX_DEFAULT="" and using your UUID add:
That means change this
to this
save then edit:
and make sure its contents are
(with your UUID of course in place of mine). Save the file!
Reboot!
https://help.ubuntu.com/community/SwapFaq
Edit: Technically only one of the two methods needs to be used, the kernel parameter in the grub file will take precedence over the initramfs resume config file
(18.04) You can also edit
/etc/initramfs-tools/conf.d/resume
and changeRESUME=UUID=$uuid
to the output ofblkid /dev/raidN
(whatever block device your 2 swap devices are RAID'd as)