Hard Disks turn on but they should not!

Hi, I have Opensuse 11.2 with KDE desktop on a abit motherboard with 2gb ram, 2 SATA Hard drives and 2 IDE hard drives (master and slave on IDE2), plus the ide master boot hard disk on IDE 1.
I programmed the 2 SATA and IDE drives to turn off after 1 min inactiviti with HDPARM -S 12 , but often Opensuse wakes up all drives, wich vanishes the purpose to keep them off when not used.
The only running software are the normal desktop tasks :
the device notifier
the system tray
the task manager
the application launcher menu
the digital clock
Any suggestion to avoid this? thank you

Karmack wrote:
> Hi, I have Opensuse 11.2 with KDE desktop on a abit motherboard with 2gb
> ram, 2 SATA Hard drives and 2 IDE hard drives (master and slave on
> IDE2), plus the ide master boot hard disk on IDE 1.
> I programmed the 2 SATA and IDE drives to turn off after 1 min
> inactiviti with HDPARM -S 12 , but often Opensuse wakes up all drives,
> wich vanishes the purpose to keep them off when not used.
> The only running software are the normal desktop tasks :
> the device notifier
> the system tray
> the task manager
> the application launcher menu
> the digital clock
> Any suggestion to avoid this? thank you
>
>

what do you have running in the background that might be hitting a
disk drive?

cron task
network
NTPd
firewall
routine system logging
smart monitor

many many others…to get a list of current process you can scroll
through, in a terminal run:


ps -e | less

press q to quit…

anyway, wanting to save energy (battery power) is a great goal…but,
shutting off disk drives after only one minute of non-user input/idle
may not actually save much energy…but is sure to add a tremendous
amount of wear…many drives will last for several years if running
24/7, but won’t last one year if powered (by unseen processes) and
then unpowered by your command constantly…

read up on drive bearings, start up wear, etc…


palladium

Sure you’re right, subsequent turn-off and on of an hard disk is not a good idea. The fact is that tha machine, even if always on, can be used for hours but can also wait for hours doing nothing. Tha’s why I thought useful to turn off the disks after a period of time that can be 30 minutes of inactivity. But if a process polls a disk before, and it seems that something does, they will never turn off.
This is a list of running processes at the moment (there are also mozilla and some small stuff like vlc ). If you could suggest me unuseful running processes or if you see what is polling my hd would be useful for me to learn more about background opensuse activiy. Many thanks!
PID TTY TIME CMD
1 ? 00:00:01 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 migration/0
4 ? 00:01:55 ksoftirqd/0
5 ? 00:00:00 watchdog/0
6 ? 00:00:00 migration/1
7 ? 00:00:17 ksoftirqd/1
8 ? 00:00:00 watchdog/1
9 ? 00:00:10 events/0
10 ? 00:00:09 events/1
11 ? 00:00:00 cpuset
12 ? 00:00:00 khelper
13 ? 00:00:00 netns
14 ? 00:00:00 async/mgr
15 ? 00:00:00 kintegrityd/0
16 ? 00:00:00 kintegrityd/1
17 ? 00:00:01 kblockd/0
18 ? 00:00:00 kblockd/1
19 ? 00:00:00 kacpid
20 ? 00:00:00 kacpi_notify
21 ? 00:00:00 kacpi_hotplug
22 ? 00:00:00 ksuspend_usbd
23 ? 00:00:00 khubd
24 ? 00:00:00 kseriod
25 ? 00:00:00 kondemand/0
26 ? 00:00:00 kondemand/1
27 ? 00:00:00 khungtaskd
30 ? 00:00:21 kswapd0
31 ? 00:00:00 aio/0
32 ? 00:00:00 aio/1
33 ? 00:00:00 kpsmoused
61 ? 00:03:41 ata/0
62 ? 00:00:00 ata/1
63 ? 00:00:00 ata_aux
64 ? 00:07:09 scsi_eh_0
65 ? 00:00:00 scsi_eh_1
70 ? 00:00:00 scsi_eh_2
71 ? 00:00:00 scsi_eh_3
269 ? 00:00:24 kjournald2
372 ? 00:00:01 udevd
554 ? 00:00:00 hd-audio0
689 ? 00:00:00 kstriped
793 ? 00:00:00 kdmflush
794 ? 00:00:08 kdmflush
809 ? 00:00:00 kdmflush
838 ? 00:00:06 kdmflush
914 ? 00:00:00 kjournald
915 ? 00:00:12 kjournald
918 ? 00:00:00 kjournald
919 ? 00:00:00 kjournald
1270 tty7 02:26:17 Xorg
1273 ? 00:00:00 kdm
1278 ? 00:00:00 dbus-launch
1279 ? 00:00:00 dbus-daemon
1303 ? 00:00:00 acpid
1305 ? 00:00:00 startkde
1330 ? 00:00:24 dbus-daemon
1383 ? 00:00:00 gpg-agent
1427 ? 00:00:06 dbus-daemon
1428 ? 00:00:00 dbus-launch
1436 ? 00:00:00 kdeinit4
1437 ? 00:00:00 klauncher
1439 ? 00:01:23 kded4
1472 ? 00:00:08 hald
1496 ? 00:00:00 kwrapper4
1497 ? 00:00:01 ksmserver
1499 ? 02:59:18 kwin
1501 ? 00:00:00 kglobalaccel
1504 ? 00:00:28 knotify4
1505 ? 00:23:48 plasma-desktop
1510 ? 00:00:01 kaccess
1520 ? 00:00:24 krunner
1522 ? 00:00:00 nepomukserver
1528 ? 00:00:01 kmix
1530 ? 00:00:03 knotes
1534 ? 00:00:00 console-kit-dae
1600 ? 00:00:29 kwalletd
1602 ? 00:00:00 hald-runner
1619 ? 00:00:00 polkit-gnome-au
1622 ? 00:00:01 kupdateapplet
1812 ? 00:00:00 kdm
1844 ? 00:00:00 nmbd
1850 ? 00:00:05 hald-addon-inpu
1902 ? 00:06:28 hald-addon-stor
1911 ? 00:00:00 hald-addon-acpi
1966 ? 00:00:00 hald-addon-stor
1984 ? 00:00:00 rsyslogd
2031 ? 00:00:00 auditd
2040 ? 00:00:00 audispd
2046 ? 00:00:00 kauditd
2072 ? 00:00:00 rpcbind
2106 ? 00:00:17 vmware-usbarbit
2175 ? 00:00:00 vmnet-bridge
2183 ? 00:00:00 vmnet-dhcpd
2186 ? 00:00:00 vmnet-netifup
2237 ? 00:00:00 vmnet-dhcpd
2240 ? 00:00:00 vmnet-natd
2242 ? 00:00:00 vmnet-netifup
2407 ? 00:00:05 avahi-daemon
2436 ? 00:00:03 cupsd
2460 ? 00:00:03 nscd
2686 ? 00:00:00 smbd
2690 ? 00:00:00 smbd
2779 ? 00:00:01 master
2809 ? 00:00:01 cron
2880 ? 00:00:02 smartd
2901 tty1 00:00:00 mingetty
2902 tty2 00:00:00 mingetty
2905 tty3 00:00:00 mingetty
2908 tty4 00:00:00 mingetty
2910 tty5 00:00:00 mingetty
2912 tty6 00:00:00 mingetty
4276 ? 17-19:10:50 python
4278 ? 00:00:00 python <defunct>
4282 ? 00:00:01 polkitd
7830 ? 00:00:35 konqueror
7842 ? 00:00:00 udevd
7843 ? 00:00:00 udevd
9165 ? 00:00:10 pdflush
10117 ? 00:00:02 ark
10250 ? 00:00:00 kio_file
14197 ? 00:00:00 pickup
14321 ? 00:00:00 qmgr
14332 ? 00:00:56 npviewer.bin
14476 ? 00:00:00 konsole
14480 pts/1 00:00:00 bash
14505 pts/1 00:00:00 su
14510 pts/1 00:00:00 bash
14538 pts/1 00:00:00 ps
14771 ? 00:00:00 gvfsd
14776 ? 00:00:00 gvfs-fuse-daemo
14831 ? 00:00:15 gvfs-gdu-volume
14833 ? 00:01:39 devkit-disks-da
14835 ? 00:01:22 devkit-disks-da
14845 ? 00:00:00 gvfs-gphoto2-vo
14849 ? 00:10:07 kopete
14956 ? 00:00:02 pdflush
15600 ? 00:11:09 kopete
16194 ? 00:00:00 kdesud
16247 ? 00:00:00 dbus-launch
16248 ? 00:00:00 dbus-daemon
18039 ? 00:00:00 kwalletmanager
22674 ? 00:00:05 kcalc
30742 ? 00:00:00 firefox
30747 ? 03:15:36 firefox
30750 ? 00:00:00 gconfd-2
30761 ? 00:00:08 kmozillahelper
32182 ? 00:15:03 vlc

