What you're asking for is impossible using your current setup:
You have a swap partition and that's where the hibernation goes. Ubuntu is not Windows with a separate Hibernation file that takes up additional space on your hard disk.
However, if you change your set-up and start using 2 swap files instead of just one swap partition, you can fool the system to swap to HDD instead of SSD just prior to hibernation by activating the HDD swap and deactivating the SSD swap file.
Is this a good idea? No, because using the swap file on your SSD will wear out the SSD much more then the simple fact of hibernation...
But anyway, that's what you asked for and that's what you'll get:
Create 2 new swap files. Have a look here for the size if you've got more then 1GB of RAM. In the below example sda
is the SSD and sdb
the HDD.
dd if=/dev/zero of=/dev/sda/szMountPoint/SSDSwapFile bs=1024 count=iSizeInKBytes
dd if=/dev/zero of=/dev/sdb/szMountPoint/HDDSwapFile bs=1024 count=iSizeInKBytes
where szMountPoint
is the string denominating the mount point you want the file to be and iSizeInKBytes
is the size.
Now activate both swaps:
mkswap --check --label SSDSwap /dev/sda/szMountPoint/SSDSwapFile
mkswap --check --label HDDSwap /dev/sdb/szMountPoint/HDDSwapFile
Remove your existing swap partition from fstab
- Reboot.
Now you have 2 swap files that you can activate/deactivate with the commands swapon
and swapoff
and you can control everything you want including hibernating to the HDD!
Freebie
Have a look here on how to optimise your SSD to have it wear out less (example is for a USB stick, but the parameters are good for an SSD as well)