HC1 HDD keeps spinning up

Post Reply
alverman
Posts: 5
Joined: Thu Mar 28, 2019 12:53 am
languages_spoken: english, dutch, french
ODROIDs: HC1
Location: Belgium
Has thanked: 1 time
Been thanked: 0
Contact:

HC1 HDD keeps spinning up

Unread post by alverman » Thu Apr 18, 2019 2:58 am

I have nextcloudpi installed on an Odroïd HC1, with a 2TB 2,5” Seagate drive.

Everything works fine, but I cannot make the HDD spin down when there is no activity on the cloud.

Apparantly, I’m not the first one that experiences problems with spinning down a HDD. But after reading a lot of posts on different forums I still haven’t found source of my problem.

What I already did:

1. Upgraded the firmware of the JMS578 usb3 to SATA-bridge, according to the instructions of Hardkernel

2. I tested the HDD with HDParm

sudo hdparm -y /dev/sda
returns

/dev/sda:
issuing standby command


sudo hdparm -I /dev/sda | grep ‘Write cache’
returns
* Write cache

So the drive can do write cache

sudo hdparm -B127 /dev/sda
does make the drive spin down but only for about 20 seconds. After that it’s spinning up again.

3. I re-applied the update of the JMS578 with setting spin down timer to zero to avoid interference with the HDParm timer.

Still no luck.


This must mean that something is keeping the drive active, but I cannot figure out what. Could it be something in Nextcloudpi or Nextcloud itself?

Any help would be very welcome.

User avatar
odroid
Site Admin
Posts: 31760
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 83 times
Been thanked: 241 times
Contact:

Re: HC1 HDD keeps spinning up

Unread post by odroid » Thu Apr 18, 2019 10:38 am

It is really hard to know which parts of the NextCloud keep accessing the storage.
I hope other people can let you know how to trace uncertain file access.

User avatar
mad_ady
Posts: 6360
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 144 times
Been thanked: 105 times
Contact:

Re: HC1 HDD keeps spinning up

Unread post by mad_ady » Thu Apr 18, 2019 2:21 pm

If your disk is only for data (doesn't hold nextcloud), then check the following:
1. There are no periodic smart processes trying to read disk status/temperature - they will wake up your disk. You can unmount your partition and if it still spins up, smart is your number 1 suspect
2. You can use periodic lsof to see what files are open on your disk and which processes opened it.
3. You can try using inotify to see who wants to open certain files/directories that can wake up your disk.
These users thanked the author mad_ady for the post:
alverman (Fri Apr 19, 2019 4:13 am)

alverman
Posts: 5
Joined: Thu Mar 28, 2019 12:53 am
languages_spoken: english, dutch, french
ODROIDs: HC1
Location: Belgium
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HC1 HDD keeps spinning up

Unread post by alverman » Fri Apr 19, 2019 4:17 am

Thanks for the reply
I'll try to follow your advice. This may take a while since I will have to make myself familiar with the tool and command you mentioned.

If i find something, I'll report back.

alverman
Posts: 5
Joined: Thu Mar 28, 2019 12:53 am
languages_spoken: english, dutch, french
ODROIDs: HC1
Location: Belgium
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HC1 HDD keeps spinning up

Unread post by alverman » Tue May 14, 2019 11:47 pm

It is indeed the place where the NC database is located that causes it.

Nextcloudpi optionally lets you put the Nextcloud database on the attached drive as opposed to the SD-card. By doing that the HD is been kept awake. By putting the Nextcloud database back to the SD-card I can let the HD spin down normally.

I imagine that this will not be very positive for the lifespan of the SD Card?

User avatar
mad_ady
Posts: 6360
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 144 times
Been thanked: 105 times
Contact:

Re: HC1 HDD keeps spinning up

Unread post by mad_ady » Wed May 15, 2019 1:52 am

If it'd doing mostly reads, it should be ok on the SD. If it's doing writes/updates, it will wear the sd card sooner.

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest