Bug 663067

Summary: hard disk is turned off every few seconds
Product: [openSUSE] openSUSE 11.4 Reporter: Forgotten User --EoyBps8f <forgotten_--EoyBps8f>
Component: BasesystemAssignee: Michal Vyskocil <mvyskocil>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P2 - High CC: aj, coolo, ctrippe, holler, martin.schlander, Martin.Seidler, vuntz
Version: FactoryFlags: coolo: SHIP_STOPPER+
Target Milestone: Factory   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User --EoyBps8f 2011-01-07 16:51:17 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0b8) Gecko/20101214 Firefox/4.0b8

Since updating my 11.3 to current factory my hard disk is put asleep every few minutes which is not even powersaving because it has to wake up after a few seconds anyway.

Reproducible: Always
Comment 1 Forgotten User --EoyBps8f 2011-01-07 16:59:58 UTC
linux-vdb1:/etc/rc.d/boot.d # hdparm /dev/sda

/dev/sda:
 multcount     =  8 (on)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 3072 (on)
 geometry      = 19457/255/63, sectors = 312581808, start = 0
linux-vdb1:/etc/rc.d/boot.d # hdparm -B /dev/sda

/dev/sda:
 APM_level      = 1
Comment 2 Hans-Peter Holler 2011-01-10 18:47:39 UTC
Same here on my notebook, but only when on battery:

without powersupply:
holler-n2:~ # hdparm -B /dev/sda

/dev/sda:
 APM_level      = 1

with powersupply plugged in:
holler-n2:~ # hdparm -B /dev/sda

/dev/sda:
 APM_level      = 254
