[Bug 59695] Re: High frequency of load/unload cycles on some hard disks may shorten lifetime

2008-01-08 Thread Matthias Dietrich
maor:

Yes my computer came with an OEM install (it's an ASUS F3Sc with a preinstalled 
Windows Vista Home Premium, which I deleted now, so I will not be able to test 
it anymore). I cannot exclude your suggestion (namely that ASUS could have used 
a special tweak).
I used smartctl both under Gutsy and Windows to check the load/unload cycles, 
and additionaly to apply the workaround under Gutsy.

Luca Cerutti:
I did not test each case for 1 hour, but rather over periods of 10 minutes. I 
tried the same cases : idle/load, battery/AC, gutsy/windows. Additionally, in 
each case I dumped the raw "IDENTIFY" data from the harddisk, which includes 
the APM parameters. There was just one difference : Windows enables the 
so-called "device initiated interface power management", while gutsy does not, 
but the APM parameters were the same. This seems interesting, but this only 
concerns the SATA interface itself, not the disk's heads, so it is not really 
linked to the problem.
My observation was very simple : under windows,the load/unload cycle counter is 
not moving and there is no clicking sound, be it with or without load, while it 
is raising rapidly under gutsy. For information, the harddisk is a ST9160821AS, 
with firmware 3.ALC.

-- 
High frequency of load/unload cycles on some hard disks may shorten lifetime
https://bugs.launchpad.net/bugs/59695
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 59695] Re: High frequency of load/unload cycles on some hard disks may shorten lifetime

2007-12-26 Thread Matthias Dietrich
maor:

In fact, I started by monitoring the load/unload parameter using hdparm
with Gutsy as well as with Vista. Then I noticed that there was indeed a
"click" each time the counter was increased. So at least on my computer,
I can tell you when the counter goes up just by listening to the
harddrive ( I need to put my ear on the keyboard, but it's easy to
notice it).

Ubuntu might be accessing the disk too often, and there is probably room
for improvement in the way daemons are working, however I do not believe
this is the root cause of the problem. Under Vista the counter is not
increased, regardless of the disk activity. So it seems Windows does not
park the heads, or maybe only after a very long time. I monitored the
load/unload counter on another laptop (IBM T42) running XP. It's the
same, the counter is not increased. The only way I found to have the
counter going up, is to shake this laptop (IBM's active protection  will
park the heads when a movement is detected). So Windows, be it XP or
Vista has a different behaviour, although the disk's APM parameters are
the same. Of course I am only speaking about my laptops. Apparently,
jokeman has another experience by comparing ubuntu and XP on his Dell
1400.

-- 
High frequency of load/unload cycles on some hard disks may shorten lifetime
https://bugs.launchpad.net/bugs/59695
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 59695] Re: High frequency of load/unload cycles on some hard disks may shorten lifetime

2007-12-23 Thread Matthias Dietrich
Mathieu:

In fact 255 is not a legal value for APM. The ATA/ATAPI spec states clearly 
that 255 is reserved. The APM parameter only accepts values up to 254, so 
hdparm will never read out 255 as a value for APM. However hdparm accepts -B 
255, and in such case, it will send a "disable APM" command to the harddisk. So 
you may perfectly have "APM=254" while APM is disabled. The APM setting is just 
kept in the drive, but will have no effect, as APM is generally disabled.
Now hdparm is not completely right : the ATA/ATAPI spec also states that the 
"disable APM" command may not be supported on all drives. 

To sum up, there are mainly two sorts of harddrives:
- those accepting the "disable APM" command. For these drives, you may still 
read out APM=254 (or whatever you set previously) after applying -B 255 (look 
at hdparm's output, it will tell you that APM is disabled).
- those not accepting the "disable APM" command. These drives will most likely 
use 254 as "no APM" setting.

You are right by saying that we did not really fix anything with this
workaround.

I made some investigations on my brand new laptop, which had Windows
Vista preinstalled. Using the win32 port of hdparm I compared the data
returned by the "identify" ATAPI command, which is more or less what
hdparm -I returns. I just did this in "raw" format to avoid hdparm's
interpretations messing around. The harddisk settings (APM, and so on)
are the same under Vista and Ubuntu, but under Vista, there is no
clicking. So either Windows sends additional commands to the drive, or
Linux does it, but I don't think it is just a matter of "default
settings". At least the APM settings are the same (APM active, value =
128).

There is an ATAPI command which could produce the same effects ("idle
immediate with unload"). I wonder whether this is used in the kernel, or
whether the harddisk's firmware could interpret a simple "idle" command
as "idle immediate with unload" under certains circumstances.

Matthias

-- 
High frequency of load/unload cycles on some hard disks may shorten lifetime
https://bugs.launchpad.net/bugs/59695
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 172287] Re: hdparm's feedback about -B values is misleading

2007-12-11 Thread Matthias Dietrich
Looking at hdparm's code, we can see that the value of 255 will NOT be
sent to the harddrive, but it will send the "disable APM"(0x85) command
instead of "set APM to xxx" (0x05).

if (apmmode==255) {
   /* disable Advanced Power Management */
   args[2] = 0x85; /* feature register */
   if (get_apmmode) printf(" disabled\n");
} else {
   /* set Advanced Power Management mode */
   args[2] = 0x05; /* feature register */
   args[1] = apmmode; /* sector count register */
   if (get_apmmode)
  printf(" 0x%02x (%d)\n",apmmode,apmmode);
}

However the ATA spec (ATA/ATAPI-7 Vol.1)  says:

"Subcommand code 85h disables Advanced Power Management. Subcommand 85h
may not be implemented on all devices that implement SET FEATURES
subcommand 05h."

So hdparm is probably too optimistic by sending this command. On
harddrives not supporting command 85h, using -B 254 is probably the best
one can do.

To clarify things, maybe hdparm should have a dedicated option to send
85h (disable APM) and leave -B for the APM values allowed by the spec.

-- 
hdparm's feedback about -B values is misleading
https://bugs.launchpad.net/bugs/172287
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs