My laptop has two drives: An SSD for the operating system (Kubuntu 20.10) and an HDD for media storage. Under windows my HDD only spins up when it's necessary but under linux it's spinning constantly and never spins down even if I am not using that at all. It's quite annoying because it drains my battery faster. I am 100% sure that it's my HDD and not the CPU fan because when I open a folder on it I never hear the spin up noise which is well known from windows.
I've tried many programs such as iotop
, htop
, iostat
, dstat
to find out what programs transfering data on my disk but I couldn't use them to show the disk(/sdb) activity separately from my SSD(/sda) and the name of the processes which may be using that.
When I ran iotop it didn't show any data transfer on my disk at all.
I also tried the sudo hdparm -S 12 /dev/sdb
command which would spin down my HDD after 1 minute of not using that but it still doesn't work.
Finally I'v found a desktop widget which shows the disk activity and it shows writing spikes quite frequently but I still don't know what causes this.
Edit:
Setting an APM value lower than 128 has solved the main problem but there are two another ones about it:
After every single reboot my APM_level is set back to default 254. I tried to use the sudo hdparm -K /dev/sdb
command but it didn't help. I also tried to rewrite the hdparm.config
file in /etc directory but it didn't help either.
These commands doesn't work properly: I tried many APM values and hdparm -S
spindown-settings and all did the same: My HDD spins down within a half minute no matter if I set a -S12 or -S36 or anything else even when my APM_level is at 127. If I set a lower APM_level sometimes the HDD spins down during video playback and the video gets pixelated for a couple of seconds as the drive can't spin-up fast enough to provide data for the video player.
So the only setting that effects the HDD spin_down time is the hdparm -B but not that much. I could never achive more than half minute.