I haven't had a chance to test the command yet (I choose not to restart my Odroid purposefully because of its strange issues with HDD detection), but I'll remember to try
Untested, but here's what I'd try:
- Login to the OMV's Linux shell
- sudo nano /etc/systemd/system/remount-nfs-on-unlock.service
- In the editor, paste this:
Code[Unit] Description=Remount NFS shares once LUKS volumes are unlocked After=default.target [Service] ExecStart=/usr/local/bin/remount-nfs-on-unlock.sh [Install] WantedBy=default.target
- sudo nano /usr/local/bin/remount-nfs-on-unlock.sh
- In the editor, paste this: (you may need to refer to "Storage > Encryption" in OMV panel and replace the path in the 5th line of the script below with what you see in the "Decrypted Device" column)
BashDisplay More#!/bin/sh # remount-nfs-on-unlock.sh while true; do if df | grep -q '/dev/mapper/md0-crypt'; then echo "unlocked, remounting..." mount -o bind,rw /export/shared exit else echo "still locked, wait for 10 seconds and try again" sleep 10 fi done
(thank you DimaKompot for this script)
- sudo chmod a+x /usr/local/bin/remount-nfs-on-unlock.sh
- sudo systemctl enable remount-nfs-on-unlock.service
Great write-up! I just stumbled across the same issue and found this thread. Took 5 minutes to implement and works!!!
THANK YOU!