Bug 165863 - swsusp swaps should be reinitialized
swsusp swaps should be reinitialized
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
Depends On:
Blocks: FC5Blocker
  Show dependency treegraph
Reported: 2005-08-12 17:38 EDT by Jeremy Katz
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-06 02:23:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jeremy Katz 2005-08-12 17:38:53 EDT
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.
Comment 1 Bill Nottingham 2005-08-19 02:56:32 EDT
I vote for swapon. :)
Comment 2 Jeremy Katz 2005-08-19 10:39:25 EDT
Doesn't seem insane, so -> util-linux
Comment 3 Karel Zak 2005-08-22 03:02:42 EDT
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
course :-)

It should not be problem add one "if [...]" before swapon call in rc.sysinit.

Comment 4 Jeremy Katz 2005-08-22 13:07:43 EDT
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
Comment 5 Karel Zak 2005-08-25 03:06:37 EDT
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
call mkswap.

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.
Comment 6 Jeremy Katz 2005-08-25 09:06:01 EDT
swsuspend changes the swap space header (typically SWAPSPACE2) to contain either
S1SUSP or S2SUSP, thus it's really easy to tell the difference.
Comment 7 Karel Zak 2005-08-26 08:52:37 EDT
Well, after investigation I think implement it to swapon is more simple way :-)
Comment 8 Karel Zak 2005-09-06 02:23:25 EDT
Implemented: util-linux-2.13-0.3.pre2

Note You need to log in before you can comment on or make changes to this bug.