Hello Everyone! I have set up my first NC using the below configuration:
Hardware:
Raspberry pi 4
WD Red 1tb 2.5 HDD
Software:
On latest version of NCP, and have no additional packages (Besides hd-idle).
I have noticed that the HDD does not spin down on its own while not being in use after a couple of hours. So naturally I googled what was happening to try to fix this issue. I came across this site that said how to fix this issue. With my configuration hdparm and sdparm does not work, but hd-idle will spin down the hdd after X amount of time. The issue now is that it will randomly spin back up a couple minutes later even though it is not in use. The googling continues.
I now find this site. Close to the bottom of the page they explain that they had a similar issue to me, which was caused by udisks. Then they explain how to fix the issue by editing a udisks file. Unfortunately NCP doesnāt use udisks (to my knowledge) , but it does use udisks2, which from my understanding udisks and udisks2 do very similar things.
Now I have had no luck trying to find additional information on how to fix this issue which I am assuming is from udisks2.
Did you set up cron jobs? They often run every 15 minutes (not sure how this is configured in NCP), you might want to change that. Furthermore, you could check your webserver log if there are clients connecting to the server on a regular basis.
I have the same issue. Iāve a RP4 built with the latest Nextcloudpi image and using a WD 4Gb portable HDD. The hdd doesnāt go to standby, ever. Configuring RAM logs didnāt help.
These hdds use their own firmware for power management so the problem isnāt about Linux configuration. And Iāve disabled any obvious NC actions thatāll cause hdd access. eg. check for manually added data files. Something else is accessing the drive and preventing standby.
Iāve started to try and work it out. As this is a new build with no user data I was able to move the swap file, nc database and nc data one at a time to the sd card. Only after finally moving the nc data the hdd goes to sleep. So I guess this narrows it down a bit.
At the moment Iām assuming something in /var/www/nextcloud/cron.php is causing the hdd access. Tonightās job is to have a look. Any tips on doing this would be gratefully received.
Just change the timing of the cronjob. When the cronjob is not running, it canāt send out notifications. Check out what suits you most (e.g. run it once an hour during the day and only a single time at during the night).
Iāll move my nc data back to the hdd and change the cronjob to run infrequently to see if this is whatās triggering the hdd accesses.
Looking at nextcloud/cron.php I didnāt really get that far. I seems to pull in a ājoblistā but I couldnāt work out the contents. Before disabling or reducing the cronjob frequency permanently of this Iād like to better understand the impact. Which logs would show me this ?
So itās definitely cron.php triggering the hdd access. To get an idea of whatās it doing I removed the www-data crontab cron.php entry to stop it running.
Then enabled debug log mode by adding the line:
āloglevelā => 0 to /var/www/nextcloud/config/config.php
Then opened an admin page in a browser and selected logging.
I assume other tasks will be added to the list from time to time dependant on their required frequency.
Iām going to try running cron.php twice a day. At 6:45 and 19:12, the theory being that itāll be reasonably up to date when Iām likely to use it, during the day and in the evening. I should mention apart from auto uploads from the household phones Iām only likely to use Nextcloud a couple of times a week. The achieve this I edited the www-data crontab to have the follow entries:
While searching to prevent Nextcloud from spinning up my disks, I came across this interesting topic.
I took another approach by only running the cron job if the disks are spinning anyway.
Iām using another setup, but for others stumbling across this in search to solve this problem, my post here might just be useful enough to fix it themselves.