[ltp] (fwd) [PATCH] sd: implement stop_on_shutdown

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Mon, 22 Jan 2007 18:47:24 -0200


On Mon, 22 Jan 2007, Paul Fox wrote:
> henrique de moraes holschuh wrote:
>  > This patch, plus adding the required module parameter or kernel commandline
>  > parameter to enable stop_on_shutdown by default is an *extremely* good idea
>  > on any ThinkPads that use libata (i.e. where disks show up as SCSI devices,
>  > /dev/sd*).
>  > 
>  > Suspending to disk without it is a Bad Idea, unless you want to make sure
>  > your HD will die soon, so as to be able to replace it under warranty or
>  > somesuch.
> 
> thanks for sending this patch.  two questions:  is this an issue
> with suspend-to-ram?  or is it just with suspend-to-disk?  i use
> suspend-to-ram quite a bit on my X41.

No, ACPI S3 in libata does the right thing without the help of sd.c.

> also, until this patch is in the mainstream, is there any way to
> force the stop from user-level in the acpi scripts in order to
> stop the disks safely?  (i'm running ubuntu edgy.)  should we
> be sure halt is called in some specific way?

1. Make triple sure you have sd_mod.stop_on_shutdown_default=1 on the kernel
command line, and also options sd_mod stop_on_shutdown_default=1 somewhere
in /etc/modprobe.d.

2. Remove "-h" from the halt invocations on the initscripts.

That should do it.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh