I’m new to OMV7 and Rpi 5 but have it all working as a NAS and am now moving onto backup and restore of the OS and OMV (not user data as this is all sorted). This is a surprisingly fragmented area but the approach I have working is to take the Rpi offline and to clone the SD card on a Windows machine to another. If the SD card fails or the OS or OMV gets corrupted, I simply use the backup SD cards for booting. This has been tested fine.
Obviously, this is very tedious and is only as current as the last offline clone so I want an online hands off solution that can run frequently. The “rpi-clone” utility now maintained by Jeff Gerling at https://github.com/geerlingguy/rpi-clone seems promising as it aims to clone the boot SD card and contents (such as OMV) to another SD card or USB thumbdrive and can be run as a crontab job. I aim to have an SD card sitting in a USB SD card reader running a clone of the OS boot disk every say hour.
After cloning using rpi-clone and booting from the newly burnt SD card, all seems promising: I can ssh logon however the OMV web page at the same IP address will not connect so I can’t get into OMV. For disgnostics I run omv-firstaid from the ssh logon. Option 7 is ok – “The configuration status file is valid”. Option 8 is ok – “All RRD database files are valid.” But when running option 3 to Configure the OMV Workbench I return a number of nginx errors thus:
----------
ID: configure_nginx_site_webgui
Function: file.managed
Name: /etc/nginx/sites-available/openmediavault-webgui
Result: True
Comment: File /etc/nginx/sites-available/openmediavault-webgui is in the correct state
Started: 20:29:18.938950
Duration: 126.865 ms
Changes:
----------
ID: configure_nginx_security
Function: file.managed
Name: /etc/nginx/openmediavault-webgui.d/security.conf
Result: True
Comment: File /etc/nginx/openmediavault-webgui.d/security.conf is in the correct state
Started: 20:29:19.065954
Duration: 110.192 ms
Changes:
----------
ID: execute_nginx_ensite
Function: cmd.run
Name: nginx_ensite openmediavault-webgui
Result: True
Comment: Command "nginx_ensite openmediavault-webgui" run
Started: 20:29:19.176275
Duration: 3.361 ms
Changes:
----------
pid:
4767
retcode:
0
stderr:
stdout:
Site configuration file 'openmediavault-webgui' is already enabled.
----------
ID: test_nginx_service_config
Function: cmd.run
Name: nginx -t
Result: False
Comment: Command "nginx -t" run
Started: 20:29:19.179783
Duration: 5.772 ms
Changes:
----------
pid:
4769
retcode:
1
stderr:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2024/08/07 20:29:19 [emerg] 4770#4770: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
stdout:
----------
ID: restart_nginx_service
Function: service.running
Name: nginx
Result: False
Comment: One or more requisite failed: omv.deploy.nginx.default.test_nginx_service_config
Started: 20:29:19.186259
Duration: 0.007 ms
Changes:
----------
ID: monitor_nginx_service
Function: module.run
Result: False
Comment: One or more requisite failed: omv.deploy.nginx.default.restart_nginx_service
Started: 20:29:19.186601
Duration: 0.003 ms
Changes:
Summary for raspberrypi
-------------
Succeeded: 17 (changed=12)
Failed: 3
-------------
Total states run: 20
Total run time: 1.256 s
[ERROR ] Command 'nginx' failed with return code: 1
[ERROR ] stderr: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2024/08/07 20:29:19 [emerg] 4770#4770: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
[ERROR ] retcode: 1
[ERROR ] {'pid': 4769, 'retcode': 1, 'stdout': '', 'stderr': 'nginx: the configuration file /etc/nginx/nginx.conf syntax is ok\n2024/08/07 20:29:19 [emerg] 4770#4770: open() "/var/log/nginx/error.log" failed (2: No such file or directory)\nnginx: configuration file /etc/nginx/nginx.conf test failed'}
Display More
Clearly, the rpi-clone utility is at fault and out of scope here but I'm hoping that someone could help with a suggestion for restarting / fixing nginx in this state? Or any recommendations for a better solution?
Btw, I have tried other solutions such as native "dd" and the OMV clone plug-in with poor results.