Comment 3 Forgotten User --EoyBps8f 2011-01-30 16:59:40 UTC
Are you using KDE? Maybe this is DE related and not actually the basesystem's fault?
Comment 4 Hans-Peter Holler 2011-01-30 18:48:21 UTC
(In reply to comment #3)
> Are you using KDE? Maybe this is DE related and not actually the basesystem's
> fault?

Yes, KDE 4.6 from
http://download.opensuse.org/repositories/KDE:/Distro:/Factory/openSUSE_Factory/

I'll check it in runlevel 3.
Comment 5 Hans-Peter Holler 2011-01-31 09:28:42 UTC
runlevel 3 with and without powersupply:
holler-n2:~ # hdparm -B /dev/sda

/dev/sda:
 APM_level      = 128

So the spindown only happens with KDE and powersupply not plugged in.
Comment 6 Forgotten User --EoyBps8f 2011-01-31 09:45:28 UTC
It seems that this is nevertheless not a KDE issue but pm-utils or upower's. I found a bug on bko and at gentoo which describe the behaviour.

http://bugs.gentoo.org/show_bug.cgi?id=334393 which has a workaround http://bugs.gentoo.org/show_bug.cgi?id=334393#c3

https://bugs.kde.org/show_bug.cgi?id=248905
Comment 7 Hans-Peter Holler 2011-01-31 20:25:01 UTC
Touching /etc/pm/power.d/harddrive makes it worse:
APM_LEVEL is set to 1 when started on battery and remains even when powersupply is plugged in.
So next try: assigning to vuntz
Comment 8 Hans-Peter Holler 2011-02-17 21:34:24 UTC
Vincent: please look at http://lists.opensuse.org/opensuse-factory/2011-02/msg00654.html and the following posts.
This seems to affect more people than Sven and me.
Comment 9 Vincent Untz 2011-02-18 00:35:20 UTC
I  looked at that, and I have no clue what is right to do. However, what I can tell:

 - it's the pm-utils default behavior
 - this can be configured (see https://bugzilla.redhat.com/show_bug.cgi?id=662383#c3)
 - Fedora dropped this part for now (see http://pkgs.fedoraproject.org/gitweb/?p=pm-utils.git;a=commitdiff;h=85406683a23d6c31eed7c6bd21526e3578c3b4f9)

Michal, any idea what should be done here?
Comment 10 Martin Schlander 2011-02-18 07:44:11 UTC
*Something* definitely needs to be done.

The current behaviour is a) highly annoying cuz of disk spinning up and down constantly, b) likely to significantly shorten the life of the disk.

Maybe it would be ok if the disk would spin down after 5-10 minutes of idle, while on battery - but doing it every few seconds seems like complete madness.
Comment 11 Forgotten User --EoyBps8f 2011-02-18 08:55:37 UTC
(In reply to comment #9)
>  - it's the pm-utils default behavior

The _new_ default behaviour as far as I understood.

>  - this can be configured (see
> https://bugzilla.redhat.com/show_bug.cgi?id=662383#c3)

Good to know, should go into the release notes since it is a change compared to 11.3.

>  - Fedora dropped this part for now (see
> http://pkgs.fedoraproject.org/gitweb/?p=pm-utils.git;a=commitdiff;h=85406683a23d6c31eed7c6bd21526e3578c3b4f9)

I opt for disabling this feature because I do not see any benefits. Neither does it save power, nor does it extend the hard disk's life. I do see disadvantages though, e.g. delays as soon as the user has to wait for the hard disk to spin-up just to name the one the user notices instantly without caring about load cycles etc.
Comment 12 Martin Schlander 2011-02-18 12:11:33 UTC
I thought it might be desirable to have the workaround in this bugreport, without people having to read through the RedHat report to dig it out for themselves, so here goes:

To turn off the disk spin down etc., do:

# echo -n > /etc/pm/power.d/harddrive
# chmod a-x /etc/pm/power.d/harddrive
Comment 13 Hans-Peter Holler 2011-02-18 15:51:39 UTC
And it's essential to make /etc/pm/power.d/harddrive executable.
See comment #7.

I think it's not too late to add this empty file in openSUSE's rpm for 11.4.
Comment 14 Stephan Kulow 2011-02-27 10:24:19 UTC
RH basically did
rm /usr/lib/pm-utils/power.d/harddrive - and as long as it's so buggy, this is most likely what we should do too (ok, fedora removes all of the hooks, but harddrive is the only one we have problems with)
Comment 15 Andreas Jaeger 2011-02-28 19:51:31 UTC
So, should we remove the file for now as well?

Btw. what is the right devel project for pm-utils? The one in utilities is not the one that is in 11.4, it contains *less* changes. Vincent, you made those last changes, any ideas?
Comment 16 Vincent Untz 2011-02-28 21:48:05 UTC
(In reply to comment #15)
> So, should we remove the file for now as well?

I can remove it, as long as someone who knows what this implies takes the decision :-)

> Btw. what is the right devel project for pm-utils? The one in utilities is not
> the one that is in 11.4, it contains *less* changes. Vincent, you made those
> last changes, any ideas?

I thought it was Base:System, and I've always sent my changes through there. I've no idea why we have the package in two places. And the fact that the one in utilities is not a branch is broken. 

I think it makes more sense to have it in Base:System, fwiw.
Comment 17 Michal Vyskocil 2011-03-01 08:46:53 UTC
I've moved the pm-utils after a discussion on opensuse-* ML about a mess in Base:System. This project contains a dozens of not-related packages like openssh, wodim, xjobs and so. Unfortunately change of devel project needs 4(!) steps to be done

 * get a maintainership in new project/package
 * changedevelrequest
 * submit package to new location
 * delete the old one after changedevelrequest is accepted (it cannot be done earlier)

And, because the last step can be done when the second request is accepted, it's very easy to lost a track, if you move more than one package. Anyway I don't know why the last three commits were accepted in Factory - I always thought all changes should go through devel project by default!

I removed the  /usr/lib/pm-utils/power.d/harddrive and sent changes to 
 * factory: 63077
 * openSUSE:11.4: 63078

BTW: the Base:System/pm-utils is gone, please use utilities/pm-utils in future, thanks.