AlexFromChaos / synology_hibernation_fixer

Synology DSM HDD hibernation fixer script
MIT License
63 stars 4 forks source link

Support for AMD based Cpu #2

Open hoeselr opened 1 year ago

hoeselr commented 1 year ago

first off all - thank you for the great great Job you have done!! We installed the the script on a ds923+ and Nas went into hibernation Mode (before it did not) but every 30 min. it wakes up very frustrating - can you adopt the script for AMD?

AlexFromChaos commented 1 year ago

BTW, I've updated task default options in the script today, better to re-run with the latest script.

Can you attach or copy-paste the content of /var/log/hibernation_fixer.log and /var/log/synocrond-execute.log?

hoeselr commented 1 year ago

Thank you very much!! i installed the new script right now, attached are the logfiles synocrond-execute.log

hibernation_fixer.log

AlexFromChaos commented 1 year ago

According to the logs, in-memory patches were applied successfully and synocrond tasks are not waking up NAS every half an hour. So it looks like something which the script doesn't (yet) support.

It's better to understand what's causing these wake ups - it can be something which better to take into account in the script or it can be even something external like some device accessing the NAS shared folder every 30 min.

Can you collect stats who wakes up your NAS using DSM's Enable system hibernation debugging mode?

You can enable it via Support Center -> Support Services -> Enable system hibernation debugging mode -> Wake up frequently. After enabling, leave NAS idle for ~8 hours to collect some stats. Then stop the tool (untick "Enable system hibernation debugging mode"/Apply) and download the logs archive, using Generate logs in the same dialog in DSM.

The downloaded debug.dat file is just a .zip file with logs and configs inside. Only few files needed from it:

(they can also be retrieved from /var/log via ssh)

hoeselr commented 1 year ago

Thank you !

Today 27.06.2023 in the area marked in yellow our nas should normally be in idle mode. 15-18h it woke up due music streaming = OK

attached are the logs. hibernationFull.log synocrond-execute.log synosys.log hibernation.log

2023-06-27_18-34-58
AlexFromChaos commented 1 year ago

According to logs, there are wake ups every hour caused by JDownloader - it updates its log file (namely, org.jdownloader.update.UpdateManager.log.0) every 1 hour.

What is strange, is that you also have Plex installed (has some activity in the log) and Plex' volume is different from the one where JDownloader is installed.

So the very first question is how JDownloader was installed (and to which volume)?

In the log JDownloader is on dm-2 and Plex is on dm-3 - if any of them is not NVMe, than this is the reason of wake ups.

You can check which volumes correspond to dm-2 anddm-3 by executing sudo dmsetup info /dev/dm-2 | grep -i Name (+same for dm-3) or, to show the full list,

sudo lvdisplay | awk  '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'

