In my previous blog entry I described how to FreeNAS checks if there are still computers on the network - or the system will shut down. Now the question remains how to restart it after that.
Send Magic Packet
An obvious way is Wake-On-LAN (short WOL). Here a so-called "Magic Packet" is sent to the network card, which then starts the system. Unfortunately, the onboard NIC in the HP N36L does not support this feature in FreeBSD, so a Intel NIC Move into the system. After the card is installed you only need one tool (on my MacBook Air I use the free "WakeOnLAN", other programs will work the same way) to send the magic package. For Windows it is a simple wol.exe to which the MAC address is passed as a parameter. This can then be done either via a shortcut or in the autostart, and it looks like this (the MAC address must be adjusted)
@wol.exe 6805ca09fcf9 @echo "WOL signal sent 1" @timeout /T 5 @wol.exe 6805ca09fcf9 @echo "WOL signal sent 2"
If you put the contents of a batch file (*.bat) in the same directory as wol.exe, then several WOL signals will be sent one after the other with 5 seconds between each signal.
And behold... HP N36L starts without further ado, without having to press the power button. Sure, depending on where the device is, you can also start it manually, but it's already practical to theoretically be able to activate the NAS from the smartphone. Only the boot time is a bit annoying and needs getting used to, the data isn't immediately available. You can easily influence this by not running the cron job that shuts down the NAS too often - then it really only turns off when you leave the house and not when you turn off the computer for a short time.
I hope that my experience will help one or the other to save some electricity. Next, I'm going to try to bring the hard disks into standby mode in a more controlled way when no data is being accessed.
Wake-on-LAN for FreeNAS 9.1.1
of course this variant also works with the current FreeNAS version 9.1.1 - but I didn't try if wake-on-LAN now works with the onboard NIC of the N36L.
Wake-on-LAN for FreeNAS 9.2.x
Unfortunately, Wake-on-LAN with FreeNAS version 9.2.0 or higher does not work as usual. In order to use Wake-On-LAN nevertheless, a change to the rc.shutdown file will help when using a setup with Intel NIC. This requires a few steps, but can be easily done. First you have to log in via SSH, then:
mount -w / nano -w /conf/base/etc/rc.shutdown
Comment out the line /sbin/ifconfig -l | /usr/bin/xargs -n 1 -J % /sbin/ifconfig % down (# in front)
mount -r /
If you reboot the system now, you can access it again via Wake-on-LAN - as described above. Hopefully WoL will work with FreeNAS in the next version.
Wake-on-LAN for FreeNAS 9.3.0
After upgrading to the current FreeNAS version 9.3.0 I was sceptical about Wake-On-LAN at first. But: unlike with 9.2.x it works at least with the Intel NIC without problems and without further settings. Just shutdown, after that FreeNAS 9.3.0 can be started easily via Wake-On-LAN.
Wake-on-LAN for FreeNAS 9.10
If you are already using FreeNAS 9.10, you will need the same Workaround. This allows the system to be started again as usual via WOL signal.
[amazon_link asins=’B072X2YJ2N,B013UBCHVU,B00G4UZEKG,B0749PJMV4′ template=’ProductCarousel‘ store=’techbloggernet-21′ marketplace=’DE‘ link_id=’09c970ed-d935-11e7-8fad-3bd71462968d‘]