I really need a way to stop the USB HDD during the night from being used by osmc.
It starts working from time to time and the noise is not acceptable during the night.
I tried to use the following cron job for the purpose:
Unfortunately I cannot count on it doing the job, since it happens sometimes that some process is using the HDD and udisks refuses to unmount it.
Could you please advise a reliable way to prevent the usb HDD from being activated through the night, apart from shutting down Vero 4k or manually unmounting each night?
You’ll need to experient here to see if it doesn’t have any untoward effects but you could simply try to run the unmount every ‘n’ minutes from midnight to 08:00. Using a 5-minute value, for example, your cron entry would be:
That seems a good idea. I’ll try, although I don’t really know which process keeps the HDD busy.
I thought it was samba… maybe I’ll add stop to samba as cron job too.
I’ll write back to share the result.
Thanks!
The syntax for redirection to /dev/null looks ok to me. (It is ok.) Must be something else causing an issue.
A few points:
You might also want to send any error messages to your log file (using 2>&1).
Using >/home/osmc/cronlog will overwrite the file each time (each minute) it runs and you’ll lose all previous messages. For diagnostic purposes, better to use >>/home/osmc/cronlog until you’re sure it’s running as you want.
I don’t think you need to try mounting the disk for two hours. Unlike the unmount, once should normally be enough.
Why not just stop mediacenter during that time as that would be the only process that would wake up your harddisk unless you have e.g. samba server installed
You mean kill kodi?
Or shut down Vero 4k?
I haven’t thought about the first, as it seems not an elegant way to do it.
As for the second, obviously it is not supposed by design and is hard and slow to start again.
I’ll consider this, thank you.
If it doesn’t work as it is now.
(I don’t see a problem with unmounting the disk as a more direct approach. After all if it is busy, it’ll refuse being unmounted.)
I don’t really know.
Won’t be able to?
From what I saw, if I try to access a movie and the drive is unmounted, Kodi just proposes to delete it from the library as it is not present anymore.
I should say, the HDD only contains media.
@fzinken is right. You’ll need to shut down mediacenter and samba, since you mentioned in post #3 that samba is also running. Create the cron job to run under root using sudo crontab -e. The disks might then spin down automatically.