0

Is there a way to detect whether a swap partition contains the memory of a hibernated system?

More specifically: suppose I have a Linux installation and that I hibernate it. This means that all the content of the RAM is dumped on the swap partition and then the computer is shut down.

Suppose that in the meantime I start another Linux on the same system (either because it resides on another partition, or because I use a live system). If I used the same swap partition, that would corrupt the data of the hibernated system, and I do not want that. So I would like to be able to tell whether a swap partition is keeping "interesting" data or just leftovers of a properly shut down system.

Is there a way to distinguish between these two cases just by looking to the content of the partition?

I am not asking whether data become corrupted or not. I am sure they will. I am asking if there is a way to detect whether the swap I would like to use contains data of an hibernated system, so that I can avoid turning it on if it does.

  • While this does not answer your question, the "proper and usual" way to deal with the problem you're describing is to use two swaps, one for each system, hence avoiding all conflicts. Now I'll let someone else answer "how can my systems share a swap partition kindly without hurting one another?" – John WH Smith Dec 12 '14 at 16:33
  • Sure, but I am not in the usual situation. In my case the second system is a live system that should not touch the disk in general (but would take advantage of swap partitions, provided that there are reasonable guarantees that this does not cause problems with installed systems). – Giovanni Mascellani Dec 12 '14 at 20:49

0 Answers0