DevHeads.net

hdparm -B for netbooks

Hi,

I have one of these netbooks that need "hdparm -B high_value" to avoid unhealthy
frequent head parking. From some archived mails I had the impression that it was
planned that gnome power manager and similar would take care of such issues - which
does not appear to happen in my case.

What is the state of this - is some package responsible for this or is it up to
the user to do it manualy?

Richard

Comments

Re:hdparm -B for netbooks

By supercyper at 02/24/2010 - 13:10

This is not a big problem, you can use pm-utils to solve this bug by throwing srcipts to /etc/pm/sleep.d and /etc/pm/power.d.
Anyone who cares high frequency of load/unload cycles on some hard disks can refering
<a href="http://wiki.archlinux.org/index.php/Pm-utils" title="http://wiki.archlinux.org/index.php/Pm-utils">http://wiki.archlinux.org/index.php/Pm-utils</a> to hack the pm-utils.

在2010-02-24 20:37:58,"Chen Lei" < ... at 163 dot com> 写道:

This is not a big problem, you can use pm-utils to solve this bug by throwing srcipts to /etc/pm/sleep.d and /etc/pm/power.d.

在2010-02-24?04:10:03,"Richard?Zidlicky"?<rz@linux-m68k.org>?写道:

Re: hdparm -B for netbooks

By Till Maas at 02/24/2010 - 13:43

The hook in sleep.d is not required in Fedora, because it should be
already handled. I just wrote a mail to pm-utils devel mailinglist to
decide whether the Fedora hook should be included in the upstream
release.

Regards
Till

Re:hdparm -B for netbooks

By supercyper at 02/24/2010 - 08:37

This is not a big problem, you can use pm-utils to solve this bug by throwing srcipts to /etc/pm/sleep.d and /etc/pm/power.d.

在2010-02-24?04:10:03,"Richard?Zidlicky"?<rz@linux-m68k.org>?写道:

Re: hdparm -B for netbooks

By Till Maas at 02/24/2010 - 04:53

You have to set it manually at bootup (add it to /etc/rc.local), but
after suspend/hibernate the values are normally restored by pm-utils
(eventually this might happen in the kernel). In the past some devices
needed a manual override in /etc/pm-utils-hd-apm-restore.conf But this
might not be needed anymore.

Regards
Till

Re: hdparm -B for netbooks

By Richard Zidlicky at 02/24/2010 - 11:52

ok, this is a great step forward as I hated to add very similar but slightly
different scripts to /etc/init.d and /etc/pm/ - and for each Linux distro needed
several tries to actually figure out if it goes into /etc/acpi or into one of
the pm dirs.

Richard

Re: hdparm -B for netbooks

By Matthew Garrett at 02/23/2010 - 16:18

We have no understanding of the problem, its cause or the possible
harmful effects of changing the BIOS's settings automatically. These
make it rather trickier to do much about the issue.

Re: hdparm -B for netbooks

By Richard Zidlicky at 02/23/2010 - 16:34

it was my understanding that "hdparm -B" has nothing to do with the BIOS but changes
the power management feature specific to the drive?

Richard

Re: hdparm -B for netbooks

By Matthew Garrett at 02/23/2010 - 18:09

Either the drive set the initial value, or the BIOS did. We tend to
assume that there was some reason for that...

Re: hdparm -B for netbooks

By Richard Zidlicky at 02/24/2010 - 12:07

the reason is not always reasonable. Maybe the BIOS programmer assumed a specially
tuned distribution which never materialised. Maybe some manufacturer wanted to impress
with better runtimes on battery and did not care if the harddisk is broken after
2 years.

Whatever the reason, many users think it is better to change the setting - is there
any reason why the power manager should not make it really easy?

I did read that various a few drives have a special interpretation of the numeric
values but I do not see a problem if the sysadmin chooses the value and have never
heard of any serious saftey problems.

Richard

Re: hdparm -B for netbooks

By Matthew Garrett at 02/24/2010 - 12:44

Yes - it's an option that's basically impossible to expose in a UI in a
sensible way.

Re: hdparm -B for netbooks

By Kevin Kofler at 02/25/2010 - 00:08

How so? "Spindown timeout", "Advanced power management timeout", and a
slider with 256 entries (or 240 or whatever the number of non-weird ones is)
looks quite sensible to me.

Kevin Kofler

Re: hdparm -B for netbooks

By Matthew Garrett at 02/25/2010 - 10:39

What do those numbers mean?

Re: hdparm -B for netbooks

By Kevin Kofler at 02/26/2010 - 07:48

They're documented in the specs.

Kevin Kofler

Re: hdparm -B for netbooks

By Matthew Garrett at 02/26/2010 - 09:52

Really? So what's the difference between 0x80 and 0x81?

Re: hdparm -B for netbooks

By Jeff Garzik at 02/26/2010 - 09:50

You obviously have not read the specs. :)

Jeff

Re: hdparm -B for netbooks

By Richard Zidlicky at 02/25/2010 - 07:50

spindown does not appear to have been the problem so far, or very infrequently,
that does not mean it would be wrong to add that as well.

As of APM it is 0-254 entries, 255 is reporteldy reserved for something else.
The interpretion of the entries across different drives makes it ugly - some
reportedly don't react to values over 200 while some need 254 to avoid frequent
head clicks.

So for that interface I would suggest a "enter value if you think you are smart"
box, slider would be too misleading.

I think that would be still helpfull for a lot of folks who can read forums but
find it hard to figure out if it was /etc/hdparm.conf, /ets/syconfig/harddisks
or whatever else that should be changed in a particular distro. Previous time
I have done it it took me 3 reboots and several suspend/wake cycles to get it
to the right places, that was before it was restored after suspend.

Richard

Re: hdparm -B for netbooks

By Adam Williamson at 02/24/2010 - 17:08

Besides, 'expose every setting that some article on the internet claims
makes everything faster/better/stabler/shinier' is not a sensible method
for designing UIs.

Re: hdparm -B for netbooks

By Ralf Ertzinger at 02/24/2010 - 11:17

Hi.

Well, the BIOS also sets the VGA resolution to 80x25.

Re: hdparm -B for netbooks

By Adam Jackson at 02/24/2010 - 11:45

ITYM 720x400. The reason for which is DOS compatibility, and we're not
interested in being DOS compatible. Moreover, we go out and discover
what resolutions _are_ possible, and filter them against the hardware's
capabilities in terms of maximum pixel clock, memory bandwidth, and so
forth. We have constraints, they are discoverable, and we know how to
operate within them.

Whereas for disks, we don't have the constraints that determined the
initial choice of APM setting, so we're best off not messing with it in
the general case.

- ajax

Re: hdparm -B for netbooks

By Thorsten Leemhuis at 02/24/2010 - 03:07

Matthew Garrett wrote on 23.02.2010 23:09:

And what does Windows do? I have the strange feeling it doesn't assume
the same and instead simply sets something it thinks is sensible, which
afaics results in Hardware manufactures not to care much what the
initial value for the drive is or what the BIOS sets. If that's the case
(I never checked and am not familiar with Windows enough to know) then
wouldn't it be the most sensible thing to do something similar?

CU
knurd

Re: hdparm -B for netbooks

By Matthew Garrett at 02/24/2010 - 17:45

I've just checked again to confirm this. Windows (XP, at least) doesn't
change the value, whatever the original value is.

Re:Re: hdparm -B for netbooks

By supercyper at 02/24/2010 - 23:02

The NTFS and ext4 are differernt, though XP also doesn't change the value.

在2010-02-25?05:59:36,"Matthew?Garrett"?< ... at srcf dot ucam.org>?写道:

Re: hdparm -B for netbooks

By Matthew Garrett at 02/24/2010 - 17:59

Further, it loses the settings over suspend/resume. Can we stop blaming
this on distributions now?

Re: hdparm -B for netbooks

By Thorsten Leemhuis at 02/25/2010 - 03:19

Matthew Garrett wrote on 24.02.2010 22:59:

Then why do a lot of drive load and unload frequently when running a
linux-distribution but do not when running the operating system the
Verndor pre-loaded? That's afaics what a lot of people seem to see. I
had such a laptop myself (in fact I still have it, but I replaced the
HDD with a SSD last fall) and had ten different models here in the lab
months (maybe more than a year) ago that showed such a behavior...

CU
knurd

Re: hdparm -B for netbooks

By Matthew Garrett at 02/25/2010 - 10:39

I have no idea, but it's clearly not down to APM values.

Re: hdparm -B for netbooks

By Till Maas at 02/25/2010 - 04:37

Another possible explanation might be that the access pattern of the OS
is different, e.g. maybe the drive is not idle long enough to unload.
But since there is afaik no proper documentation about this issue,
everything is just guessing.

Regards
Till

Re: hdparm -B for netbooks

By Richard Zidlicky at 02/25/2010 - 08:26

access pattern was the problem in many cases. In theory it is possible to
adjust how long data should be cached before written to disk, is there any
central place in Fedora to do it? I do recall the UI from somewhere but not
sure which distro and version.
Once I tried that it did not appear to make a significant difference, but
I did not try all the other possible tweaks like manual syslog configuration.

Even if writebacks were delayed by 5 minutes it would still be 170,000 head
parking cycles per year in the worst case so I think this solution would be
interesting only in very few cases.

Richard

Re: hdparm -B for netbooks

By Chuck Anderson at 02/23/2010 - 16:41

Yes. Some BIOS'es can override drive settings, but in many cases they
don't touch the drive's default values. Neither does Linux. So any
problems with the default values are the drive's own issues...or so
the argument goes.

Re: hdparm -B for netbooks

By Paulo Cavalcanti at 02/25/2010 - 11:17

This is the link that try to explain the issue:

<a href="https://wiki.ubuntu.com/DanielHahler/Bug59695" title="https://wiki.ubuntu.com/DanielHahler/Bug59695">https://wiki.ubuntu.com/DanielHahler/Bug59695</a>