FreeNAS 9.3 Wake On LAN and Mac OS X

Although WOL has been an issue in the past on FreeNAS, on FreeNAS 9.3 it is supported out of the box. To save a little power I wrote a small script to shut down my FreeNAS and wake it up again remotely.

First, make sure your device support Wake On LAN. To do so, log in on your NAS via SSH and run ifconfig. Check the output for “WOL_MAGIC”:

 

bin — ssh — 84×27 2015-09-05 14-25-04

As you can see, the onboard adapter on my HP N40l (bge0) doesn’t support it WOL but luckily I’ve fitted an Intel EXPI9301CTBLK PRO1000 network card (yep, that’s a real name) which does.

If you know the name of your card you can also run

ifconfig network adapter | grep WOL

The output should look somewhat like this if your network adapter supports WOL:

bin — ssh — 84×27 2015-09-05 14-33-05

So, you’ve got your hardware straight, now comes the software. For your Mac, you need wakeonlan to generate the magic packet which will be sent to the NAS. To do so, I recommend installing it via brew:

brew install wakeonlan

Then I wrote small shell script so

#!/bin/sh
if
[[ $1 = “on” ]]; then
echo “Waking up Sonoma”
wakeonlan MAC address of the NAS

elif
[[ $1 = “off” ]]; then
echo Sending Sonoma to sleep
ssh -t username@IP address “sudo shutdown -p now”

else
echo “Please specify on or off”
fi

Replace “MAC address of the NAS”, “username” and “IP address” with your local data. Also, Sonoma is the name of my NAS and you can change the echo outputs to whatever you want.

After that, save the file with any name you like to use as a command in /usr/local/bin and make it executable with

chmod +x filename

Now, you can remotely shut down the system by using the command

filename off

and start it again with

filename on

The output looks like this:

bash — 80×24 2015-09-05 14-35-29

FreeNAS 9.3 and booting from flash drives.

It’s been a few days and they’ve been rather quiet. That’s a good sign, because it means that FreeNAS has somewhat approved. And it really has. It is faster, more reliable and I like the new update structure making it easier to keep the machine up-to-date.

The only big issue I had is the new boot file system. With version 9.3, FreeNAS switched to ZFS for its boot medium. Not a bad choice, considering the pros of ZFS, but at least for me it seemed to lead to a lot of trouble with broken flash drives (from which I used to boot from). Multiple times I suffered from unreadable sectors.
The solution I found so far was to switch from a flash drive to a hard drive which I installed in the 5,24“ bay and plugged into the internal USB slot. Since that, it’s sailing smoothly.

Manually upgrade your ownCloud on FreeNAS

FreeNAS uses the FreeBSD Jail functionality to provide support for plugins. That is great and all, but the FreeNAS repository is not always up to date and if you want to use the latest software, you have to upgrade it yourself.

Luckily, you don’t have to get your hands very dirty to do so, as upgrading ownCloud in itself is fairly easy. Depending on your current version, ownCloud should give you the option to update itself. If it doesn’t, ownCloud has an easy to follow guide here. The version below resembles the same upgrade, with just a few slight changes for FreeNAS.

1. Turn off the Jail. I find it easier than using the maintenance mode.
2. SSH to your machine and change into the ownCloud directory within your Jail:

path is path/to/jail/usr/pbi/owncloud-amd64/www

3. rename the old ownCloud folder (as a backup):

mv owncloud owncloud_bak

4. Get the latest version of ownCloud (you can find the link on owncloud.org. This is the link for the current version 8):

wget https://download.owncloud.org/community/owncloud-8.0.0.tar.bz2

5. Unpack

tar xjf owncloud-8.0.0.tar.bz2

6. Copy the config.php of your old ownCloud installation

cp ./owncloud_bak/config/config.php ./owncloud/config/

7. Ownership of the folder and its contents should be changed to the user www.

chown -R ./owncloud

8. Turn on Jail and go to your ownCloud with your webbrowser. The page should offer an automatic upgrade.