Have a nice day

I’m finding same thing. I have an unmounted disk, which I put an 5 minute idle on. No partitions mounted and something spins it up sometimes. The new version of powertop, which shows you CPU wakeups, is adding support for disk wake ups. I haven’t tried it out yet though.

You are quite right that spinning down idle disks is good idea. Unfortunately regular access of system (& /home in GUI) disk, will likely keep it spun up.
I should use longer idle times than 1 minute (I’m passing 30 and 60 usually), to avoid immediate spin up, after idles which is worse for disk and power use than, leaving them running.

Perhaps using Suspend -> RAM would be a good solution and have whole machine sleep, as modern CPU/RAM/Chipset uses much more power than a spinning drive even when idling.

It’ll be the kernel spinning them up to poll them. Its a better idea just to let them be, they will spin down after a set amount of time but not power down.

Spin down & power down are to very different things.

Why does the kernel want to poll unmounted disks, that are suspended?

There was a big push (with things like laptop mode) to avoid unwanted power usage. If you know that the kernel is re-reading partition table say on a disk, just for the hell of it,then it is happening often enough to be regarded as a bug.

BTW Passing 30 and 60 means 5 & 10 minute idles respectively my last post could have been clearer ]

I don’t think it’s the SMART daemon, for example, the idle disk can talk to that without spin up.

Well, I am speaking about Spinning down hard disks, using hdparm -S nnn /device command.
I have 5 hard disks. The one mounting root partition of course is never spinned down. But the others, wich are very often unused, should be.
Please notice that Opensuse 10.3 correctly turned off hd engines waking them up ONLY when needed (user request to access files).
I wonder why 11.2 version should not and if this could be reported as a bug or there is simply an unuseful process that does it and can be killed.
The wake up by polling done by 11.2 version is absolutely random. Hd can stay off for tenth of minutes or polled in less than a minute after that.
Thank you everybody for attention.

I have been considering reporting it as a bug, but wanted to narrow down the culprits first. The thing is, it is happening less for me now, but I did update to a pre-release 2.6.31.8 kernel on Saturday as well as updating KDE to a new version of KDE:KDE4:STABLE: repo rather than stock. It’s not very satisfactory not having any real idea of what is causing the annoying spin ups and they most certainly are, even considering simple noise factor alone.

I have had some suspicion about KDE as it collects info for the sysinfo:/ display, but I’m still seeding Torrents with ktorrent, so I don’t log out much. It’s not been spinning up the 2nd HDD (now sdc since a kernel update, with sdb a flash drive that’s used heavily for torrents).

If it worked in 10.3,then this has to be regarded as a bug, as it’s a regression.

Would you be willing to try a different desktop like icewm and seeing if it occurs there?

I’m not sure about the / disk, never being spun down, with large memory, and using relatime (or noatime) to reduce reason to update disk contents, there’s little reason to throw away cached pages. If you were logging to another host, or put /var/log on a flash drive say (may be /tmp tmpfs), then it likely could go idle.

You could be right that it’s a bug, but you may want to try this first (as root, of course)…

clear dmesg buffer…

just so that you start with less messages to wade through

dmesg -c

force a spin down of the drive you’re having problems with

hdparm -y /dev/sd?

enable verbose messaging of written dirtied pages

echo “1” > /proc/sys/vm/block_dump

wait for the drive to spin up…

hdparm -C /dev/sd? # check if it’s not in ‘standby’

…and then issue…

dmesg | tee /tmp/dmesg.date +%Y%m%d%H%M%S.out

disable verbose messaging of written dirtied pages

echo “0” > /proc/sys/vm/block_dump

Review the /tmp/dmesg.*.out file and you might be able to narrow it down to the process that’s writting frequently. On my openSUSE 11.2 installation, the ‘plasma-desktop’ seems to be a busy one, but there are other processes that frequently appear in the list.

Just my 2 cents worth.