Skip to contentSkip to conversation

safe resuming: automatically invalidating an outdated hibernate snapshot

TuxOnIce-devel Martin Steigerwald 3 participants 3 messages Oct 13, 2008 – Oct 16, 2008

lore
Share & tools
lore
#0 lore raw

Am Montag, 13. Oktober 2008 schrieben Sie:

Quoted 1 line

Hi Martin.

Hi Nigel,

Quoted 14 lines · Martin Steigerwald
Quoted 13 lines

Cc to linux-kernel: This is mainly for tuxonice, but it might also be relevant for other hibernate implementations. Maybe some general mechanism for checking whether an on disk snapshot of the system is current would be good - as also the resume parameter could be missing or wrong or whatnot.

Hi!

Is there a way to automatically invalidate the tuxonice snapshot when a non tuxonice kernel is booted accidentally? I.e. could tuxonice recognize when the swap partition has been accessed *after* the snapshot has been written?

[...]

Quoted 4 lines

The simplest way is to mkswap the appropriate partitions from a script run when booting (after we check whether to resume, of course). I believe the hibernate script already has support for this. Maybe pm-utils or such like needs it too?

Simple idea. But I dislike automatically formatting a partition on each boot. What if the user changes the partition layout and forgets to adapt swap partition / resume parameter? AFAIR only mkfs.xfs really checks whether the partition contains an existing filesystem and even that check does cannot trigger in case an undetected filesystem is on the partition.

Thus I'd prefer a way to touch the swap partition without destroying its contents and then checking whether it has been touched after the snapshot has been written. I would then like to have it touched on every bootup on the Linux system. Would something along these lines be possible?

Ciao,

Signature · 2 lines
Martin Steigerwald - team(ix) GmbH - http://www.teamix.de
gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
#1 lore raw

Hi Martin.

Quoted 33 lines · Martin Steigerwald

Am Montag, 13. Oktober 2008 schrieben Sie:

Quoted 1 line

Hi Martin.

Hi Nigel,

Quoted 14 lines · Martin Steigerwald
Quoted 13 lines

Cc to linux-kernel: This is mainly for tuxonice, but it might also be relevant for other hibernate implementations. Maybe some general mechanism for checking whether an on disk snapshot of the system is current would be good - as also the resume parameter could be missing or wrong or whatnot.

Hi!

Is there a way to automatically invalidate the tuxonice snapshot when a non tuxonice kernel is booted accidentally? I.e. could tuxonice recognize when the swap partition has been accessed *after* the snapshot has been written?

[...]

Quoted 4 lines

The simplest way is to mkswap the appropriate partitions from a script run when booting (after we check whether to resume, of course). I believe the hibernate script already has support for this. Maybe pm-utils or such like needs it too?

Simple idea. But I dislike automatically formatting a partition on each boot. What if the user changes the partition layout and forgets to adapt swap partition / resume parameter? AFAIR only mkfs.xfs really checks whether the partition contains an existing filesystem and even that check does cannot trigger in case an undetected filesystem is on the partition.

Quoted 4 lines

Thus I'd prefer a way to touch the swap partition without destroying its contents and then checking whether it has been touched after the snapshot has been written. I would then like to have it touched on every bootup on the Linux system. Would something along these lines be possible?

The only way around this issue that I can see would be if we could get the last mount time of each partition without doing any writes to that partition. We could then record those times in the image header and compare them at boot. Unfortunately, however - as far as I know - there's no support for that at the moment.

Regards,

Nigel

#2 lore raw
In reply to Martin Steigerwald
Quoted 22 lines · Martin Steigerwald

Am Montag, 13. Oktober 2008 schrieben Sie:

Quoted 1 line

Hi Martin.

Hi Nigel,

Quoted 14 lines · Martin Steigerwald
Quoted 13 lines

Cc to linux-kernel: This is mainly for tuxonice, but it might also be relevant for other hibernate implementations. Maybe some general mechanism for checking whether an on disk snapshot of the system is current would be good - as also the resume parameter could be missing or wrong or whatnot.

Hi!

Is there a way to automatically invalidate the tuxonice snapshot when a non tuxonice kernel is booted accidentally? I.e. could tuxonice recognize when the swap partition has been accessed *after* the snapshot has been written?

[...]

Quoted 8 lines
Quoted 4 lines

The simplest way is to mkswap the appropriate partitions from a script run when booting (after we check whether to resume, of course). I believe the hibernate script already has support for this. Maybe pm-utils or such like needs it too?

Simple idea. But I dislike automatically formatting a partition on each boot. What if the user changes the partition layout and forgets to adapt swap

Simple solution: add --only-mkswap-when-its-hibernation-image option to mkswap.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html