[opensuse] prevent kernel wake up a sata drive from sleep "hdparm -B 1 -Y /dev/sda1"
Hi, tumbleweed desktopcomputer, kde: i have a harddrive only for use as backup, it is not mounted. i like to let it spin down "sleep mode" working fine: hdparm -B 1 -Y /dev/sda but after some minutes its started rotating again and going into "idle" mode. journalctl gave me: kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 kernel: ata1.00: waking up from sleep kernel: ata1: hard resetting link kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) kernel: ata1.00: configured for UDMA/133 kernel: ata1: EH complete what must i do to tell the system (kernel?) to "forget" the drive, not touching it, let it in sleep mode? (removing in some way /dev/sda ???????) simoN -- www.becherer.de -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
26.08.2018 19:30, Simon Becherer пишет:
Hi,
tumbleweed desktopcomputer, kde:
i have a harddrive only for use as backup, it is not mounted. i like to let it spin down "sleep mode" working fine: hdparm -B 1 -Y /dev/sda
but after some minutes its started rotating again and going into "idle" mode. journalctl gave me:
kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 kernel: ata1.00: waking up from sleep kernel: ata1: hard resetting link kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) kernel: ata1.00: configured for UDMA/133 kernel: ata1: EH complete
what must i do to tell the system (kernel?) to "forget" the drive, not touching it, let it in sleep mode? (removing in some way /dev/sda ???????)
I would start with blktrace to see whether there is any request to this drive. Something like smartd is certainly a possibility. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Sun, 26 Aug 2018, Andrei Borzenkov wrote:
26.08.2018 19:30, Simon Becherer ?????:
tumbleweed desktopcomputer, kde: i have a harddrive only for use as backup, it is not mounted. i like to let it spin down "sleep mode" working fine: hdparm -B 1 -Y /dev/sda
but after some minutes its started rotating again and going into "idle" mode. [..] I would start with blktrace to see whether there is any request to this drive. Something like smartd is certainly a possibility.
Or hddtemp ;) -dnh -- What are you doing?!? The message is over,GO AWAY! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi all, thanks a lot for your answers. with your info's (and some additional internet search) i found out with blktrace: smartd and pool are accessing the drive sda (i do not know why, but they do) so i went the other way, like hot-swapp (i think so) (i have no idea how hot swap is really working): switching it off (for theoretical remove??): echo 1 > /sys/block/sda/device/delete and switching on again: echo "0 0 0" >/sys/class/scsi_host/host0/scan (here i am not sure if this would disturb other sata drives. and if i have to use other numbers than 0 0 0) -> have not really found where these numbers come from: readlink /sys/block/sda ./devices/pci0000:00/0000:00:01.3/0000:03:00.1/ata1/host0/target0:0:0/0:0:0:0/block/sda -> but if somebody here could explain me this line, would be nice. - in my case i have only sda, because my main drive is nvme1 so this seems to work for me. and with smartctl -a /dev/sda i am able to check in the near future if its really not switched on again to make sure it will not end up in hunderts of spin up and down's and hunderts of usless power-on hours. (start-stop count: 30 :-)) (power-on-hours: 55 :-)) i put these in a small script + generate a service file, so up to now it seems running fine, switching sda off during boot and if i have to use it, i am able to switch it on. simoN www.becherer.de -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-29 13:13, Simon Becherer wrote:
Hi all,
thanks a lot for your answers.
with your info's (and some additional internet search) i found out with blktrace: smartd and pool are accessing the drive sda (i do not know why, but they do)
Yes, the smartd daemon checks the disks periodically. You have to edit /etc/smartd.conf. "pool" I don't know what it is. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 8/26/2018 11:15 AM, L A Walsh wrote:
I wonder how easy it would be to do some equivalent to eject on that drive, or possibly 'freezing' io to it.
Is it a drive that could be hot-swapped? If so, might be able to tell it to get ready to be hot-swapped, which might suspend it until you tell the system the hot-swap is complete.
On 8/29/2018 10:13 AM, Simon Becherer echoed:
so i went the other way, like hot-swapp (i think so) (i have no idea how hot swap is really working):
switching it off (for theoretical remove??): echo 1 > /sys/block/sda/device/delete
Really, too bad I didn't think of that ....oh...I did. Hmmmm.... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
what must i do to tell the system (kernel?) to "forget"
On 8/26/2018 9:30 AM, Simon Becherer wrote: the drive, not touching it, let it in sleep mode? --- I don't know the answer to you question, but I'm wondering what is waking it up. It used to be that to not have a device startup, you didn't access it, but accessing it would usually restart it. My question would be how quickly does it restart and/or do you see it restarting on anything like a schedule? If you can find who is waking it up, it might be relatively easy to get whatever process is waking it to stop. I wonder how easy it would be to do some equivalent to eject on that drive, or possibly 'freezing' io to it. Is it a drive that could be hot-swapped? If so, might be able to tell it to get ready to be hot-swapped, which might suspend it until you tell the system the hot-swap is complete. Sorry if you've aready thought of these things, though of note. If a reset is sent out over the bus for that device, some other number of disks might go into reset mode as well. Have seen a reset take over 3 minutes, by which point most of the other devices had timed-out and the kernel had shut down the file systems that resided on them. Not particularly pleasant -- reboot was only alternative. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/26/2018 11:30 AM, Simon Becherer wrote:
Hi,
tumbleweed desktopcomputer, kde:
i have a harddrive only for use as backup, it is not mounted. i like to let it spin down "sleep mode" working fine: hdparm -B 1 -Y /dev/sda
but after some minutes its started rotating again and going into "idle" mode. journalctl gave me:
Chuckling... I can't recall whether it was 11.0 or 11.4, but the default hdparm setting for APM spindown used to cause my laptop drive to spin down and up once a minute resulting in some 43,000+ cycles within the first year. I almost had a heart attack when I looked at smartctl -a. But the drive took it. I have had much better luck with drives when they simply run. (limiting the spin up/down cycles). E.g. # smartctl -a /dev/sdc 9 Power_On_Hours ... Old_age Always - 72342 that's a bit over 8 1/4 years. Also, not all sata drives support all ata commands (in fact most consumer drives are crippled by the manufacturer to only support a very few drive commands), so unless your drive actually supports the commands being sent, it may very will just be getting commands it doesn't understand, waking up to see if anything is wrong, and then going back to sleep. While in the distant past, all drives supported nearly all ATA commands, now very few actually do. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (6)
-
Andrei Borzenkov
-
Carlos E. R.
-
David C. Rankin
-
David Haller
-
L A Walsh
-
Simon Becherer