This bash script checks the availibility of FreeNAS or TrueNAS within the network by sending a ping. If FreeNAS is not reachable, MagiPack (Work on LAN) will be sent to start FreeNAS. In case it is reachable the NFS Share will be bound to the Debian Filesystem.
TrueNAS-12.0-U6
FreeNAS-11.3-U2
Debian 11 (Bullseye)
Debian 10.3 (Buster)
Debian 9.12 (Stretch)
- Change the variable IP, RELEASE, MOUNTPOINT, MAC, BROADCAST in the beginning of the script. If needed also change the variable PORT.
- Check if WOL is activated within your FreeNAS. Please check the motherboard manual.
- Check the status of the NFS service in your FreeNAS Webinterface „Service“ → „NFS“ → „activated“
- Check the status of NFS Share within your FreeNAS Webinterface „Sharing“ → „NFS“
- Create a folder on the client system for example (/home/user/freeNAS)
To use the sripct following packages are needed:
Install this package first
$ apt-get install libnotify-bin
$ apt-get install nfs-common portmap
- The FreeNAS network adapter has to support WOL (wake on LAN) and needs to be activated in BIOS/UEFI
First, a .service file must be created under /etc/systemd/system, e.g. with the file name freeNASmount.service. This file has to be edited with an editor with root access accordingly to following content:
[Unit]
Description=FreeNASMountScript
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/root/freeNASmount.sh
[Install]
WantedBy=multi-user.target
Perform following 3 commands:
systemctl enable freeNASmount.service
systemctl start freeNASmount.service
systemctl status freeNASmount.service
At this point, NFS Share should be bound to the filesystem.
A logfile with timestamp will be place in the following path: /var/log/freeNASmount.log
Please feel free to send any question or remark to [email protected] . Support via PayPal is appreciated.
- Thanks for you Support PayPal