Your done. The data is by default stored unter /media/ within your Jail and not in the owncloud directory.
After the upgrade you can delete the .tar.bz2 file you downloaded as well as your owncloud_bak folder. It is a good measure to keep an old version around as a backup, though.

FreeNAS 9.2.1.6 released

iXsystems officially released FreeNAS 9.2.1.6 today.

By taking their time, they wanted to further improve in the 9.2.1 debacle. Updates to Samba and Netatalk are included as always, jail UI fixes and some more. Additional informations can be found in their blog post.

For me, a few bigger bugs are still visible. Two particularly annoying bugs are in the plugin system:

  • My sabnzbd Plugin always shows as “off”, even though it’s up and running.
  • I can’t update plugins. I either get an unmound error or just a general error message, but in any case I can’t update.

It’s frustrating (to say the least) to see this bug emerge and don’t get fixed for several versions.

 

If you want to upgrade your installation of FreeNAS, you can download it here, or here directly. When I last checked their link in their Download section wasn’t working.

Also new in this release is a .usb download file specifically for direct dd-ing onto your USB drive. Way to go!

FreeNAS USB image

From 9.2.1.6 (currently in Beta, they’re asking for testers) onwards, iXsystems will offer a .usb image file for every release. That means, that they offer a file which can be directly imaged onto a thumb drive, just like the files I maintain in here in the Downloads section.

I recently added the old 8.3.2 x64 version of FreeNAS onto the Downloads page. It’s the last version to create pool version 28 pools, which are the most compatible pools around right now. So if you want to create a pool on a USB HDD or something like that, that’s the version to go. Also, have a look at OpenZFS.

FreeNAS 9.2.1.5 released

Just a couple of days ago, 9.2.1.4 has been released, which was followed by 9.2.1.4.1 just a day after its release. And now, 9.2.1.5 is out in the wild, apparently fixing these bugs, as the FreeNAS team explains in this rather nice statement.

The .img file is already on the server and can be downloaded here. I’ll also add FreeNAS 8.3.2 to the downloads section because it is the last build to use ZFS pool version 28, the most compatible version out there at the moment. Details on the background will follow soon as well.

FreeNAS 9.2.1.4.1 released

After the first few dot-dot releases we already have our first dot-dot-dot release: 9.2.1.4.1 fixes a big UI bug of 9.2.1.4, which in return fixed a lot of issues with Samba4 and ACLs/chmod.

Luckily, as I was away for the easter holidays, I didn’t upload the image file of 9.2.1.4, so I can directly upload 9.2.1.4.1.

And ixSystems even had the chutzpah to say that they’d like to get their auto-update going (which is due to be included in 9.2.2) to correct such flaws in future versions more easily.
For me, this only shows that I’d never auto-update on FreeNAS, simply, because I don’t want my machine to automatically upgrade to a version which introduces major bugs. As long as bugs of this quality can pass all tests I won’t run automatic updates.

As I already stated numerous times, if you want a stable system you should stick to FreeNAS 9.1.1 for a little longer.

 

I will upload the .img file and update this post.

 

UPDATE: the file is available here. The full list of files (and ‘history’, if you dare calling it such) can be viewed here

FreeNAS 9.2.1.2 released

Just a few days after the first dot-dot release in the history of FreeNAS comes the second: Ladies and gentlemen, 9.2.1.2 is here.

It fixes yet more bugs (seems to be focused on SMB) and everybody is encouraged to update their systems. More interesting for me (since I don’t use SMB) is the logging part though. From the blog post:

Logging to .system dataset is now optional. If you have an old syslog dataset (which is how this was formerly done), you are strongly encouraged to transition to the new .system/syslog dataset by enabling that option in System->Settings->Advanced and simply deleting your old syslog dataset.

Since I’m not at home right now, I won’t be able to upload a .img right away. I’ll update this post when I’ve done so.

EDIT: I uploaded the file and you can download it in the Downloads section or via direct link.

I also cleaned the Downloads a bit (since I don’t have that much space on my shared host) and will add back the 9.1.1 file since it seems that 9.1.1 is much more stable than 9.2.x. If you’re planning on using FreeNAS in an environment where it should run 24/7, I’d recommend 9.1.1.