FreeNAS is free and open-source NAS software based on FreeBSD.
It offers several extra features missing in the WD OS, e.g. ZFS storage and virtualization.
This guide provides a complete replacement for the WD OS3 firmware.
Official website: http://www.freenas.org/
Recommended to run with 2x 8GB DDR3L SODIMM ram.
FreeNAS requires at least 8GB ram, so it probably doesn’t work on the PR2100.
Installation
Here is a zipped image of FreeNAS 11.2-U3 you can flash to a USB drive of at least 16GB. Unzip the image first!
On windows, you could use rufus to flash it.
On unix, use dd.
dd if=fn.img of=/dev/sdX bs=4M
Alternatively, create your own FreeNAS boot disk with debian/ubuntu
create FreeNAS boot disk with QEMU
Get the FreeNAS installer ISO (v11.2) on the website.
Run the installer on a virtual machine with UEFI (and 2G ram) and install to an empty USB flash drive (at /dev/sdX).
Qemu needs to find bios.bin in the bootloader path.
apt install qemu-kvm ovmf
cp /usr/share/ovmf/OVMF.fd ./bios.bin
kvm -L . -cdrom <freenas.iso> -hda /dev/sdX -boot once=d -m 2G
Make sure you select UEFI bootloader during the installation process.
When it is ready, shutdown the VM.
Plug the USB flash drive in the PRx100 NAS.
Reboot, wait about 5 minutes and lookup the IP address on your router.
Open this IP address in your browser and enjoy FreeNAS!
Login as root - freenas. (change this asap!)
Create a storage pool
Warning: this will erase all data on the disks. The file system is incompatible with the original OS.
I’d suggest to only insert the drives you want to be used, unplug the others. The NAS supports hotswap so you don’t need to shutdown. Refresh the web interface.
In the left column, select “Storage”, then select “Pools”.
On the right, select “Add Pool”.
Then select “Create Pool” (or import an existing one).
All available devices are now listed, including the internal mmc flash. I’d definitely not write to that one as it voids your warranty.
Select the ada
devices from the available devices list and press the left arrow to move them to the Data VDev list.
You may also setup an SSD cache here.
Pick a name for the pool and then select “Create” to initialize the pool.
You can now install extra applications.
Hardware control
As of FreeNAS 11.2 you can control the hardware (fan, lcd, leds, …) as the kernel supports the braswell UART and I2C device.
Here’s a hardware control script that can be used as a post-init script. Add it in Tasks - Init/Shutdown scripts.
Features
- temperature monitor for CPU, RAM, disks with fan control
- led control
- shows IP address on LCD button press
You may want to tune it to your liking… e.g. add shutdown conditions, weather forecast, recent downloads, …
Manual interaction with the hardware can be done with screen and this list of commands.
Example
screen /dev/ttyu3
# STA
STA=6c
# FAN=20 # better not to rely on this low fixed fan speed value
ACK
# LN1=Hello World
ACK
Warnings
Use this at your own risk.
You can’t import your existing data as FreeNAS does not support ext4 file systems. Your drives will be fully wiped when you create a ZFS array. However, a preview of the webgui without creating an array is harmless…
Hardware control is available, but use it with common sense. Read the script.
Don’t fry your NAS by turning the FAN off. Without temperature monitoring it may melt / burn.
The hardware control script may get some important upgrades in the future so check for available updates.
To go back to the My Cloud OS, shutdown the NAS, unplug the FreeNAS boot usb drive and reboot.
Create a virtual test setup
Virtual test setup
You can test the whole flow first by writing to a virtual disk instead of an actual disk.
dd if=/dev/zero of=ovmf.disk bs=1 count=1 seek=$(( (10 * 1024 * 1024 * 1024) - 1))
kvm -L . -cdrom <path_to_freenas.iso> \
-hda ovmf.disk -boot once=d -m 2G
Test by booting the disk.
kvm -bios ./bios.bin -hda ovmf.disk -m 2G