Skip to content

rain874/FreeNASMountScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

FreeNASMountScript (NFS Share)

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.

Testing:

TrueNAS-12.0-U6

FreeNAS-11.3-U2

Debian 11 (Bullseye)

Debian 10.3 (Buster)

Debian 9.12 (Stretch)

Please note

  • 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)

Requirements

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

Create .service file for AutoStart

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

systemctl enable freeNASmount.service

systemctl Start

systemctl start freeNASmount.service

systemctl Check Status

systemctl status freeNASmount.service

At this point, NFS Share should be bound to the filesystem.

FreeNASMountScript Logging

A logfile with timestamp will be place in the following path: /var/log/freeNASmount.log

Donations

Please feel free to send any question or remark to [email protected] . Support via PayPal is appreciated.

  • Thanks for you Support PayPal

About

FreeNAS Check and Mount Script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published