Wednesday, January 30, 2013

Acer Aspire H340 & NAS4Free

Once again an off-topic post in the blog. Somehow the strange desire to share computing / IT topics occasionally took over.

Presently, I am rebuilding my IT, trying to catch up with recent technologies.

Years ago, I purchased an Acer Aspire easyStore H340. The neat little device came with 3 1TB HDDs and MS Windows Home Server. The latter, although doing its job, sucked. Finally, I decided to look for alternatives, in particular some with RAID redundancy and modern file-systems, such as ZFS.

The first alternative I found was "freeNAS". This product, along side some others, is supposed to run from flash drives or SSDs. This would helps to speed up boot and also preserves valuable HDD slots for volume data devices.
And here it comes, the H340 carries an onboard 256MB flash memory device, which is used for MS WHS recovery.
Early versions of FreeNAS were small enough to fit on this device. However, FreeNAS has evolved and grew somewhat larger.

The good new is, that there is some other product, which originates in FreeNAS and is still small enough... check out NAS4Free.

To install NAS4Free, I figure, there is only one option: equip the headless H340 with a head, i.e. a keyboard and a screen. I choose to obtain a PCIe-1x graphics card and use a USB keyboard for input.
Additionally, JP3 needs to be installed!!! Do not remove the jumper at any later stage... at least my H340 would not boot NAS4Free w/o it. Contrary to JP3, the graphics card can be removed, e.g. to reduce power consumption.

Here comes the tricky bit, the H340 needs some strange tweaks to get it to boot from USB sticks, USB CD drives etc. The CMOS setup is not that straight forward, but, it will get you there. The F12-key will help to select the boot device, if it has been recognized by the system.

To get up my system, I choose to boot the NAS4Free live CD with a USB CD-drive.
The option to install an embedded system w/o swap will install the OS on the H340's internal flash drive, just about... no room to spare, all done with a screen/kb attached.

Here comes the more fancy bit.
In such a setup, you would like to go for the most senior option of storage, which presently seems to be ZFS.
The configuration of ZFS is actually not very well documented, neither at SUN, nor at NAS4Free. So, here's what I did to get ZFS up and running on an H340.

  1. install NAS4Free from a CD using a screen and keyboard attached
  2. reboot after installation has finished, the console should offer a possibility to use DHCP now
  3. note the IP-address given to the H340
  4. using a remote computer, connect to the H340 using a webbrowser
  5. go to the "disks" menu and "import" all disks
  6. go to the "disks format" menu and format all HDDs with ZFS
  7. go to the "disks zfs pools" menu and create a virtual device (I used single parity raid)
  8. go to the "disks zfs pools management" menu and create a "pool"
  9. go to the "disks zfs datasets" menu and create a dataset using your pool(s)
  10. go to the "disks zfs volumes" menu and create a volume using your dataset(s)
The volume(s) should now be ready to use, i.e. assign to services. Under the "services" menu, one can activate various services such as NFS, CIFS/SMB, AFP etc. Assign those services to a mount point in your volume(s).

Update: It appears not to be necessary to use zfs volumes. It is advisable to mount the dataset. Additionally, it seems a good idea to use the "dedup" feature, although caution should be taken when removing a dataset, cf. advice given by nas4free.

You'll by now be running a rather robust ZFS NAS made of relatively cheap WHS hardware.
I figure it is pretty cool that NAS4Free still fits on the onboard flash drive of the H340.