Would suspending Linux to disk and resuming on another PC work without problems?

1

I have an external SSD in an enclosure and I'm thinking of moving a Linux installation on it, so that I could conveniently share the same setup across multiple PCs. But with Linux's suspend feature I'm wondering if it would be possible to also share the RAM state across PCs, too - when finishing work on a PC, suspend Linux to the drive, plug the drive into another PC (with different hardware configuration), and resume from the hibernation, effectively retaining the state (running processes etc) as it was on the earlier PC.

Has anyone tried this, can it work, or are there any known or likely issues associated with the idea?

Wiener Boat

Posted 2017-02-18T21:14:49.087

Reputation: 111

3Pretty sure it won't work. I'm not sure it'd even work even if the hardware was identical in each one. Memory mapping and other bits would get confused I'd suspect, not to mention you'll have the wrong kernel modules loaded (and as you're not in the boot process you won't easily be able to load more).

Please, someone prove me wrong, as that'd be awesome! – djsmiley2k TMW – 2017-02-18T21:16:31.163

@djsmiley2k Thanks, this is honestly what I'm suspecting too. Linux probably isn't reloading kernel modules or doing any other boot routines when resuming from hibernation so this is really a long shot. Would have been cool though :) - I'll see if I can't test it with a Linux pendrive and post results back – Wiener Boat – 2017-02-18T21:22:57.237

3I can't see this working at all without identical hardware. A resume from hibernation is nothing like a normal boot. Hibernation saves the contents of RAM which is restored during resume. The kernel would expect to take over where it was before hibernation. Most of the kernel wouldn't even be aware that anything had happened. It would find everything related to drivers and hardware wrong and could not cope. It would do the only thing it could and crash. – LMiller7 – 2017-02-18T21:42:29.413

Answers

0

It will not work. According to the documentation, it will "probably" not destroy your filesystem. Please do not try it. "Probably" is not a good word to see in a sentence like this.

If you change your hardware while system is suspended... well, it was not good idea; but it will probably only crash.

https://github.com/torvalds/linux/blob/v4.17/Documentation/power/swsusp.txt

(Hibernation = suspend to disk. Historical references like this may describe it as "software suspend" aka "swsusp". Don't ask me what other type of suspend there would be; I don't remember that particular historical detail).

sourcejedi

Posted 2017-02-18T21:14:49.087

Reputation: 2 292