/storage/.kodi/userdata/scripts is a good place for user scripts.
Thanks for your hint!
Michele.
/storage/.kodi/userdata/scripts is a good place for user scripts.
Thanks for your hint!
Michele.
FYI, the backup function in the LE settings addon will backup /storage/.cache, /storage/.config and /storage/.kodi which is normally all you need to capture.
You're right but I also have some scripts I want to backup (and restore) so I created a more inclusive way to backup more stuff. Anyway my problem was due to the fact I didn't stop kodi service before the restore.
Thanks,
Michele.
To anyone who may help, I found a solution by myself.
First I realized I did one mistake: I restored backup with kodi service up and it is wrong so:
1) first I stopped kodi service,
2) restored backup from my backup file then,
3) before starting up kodi service again, renamed the MyVideoxxx.db file (where xxx is the most recent number) in /storage/.kodu/userdata/Database because it's created by new installation
4) next step was to start kodi service and Bingo! All libraries and settings were there!
Have a nice day,
Michele
I need to do a new install beacuse I can't update (fat partition is too smal) with nithly builds. I have a script that makes a backup of all important files and folders in /storage but when I restore:
- language setting are not restored
- alla libraries are gone and have to make new scans of every media folder
Here's the script:
if [[ ! -f /storage/backup/BACKUP* ]]; then
echo Il file non esiste, eseguo un nuovo backup!
DATAFILE="`date +%d%m%Y-%H%M%S`"
tar --exclude=tvshows \
--exclude=backup \
--exclude=videos \
--exclude=screenshots \
--exclude=recordings \
--exclude=pictures \
--exclude=music \
--exclude=logfiles \
--exclude=emulators \
--exclude=downloads \
--exclude=lost+found \
-cf /storage/backup/BACKUP-$DATAFILE.tar /storage
fi
I backup every folder and file apart from those I exclude. I also used tha backup addon: it restores language settings but not libraries.
Am I doing anything wrong?
Thanks a lot,
Michele.
Sorry, I forgot that we are on x86.
Then the equivalent idea is to install latest Debian (or whatever Linux) Live on USB stick, and try that hdparm version. I recently made a Debian 12 stick to bring my parallel port printer back to life.
I should be able to do that,
an Ubuntu server distro would be also fine?
If yes I'll give it a try next days, I'm out of home now.
Thanks a lot.
OK. The next thing I would do is installing RPi OS on another microSD, and see whether it works on that OS.
If it does, then our devs can usually implement it on LE (maybe just copying the command to LE already does the trick).
I don't know anything about RPI Os, never used it nor installed.
I wouldn't be able to configure it or to make any test with it, sorry.
Nothing in hd-idle.log?
The log file is not even being created.
I installed hd-idle and set it up in autostart.sh but it does nothing.
I tried to launch it directly from the command line but it has no effect, literally nothing happens.
The command I used is: /storage/.kodi/addons/virtual.system-tools/bin/hd-idle -a sda -i 1200 -l /storage/logs/hd-idle.log
The "-1 1200" parameter should spin down HDD after 20 minutes but it spins down after few minutes as usual and no log file is written.
I read the manual at https://hd-idle.sourceforge.net/ and the command I used should be fine.
Thanks.
These are all internal, not external drives.
Which enclosure are you using? Check with the manufacturer of the enclosure, very often (and in your case very likely) it'll be the USB-SATA controller in the enclosure that's responsible for the spindown.
so long,
Hias
Yes, they're all internal drives.
I use a simple metallic (almost hand made) box to contain HDD and this cable to connect SATA to USB https://shorturl.at/mfLVR.
I use it also to connect HDDs to Windows PC but none of them have spin down problems, I have problem with LibreElec only.
Thanks.
There is an hd-idle command, which is provided by the System Tools add-on:
It also generates a log file, so maybe helpful for further investigations.
Ok, I will give it a try.
Thanks a lot.
Unfortunately no useful BIOS setting for USB power or something of that kind.
BIOS is new (2023) but has few settings for USB.
Check the support pages of your drive manufacturer. eg with external WD drives you have to use WD Drive Utilities on Windows to configure the sleep timer.
I could check support pages yes but I tried with 3 different HDD: WD-RED 12TB, SEAGATE BARRACUDA 8TB, HITACHI DESKTAR 3 TB and all of them have the same "problem": when I pause a movie from LibreElec HDD spins down after few minutes.
Any other helpful hint?
Thanks.
BIOS settings ok, I will give it a try.
Thanks.
The first example should fail because the script is not providing the full path to hdparm and is addressing a partition not a disk.
The second example should fail because the script is providing an incorrect path to hdparm and addressing a partition not a disk.
Even if you corrected to /dev/sda as per my previous suggestion, you're still going to fail on the first points above.
The correct path is /usr/sbin/hdparm not /usr/bin/hdparm
I beg your pardon but it was my typo, the path I used is /usr/sbin/hdparm.
Anyway I think the problem is not there.
I wrote before:
I noted one thing, if I launch the command "hdparm -S 0 /dev/sda" from an SSH shell, HDD spins UP and "Setting StandBy to 0 (off)" appears on console but after few minutes HDD spins down again.
It seems hdparm can't manage HDD power management even when launched directly through shell
Hi and thanks for your reply.
QuoteSo in general it's not a bug, but a feature.
I can in general agree with you but the fact that HDD spins down after 2-3 minutes as soon as I pause a movie it's not a feature but an annoyance, at least for me. It would be different if HDD would stop after say 10 or more minutes.
QuoteThe above facts result in the conclusion that your HDD firmware does the energy management, not LE.
- The HDD firmware spins down whenever idle in mounted mode.
- The HDD firmware takes hdparm as an abstract task, and spins up without further command interpretation.
I would not be so sure of that. If it's the firmware that spins down the HDD, why that firmware does not spin HDD down when LibreElec is off?
Then I don't event think it's not a HDD type matter because I tried with 3 different HDD (and one of them is very very old): the behavouir is the same for all.
Anyway, if hdparm does not seem to be working, what else I can do to control my HDD power management with LibreElec?
Thanks a lot, Michele.
Not working, modified script in "hdparm -S 0 /dev/sda", rebooted and after few minutes HDD spins down.
I noted one thing, if I launch the command "hdparm -S 0 /dev/sda" from an SSH shell HDD spins UP and "Setting StanBy to 0 (off)" appears on console but after few minutes HDD spins down again.
I really don't undestand what's going on. This is the third HDD I try and with all of them I have the same result. This must something inside LibreElec or its operative system.
Any other idea?
I'll give it a try late in the evening.
The thing that looks stange to me is the fact that if I lunch the command "hdparm -S 0 /dev/sda2" from an SSH shell when the HDD is sleeping then it start to spin up immediately.
Thanks a lot for your advice.
Hi.
I'm using version 13 night builds on my GMKtec G3 Plus (version 12 doesn's work on my box).
I have an USB hard drive connected via USB and have no problem in general but when I pause a movie or anything I'm watching for just few minutes, HDD spins down.
I tried to use hdparm in autostart.sh with this command: "hdparm -S 0 /dev/sda2" and also "/usr/bin/hdparm -S /dev/sda2" but with no luck: if I pause my watching, HDD spins down, always.
If I open a shell (ssh) and run the command "hdparm -S 0 /dev/sda2" when HDD is down then it resumes so, I guess, the command is correct but when inserted in autostart.sh it doesn't work.
If I shutdown LibreElec keeping HDD on it never spins down so I guess it's LibreElec that somehow spins HDD down in some way.
What am I doing wrong? Is there anything else I can do to avoid the spinning down of my HDD after few minutes?
Thanks a lot,
Michele.
Hi Chewitt.
Today I encontered the same problem: wifi didn't connect and I had to restart system 2 times.
Here's the log, hoping you'll find sometighin useful:
Thanks,
Michele.
Here I am.
Today the box had a strange behavior, I turned it up and it took several minutes (say 4 at least) before connecting to wifi, I took the log.
Then I reboot it three times and it connected to wifi in few seconds, all the times.
Hope you cand find the reason of this stange behavior in the log:
Thanks,
Michele.