I am using dual-boot on my laptop, but I only have 1 swap partition which is shared. Hibernation is enabled for both OSes I have installed.

All works well except the case when I hibernate, and then choose the "wrong" OS from the GRUB menu - this leads to data loss from the hibernated session.

Question: is there any way to have such a configuration working properly? Ideally I'd like to automatically boot the system that has been hibernated, so data is not lost?

My SSD is just 120GB and that is why I would like to avoid having separate swap partitions.

Edit (additional info):

The two OSes I am using:

  • Kubuntu LTS
  • newest Kubuntu (sometimes it changes if I want to experiment with another distribution)

Both OSes update GRUB in case new kernel is available. GRUB configuration is the same. GRUB is installed on /dev/sda

I am using ext4 on both system partitions. No partition is being encrypted.

  • 2
    In case it matters, which two OSes? – derobert Jun 21 '17 at 16:52
  • This q at superuser looks like it has a possible answer: superuser.com/questions/383140/… – Joe P Jun 21 '17 at 17:35
  • @derobert One is Kubuntu LTS, thee other one is the latest version of Kubuntu – MaciekTalaska Jun 21 '17 at 19:28
  • @JoeP I have had a look at it, but it doesn't seem to solve the problem I am having. I am able to resume from hibernate session without any problems. The thing is I have to remember which OS to choose from the GRUB menu. In case I am wrong my saved session is lost (due to swap being shared) – MaciekTalaska Jun 21 '17 at 19:29
  • 1
    Since swap isn't a normal partition with a file system on it, it's pretty unlikely that there's a generic solution to this. Workaround: Put one OS in a VM instead of dual boot. You could also setup one OS to boot from an external drive (with just minimal stuff on the external drive) and then its swap could be there, but that would be slow if you need swap space after booting. You can also make a swapfile in the root partition, but I would think there's no way for that to work for hibernation - but it would leave the other OS swap partition intact so it could still hibernate. – Joe Jun 25 '17 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.