* prevent disk from spinning up at system resume
@ 2015-03-23 11:02 Peter Münster
2015-03-23 13:57 ` Alan Stern
0 siblings, 1 reply; 6+ messages in thread
From: Peter Münster @ 2015-03-23 11:02 UTC (permalink / raw)
To: linux-pm
Hi,
My SATA disk (sdb) spins up at every system resume. How could I avoid
that please?
Some details:
- sdb not mounted
- echo 0 >/sys/block/sdb/device/scsi_disk/2:0:0:0/manage_start_stop
- hdparm -C /dev/sdb : "drive state is: standby"
- s2ram
- after wake up: "drive state is: active/idle"
- kernel message at wakeup: "sd 2:0:0:0: [sdb] Synchronizing SCSI cache"
- when doing "echo scsi remove-single-device 2 0 0 0 >/proc/scsi/scsi"
before s2ram, sdb keeps sleeping after resume
I need the disk only about once per week. I use s2ram several times per
day, and I prefer that sdb keeps sleeping.
TIA for any hints,
--
Peter
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: prevent disk from spinning up at system resume
2015-03-23 11:02 prevent disk from spinning up at system resume Peter Münster
@ 2015-03-23 13:57 ` Alan Stern
2015-03-23 14:07 ` Peter Münster
0 siblings, 1 reply; 6+ messages in thread
From: Alan Stern @ 2015-03-23 13:57 UTC (permalink / raw)
To: Peter Münster; +Cc: linux-pm
On Mon, 23 Mar 2015, Peter Münster wrote:
> Hi,
>
> My SATA disk (sdb) spins up at every system resume. How could I avoid
> that please?
>
> Some details:
>
> - sdb not mounted
> - echo 0 >/sys/block/sdb/device/scsi_disk/2:0:0:0/manage_start_stop
> - hdparm -C /dev/sdb : "drive state is: standby"
> - s2ram
> - after wake up: "drive state is: active/idle"
> - kernel message at wakeup: "sd 2:0:0:0: [sdb] Synchronizing SCSI cache"
> - when doing "echo scsi remove-single-device 2 0 0 0 >/proc/scsi/scsi"
> before s2ram, sdb keeps sleeping after resume
It looks like you already have your answer.
> I need the disk only about once per week. I use s2ram several times per
> day, and I prefer that sdb keeps sleeping.
>
> TIA for any hints,
Alan Stern
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: prevent disk from spinning up at system resume
2015-03-23 13:57 ` Alan Stern
@ 2015-03-23 14:07 ` Peter Münster
2015-03-23 14:19 ` Alan Stern
0 siblings, 1 reply; 6+ messages in thread
From: Peter Münster @ 2015-03-23 14:07 UTC (permalink / raw)
To: linux-pm
On Mon, Mar 23 2015, Alan Stern wrote:
>> - when doing "echo scsi remove-single-device 2 0 0 0 >/proc/scsi/scsi"
>> before s2ram, sdb keeps sleeping after resume
>
> It looks like you already have your answer.
Sorry, I forgot to mention, that the disk needs to be mounted.
I just wanted to point out, that the kernel wakes up the disk, and not
the bios or something else.
--
Peter
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: prevent disk from spinning up at system resume
2015-03-23 14:07 ` Peter Münster
@ 2015-03-23 14:19 ` Alan Stern
2015-03-23 14:36 ` Peter Münster
0 siblings, 1 reply; 6+ messages in thread
From: Alan Stern @ 2015-03-23 14:19 UTC (permalink / raw)
To: Peter Münster; +Cc: linux-pm
On Mon, 23 Mar 2015, Peter Münster wrote:
> On Mon, Mar 23 2015, Alan Stern wrote:
>
> >> - when doing "echo scsi remove-single-device 2 0 0 0 >/proc/scsi/scsi"
> >> before s2ram, sdb keeps sleeping after resume
> >
> > It looks like you already have your answer.
>
> Sorry, I forgot to mention, that the disk needs to be mounted.
Why does the disk need to be mounted if you aren't using it more than
once a week or so? Why not mount it only while it is in use?
> I just wanted to point out, that the kernel wakes up the disk, and not
> the bios or something else.
The kernel wakes up _every_ device during system resume, even ones that
were in runtime suspend when the system suspend started. With only a
few exceptions, there is no way around this in the current kernel.
Alan Stern
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: prevent disk from spinning up at system resume
2015-03-23 14:19 ` Alan Stern
@ 2015-03-23 14:36 ` Peter Münster
2015-03-23 15:03 ` Alan Stern
0 siblings, 1 reply; 6+ messages in thread
From: Peter Münster @ 2015-03-23 14:36 UTC (permalink / raw)
To: linux-pm
On Mon, Mar 23 2015, Alan Stern wrote:
> Why does the disk need to be mounted if you aren't using it more than
> once a week or so? Why not mount it only while it is in use?
The workflow would be quite different:
normal workflow:
- application needs file on sdb
- sdb spins up
- application can open the file
workflow with unmounted sdb:
- application needs file on sdb
- error message: no such file (or similar)
- user sees error message: "oh dear, the file is on sdb..."
- superuser needs to "add-single-device" and mount it
- user can continue with application
> The kernel wakes up _every_ device during system resume, even ones that
> were in runtime suspend when the system suspend started. With only a
> few exceptions, there is no way around this in the current kernel.
Even after "echo 0 >/sys/block/sdb/device/scsi_disk/2:0:0:0/manage_start_stop" ?
If there wasn't the "Synchronizing SCSI cache" at system resume, would
the disk spin up nevertheless?
--
Peter
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: prevent disk from spinning up at system resume
2015-03-23 14:36 ` Peter Münster
@ 2015-03-23 15:03 ` Alan Stern
0 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2015-03-23 15:03 UTC (permalink / raw)
To: Peter Münster; +Cc: linux-pm
On Mon, 23 Mar 2015, Peter Münster wrote:
> > The kernel wakes up _every_ device during system resume, even ones that
> > were in runtime suspend when the system suspend started. With only a
> > few exceptions, there is no way around this in the current kernel.
>
> Even after "echo 0 >/sys/block/sdb/device/scsi_disk/2:0:0:0/manage_start_stop" ?
Yes. As I understand it, writing 0 to manage_start_stop prevents the
kernel from sending a spin-up or spin-down command to the drive. But
SATA drives automatically spin up anyway when the port returns to full
power. Removing the SCSI device entry probably prevents the system
from changing the port's power level.
(Some of the details may be wrong here, because I'm not very familiar
with how the ATA subsystem works.)
> If there wasn't the "Synchronizing SCSI cache" at system resume, would
> the disk spin up nevertheless?
Yes, I think so. In fact, the cache gets synchronized at system
suspend, not at system resume. But the message doesn't get written to
the log file until after the system is running again.
Alan Stern
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-23 15:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 11:02 prevent disk from spinning up at system resume Peter Münster
2015-03-23 13:57 ` Alan Stern
2015-03-23 14:07 ` Peter Münster
2015-03-23 14:19 ` Alan Stern
2015-03-23 14:36 ` Peter Münster
2015-03-23 15:03 ` Alan Stern
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.