It looks like JDownloader was installed on a HDD partition. If so, it needs to be reinstalled to the NVMe partition (same as Plex's).

hoeselr commented 1 year ago

We moved JDownloader to NVMe partition - now the DiskStation seems to sleep fine - i think your script works fine on AMD CPU aswell!

now i am looking forward to the implementation of the virtual machine manager, when the time comes i will of course be there and test it - our use case would be the proxmox backup server as a VM on the synology. Thanks very much

deckardstp commented 10 months ago

Hi Alex,

at first - thank you for all the work you put into this script. I have Exos 18 hard drives and I wasn't able to put them to sleep until I found your script. I use a Synology DS1821+ with the latest upgrade: DSM 7.2.1-69057 Update 1 and found some remarks, maybe interesting for the future development:

2023-11-14 00:08:19,207 DEBUG Encountered unfamiliar task builtin-libsynostorage-syno_disk_mail_send, suggesting to leave it unchanged 2023-11-14 00:08:19,207 DEBUG Encountered unfamiliar task builtin-libsynostorage-syno_disk_mail_send, suggesting to leave it unchanged 2023-11-14 00:11:53,027 DEBUG applied fixes to /usr/syno/etc/synocached/synocached.conf 2023-11-14 00:11:53,031 DEBUG applied fixes to /usr/syno/etc/synocached/synocached.default.conf 2023-11-14 00:11:53,433 DEBUG run() triggered for the scheduled task 2023-11-14 00:11:53,543 DEBUG applying in-memory patches for pid 15423 2023-11-14 00:11:53,543 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for scemd 2023-11-14 00:11:53,591 DEBUG applying in-memory patches for pid 13490 2023-11-14 00:11:53,592 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for synostgd-disk 2023-11-14 00:11:53,593 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/syno_ew_weekly_check.conf 2023-11-14 00:11:53,601 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/synolegalnotifier.conf 2023-11-14 00:11:53,602 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/libsynostorage.conf 2023-11-14 00:11:53,602 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/synorenewdefaultcert.conf 2023-11-14 00:11:53,603 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/synosharesnaptree_reconstruct.conf 2023-11-14 00:11:53,603 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/libhwcontrol.conf 2023-11-14 00:11:53,604 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/synosharing.conf 2023-11-14 00:11:53,605 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/synobtrfssnap.conf 2023-11-14 00:11:53,605 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/syno_ntp_status_check.conf 2023-11-14 00:11:53,606 DEBUG applying user config to task files: going to change /usr/syno/share/synocron.d/synodatacollect.conf 2023-11-14 00:11:53,606 DEBUG applying user config to task files: going to change /usr/syno/etc/synocron.d/autopkgupgrade.conf 2023-11-14 00:11:53,607 DEBUG applying user config to task files: going to change /usr/syno/etc/synocron.d/myds.conf 2023-11-14 00:11:53,607 DEBUG applying user config to task files: going to change /usr/syno/etc/synocron.d/synodbud.conf 2023-11-14 00:11:53,608 DEBUG applying user config to task files: going to change /usr/local/etc/synocron.d/SynologyApplicationService.conf 2023-11-14 00:11:53,609 DEBUG going to change /usr/syno/etc/synocrond.config 2023-11-14 00:20:06,240 DEBUG run() triggered for the scheduled task 2023-11-14 00:20:20,896 DEBUG waited for boot to finish for 14.65 sec 2023-11-14 00:20:21,011 DEBUG applying in-memory patches for pid 15435 2023-11-14 00:20:21,012 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for scemd 2023-11-14 00:20:21,062 DEBUG applying in-memory patches for pid 13569 2023-11-14 00:20:21,062 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for synostgd-disk 2023-11-14 00:20:21,064 DEBUG applying user config to task files: going to change /usr/syno/etc/synocron.d/autopkgupgrade.conf 2023-11-14 00:20:21,071 DEBUG applying user config to task files: going to change /usr/local/etc/synocron.d/SynologyApplicationService.conf 2023-11-14 00:20:21,072 WARNING A new task builtin-dyn-myds-default has been found, likely installed by a new package or a DSM update. Re-run the script install to tell what to do with this task. Skipping it for now 2023-11-14 00:20:21,072 WARNING A new task pkg-SynologyApplicationService-default has been found, likely installed by a new package or a DSM update. Re-run the script install to tell what to do with this task. Skipping it for now 2023-11-14 00:20:21,073 DEBUG going to change /usr/syno/etc/synocrond.config 2023-11-14 08:23:26,190 DEBUG Encountered unfamiliar task builtin-libsynostorage-syno_disk_mail_send, suggesting to leave it unchanged 2023-11-14 08:23:26,191 DEBUG Encountered unfamiliar task builtin-dyn-myds-default, suggesting to leave it unchanged 2023-11-14 08:23:26,191 DEBUG Encountered unfamiliar task builtin-libsynostorage-syno_disk_mail_send, suggesting to leave it unchanged 2023-11-14 08:24:27,408 DEBUG Encountered unfamiliar task builtin-libsynostorage-syno_disk_mail_send, suggesting to leave it unchanged 2023-11-14 08:24:27,409 DEBUG Encountered unfamiliar task builtin-dyn-myds-default, suggesting to leave it unchanged 2023-11-14 08:24:27,409 DEBUG Encountered unfamiliar task builtin-libsynostorage-syno_disk_mail_send, suggesting to leave it unchanged 2023-11-14 08:25:45,070 DEBUG applied fixes to /usr/syno/etc/synocached/synocached.conf 2023-11-14 08:25:45,535 DEBUG run() triggered for the scheduled task 2023-11-14 08:25:45,648 DEBUG applying in-memory patches for pid 15553 2023-11-14 08:25:45,648 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for scemd 2023-11-14 08:25:45,698 DEBUG applying in-memory patches for pid 13549 2023-11-14 08:25:45,698 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for synostgd-disk 2023-11-14 08:25:45,700 DEBUG applying user config to task files: going to change /usr/syno/etc/synocron.d/autopkgupgrade.conf 2023-11-14 08:25:45,700 DEBUG applying user config to task files: going to change /usr/local/etc/synocron.d/SynologyApplicationService.conf 2023-11-14 08:25:45,701 DEBUG going to change /usr/syno/etc/synocrond.config 2023-11-14 08:27:52,448 DEBUG run() triggered for the scheduled task 2023-11-14 08:28:08,965 DEBUG waited for boot to finish for 16.50 sec 2023-11-14 08:28:09,072 DEBUG applying in-memory patches for pid 14920 2023-11-14 08:28:09,072 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for scemd 2023-11-14 08:28:09,128 DEBUG applying in-memory patches for pid 13327 2023-11-14 08:28:09,128 DEBUG successfully applied patch 'NVMe I/O HDD hibernation fix for DSM 7.2' for synostgd-disk 2023-11-14 08:28:09,130 DEBUG applying user config to task files: going to change /usr/syno/etc/synocron.d/autopkgupgrade.conf 2023-11-14 08:28:09,149 DEBUG applying user config to task files: going to change /usr/local/etc/synocron.d/SynologyApplicationService.conf 2023-11-14 08:28:09,150 WARNING A new task pkg-SynologyApplicationService-default has been found, likely installed by a new package or a DSM update. Re-run the script install to tell what to do with this task. Skipping it for now 2023-11-14 08:28:09,151 DEBUG going to change /usr/syno/etc/synocrond.config