Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Hardware] Hard disks won't spin down

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Bbblwrp
Posts: 2
Joined: 2023-01-26 10:29

[Hardware] Hard disks won't spin down

#1 Post by Bbblwrp »

The problem
I installed a new system to be used as a low power home server. Since it's not in use most of the time I want the hard drives to spin down when not in use, but whatever I've tried so far, they don't spindown. If I force them into spindown with hdparm -y /dev/sda I hear them spin down only to spin up immediately.

The system
Pentium G6605, AsRock H470M-HDV/M.2, 8GB DDR RAM, 1x Gigabyte NVMe ssd 256, 2x Seagate 5TB ST5000LM000
The Gigabye NVMe has the Debian install, the 2 Seagates each have an empty 5 TB ext4 partition.

What Ive tried so far (based on my very limited 2 week old knowledge about linux and what I can find through google)
I've tried a lot of tings, untill it got such a mess that I had no idea what i had done. So, two days ago i reinstalled the system with a minimal Debian install and a repartition and reformat of the drives.

I've tried hdparm originally with: hdparm -S 241 -B127 /dev/sda. I got the suggestion to try if turning of APM would help through hdparm -S 241 -B255 /dev/sda, but no success

I tried adding noatime in the fstab file. No success.

I tried mounting the drives as read only in the fstab file. This made the drives spin down, but this also prevents me to writing anything to the drives.

When the drives were unmounted or were mounted as read only, they would spin down. This led me to believe there was some process keeping them busy. At first I blamed this on [jbd2/sda1-8] and [jdb2/sdb1-8], as I understand ext4 journaling. It was suggested to turn this of and try if it solved the problem. I t did not. (come to think of it, this is still disabled, better enable it I guess?)

Then I noticed in iotop ext4lazyinit popped up quite often. As I understand now it takes ext4lazyinit some time to build the inode tables (that is what it's doing, right?), but at the moment it's been running for about 2 days while the system is not doing anything else. (smart-d -n, [kworker/u8:3-events_unbound] [kworker/u8:3-events_unbound] [jbd2/nvme0n1o2-8] systemd-journald and [ext4lazyinit] are the only active processes

Is the solution as simple as "just have the patience to let ext4lazyinit do it's job" and if so, should it be running for days? Or could there be another reason the drives don't spin down?

User avatar
kent_dorfman766
Posts: 535
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 57 times
Been thanked: 70 times

Re: [Hardware] Hard disks won't spin down

#2 Post by kent_dorfman766 »

I believe that spin-down will be short lived if anything "touches" or tries to talk to the offline device. You need to determine what processes are attempting to access the disks while they are offline. my spidey sense says to look at smartmon as a culprit, and then there are the Homer Simpson D'Oh! possibilities like, does a spun down device contain a swap partition?

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1400
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 79 times
Been thanked: 175 times

Re: [Hardware] Hard disks won't spin down

#3 Post by steve_v »

Assuming it's some process or other accessing the disk, and I suspect it is, I have (mis)used auditd for this kind of thing in the past. The configuration of that tool is too complex for me to go to go into here, but there's plenty of documentation on the web.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Bbblwrp
Posts: 2
Joined: 2023-01-26 10:29

Re: [Hardware] Hard disks won't spin down

#4 Post by Bbblwrp »

After three days of spinning (and me doing my utmost being patient), the question answered itself. Apparently it was ext4lazyinit just taking its time for this morning the drives have stopped spinning. Now if I access them, they spin up, and after a while they spin down again. /Me happy. 😇

Post Reply