[linux-pm] [Suspend-devel] Dangers of touching disk between suspend and resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 30, 2006 at 05:17:47PM -0500, Peter Jones wrote:
> On Thu, Nov 30, 2006 at 03:00:43PM -0500, I wrote:
> > On Tue, 2006-11-28 at 17:37 +0100, Stefan Seyfried wrote:
> > 
> > > So it is a good idea to tell the engineer to do "mkswap" on the swap
> > > partition before putting the disk into the replacement hardware.
> > 
> > Ugh, no it's not.  You really want the UUID on the swap area to remain
> > the same.
> 
> In response, on Thu, 2006-11-30 at 21:13 +0100, Stefan Seyfried wrote:
> > Well, but the system won't care because it won't resume?
> > Or am i missing something?
> 
> And On Thu, 2006-11-30 at 15:42 -0500, Daniel Drake wrote:
> > Why?
> > 
> > [not questioning your reasoning, this is coming from someone who knows
> > very little about swap structure and what the UUID is used for]
> 
> You want to get rid of the resume metadata from it, but you don't want
> to create a new swap structure.  Normally it's not a problem, but in
> some environments, such as with shared-storage like in a SAN[1], we need
> to be able to identify that a swap device is really the one we mean to
> be activating; the UUID is one of the best pieces of data we've got.  So
> you don't want to start over with a new swap partition, you want to
> clear the resume data only.
> 
> Granted, I think most distros, if not all, and all the standard tools
> totally muck up swap on shared storage right now[0].  But that's no
> reason to advocate such a bad habit.  For FC/RHEL making this work right
> is at least on my TODO list for the relatively near future.

Ok. I think a patch to mkswap to "--reset-the-swap-signature-after-suspend"
or just a "reset-swap-signature-after-failed-suspend" program is trivial to
implement in this case. Right now, you cannot suspend to those devices
anyway.
Alternatively, you could provide the UUID you want for the device to mkswap
(my mkswap does not have this option, but my swap partition does not seem to
have an UUID anyway):
  info.category = 'volume'  (string)
  info.product = 'Volume (swap)'  (string)
  block.device = '/dev/sda3'  (string)
  volume.uuid = ''  (string)
root at strolchi:/tmp# blkid /dev/sda2 /dev/sda3
/dev/sda2: LABEL="BOOT" UUID="0dae6602-2299-47e8-88c8-c0fca0fc8f9e" TYPE="ext2"
/dev/sda3: TYPE="swap"

So if somebody submits a patch that implements a "reset_signature" program,
i'll include that in the suspend package.
-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux