Red Hat Bugzilla – Bug 165863
swsusp swaps should be reinitialized
Last modified: 2007-11-30 17:11:11 EST
If you have a swap partition that's been used for swsuspend and you boot into a
different kernel, we should have the swapon re-initialize the swap to avoid
later resuming and causing data corruption.
We can either do this by adding some magic to rc.sysinit to look at every swap
partition and do the mkswap if needed or have swapon do it.
I vote for swapon. :)
Doesn't seem insane, so -> util-linux
I'm really not sure if destroy data on any partition automatically without
user's confirmation is good idea. I think clean solution should be something
like: "Detected old swsuspend partition. Do you want to re-initialize it to
standard system swap? (y/N)" ... and it's work for system startup scripts of
It should not be problem add one "if [...]" before swapon call in rc.sysinit.
The problem is that if you _don't_ do it, then we get data corruption the next
time you boot the older kernel that you had suspended on.
Also, doing it from initscripts is not at all trivial given things like swap
How can I detect swsuspend-swap partition? I mean difference between standard
system swap and swap with old swsuspend data. I need a way how determine when
I think better than change something in the swapon command will be create new
swapstatus command that we can use in some if[...] in rc.sysinit. Things like
swap labeling aren't problem (see the blkid command) -- but label and uuid could
be part of swapstatus output too.
swsuspend changes the swap space header (typically SWAPSPACE2) to contain either
S1SUSP or S2SUSP, thus it's really easy to tell the difference.
Well, after investigation I think implement it to swapon is more simple way :-)