h1

Installing FreeNAS to USB Flash: Easy as 1,2,3

January 21, 2009

I don’t want to get too deep into a re-hash of how to install FreeNAS onto USB flash (or “thumb”) drives – there is a wealth of community information in that regard. However, any time I come across the same simple question so many times in one week I have to investigate it more thoroughly.  This week, that question has been “have you tried FreeNAS?”

Anyone familiar with the fine m0n0wall project (and off-shoot pfSense) will instantly recognize the FreeBSD appliance approach taken for FreeNAS. The look-and-feel is very M0n0wall-ish as well. In short, this is a no-nonsense and easy-to-install appliance-oriented distribution that covers the basics of network attached storage: CIFS, NFS and iSCSI. Given that M0n0wall and pfSense both virtualize very well, I have no doubt the VMware appliance version performs likewise.

1, 2, 3… NAS

That said, let’s quickly run-down a 1, 2, 3 approach for booting FreeNAS to hardware from USB drive… This is a run-from-ram-disk appliance, so the size of the USB storage device is minimal: about 50-60MB. Since I am still testing the Tyan Transport GT28 system, I will catalog my steps for that platform:

NOTE: Your BIOS must support boot-from-USB or this will not work.
  1. Download the AMD64 “FreeNAS Image” from FreeNAS.org;
  2. Insert target USB “thumb drive” into a compatible USB socket;
  3. If your system “auto mounts” the drive, manually unmount all partitions associated with the “thumb drive” and make note of the device (ex. /dev/sdi, so “umount /dev/sdi1″ works for my SanDisk Cruzer);
  4. Even though this image is a “.img” file, it is gzipped, so it needs to be extracted to your target volume:
    gunzip -c <path>/FreeNAS-amd64-embedded-xxx.img | dd of=/dev/sdi

    (note: my device is “/dev/sdi” – use yours from step 3)

  5. Eject your USB device (ex. “umount /dev/sdi”);
  6. Plug-in your USB device into your target platform;
  7. Make sure BIOS is configured for boot-from-flash (see “Preparing the BIOS” in my blog “Installing VMware ESXi on the Tyan Transport GT28” for details and screen shots);
  8. Boot your FreeNAS appliance;
  9. Configure your attached storage;
    1. Manage disk(s) (ex. pair of RAID1 arrays);
    2. Create UFS/Soft Updates filesystem volumes (one per RAID1);
    3. Mount filesystems;
    4. Create shares;
  10. Attach to storage via network.

Creating an iSCSI Volume for Testing

Using my two RAID1 disks provided by the LSI 1068E and four 500GB RAID-edition hard disks, I formatted two volume as UFS (GPT and Soft Updates), naming them “volume1″ and “volume2,” respectively. Next, I mounted each as “share1″ and “share2,” respectively, to provide two separate “volume containers” to house my iSCSI target extents.

FreeNAS, Mount Points

FreeNAS, Mount Points

To create my extents, I used the Advanced->File Editor menu to create the extents files in each share volume. Only then could I get the RAID0 device to work as an iSCSI target. While this is not a deal-breaker, this little issue could catch the uninitiated in a frustration loop…

FreeNAS, iSCSI Target Creation

FreeNAS, iSCSI Target Creation

No support (from WebGUI) exists for CHAP authentication of targets to initiators, so the IP-address block ACL is the only factor securing the use of the target. In a VMware world, this simple ACL method is probably acceptable to most, but for the security concious is may be a sticking point and may want to delve into the CLI to solve this issue.

That said, VMware ESX 3i finds the iSCSI target on the first try:

VMware ESX 3i Discovers FreeNAS Target with Ease

VMware ESX 3i Discovers FreeNAS Target with Ease

An installation of Suse Linux Enterprise Server (SLES) 10 SP2 (x86_64) went swimmingly with an average write-to-SAN rate of 8MB/sec and peaks to 20MB/sec (write). Installation was via NFS-mounted CD-ROM image so that would be a limiting factor. On boot of the VM, the SAN peaked at 60MB/sec (read) for a few seconds. Running a test using pure-ftpd on the SLES virtual server from my workstation (1Gbps) to the servers disk (a vmdk on the iSCSI SAN provided by FreeNAS) the “perceived throughput” from the ftp client was about 100MB/sec:

ftp> put w2kadv.iso
local: w2kadv.iso remote: w2kadv.iso
229 Extended Passive mode OK (|||36676|)
150 Accepted data connection
100% |***************************************************|   405 MB  105.85 MB/s    00:00 ETA
226-File successfully transferred
226 3.833 seconds (measured here), 105.83 Mbytes per second
425406464 bytes sent in 00:03 (105.83 MB/s)

However, the “actual” write took much longer due to write caching from VMware:

VMware Buffered Write, VMDK file on FreeNAS, 1Gbps Ethernet

VMware Buffered Write, VMDK file on FreeNAS, 1Gbps Ethernet

It is easy to see that more rigorous testing would be needed to gauge the performance of the FreeNAS system, however that testing is beyond the scope of this blog entry. Although, in a direct FTP to the FreeNAS server’s FTP daemon, the transfer rate (upload) of 7.5MB/sec confirms the relatively poor write performance of the drive system. Again, once the data was cached at the NAS, the read speed for FTP was around 100MB/sec. Likewise, a copy of one RAID1 volume to another from within an SSH session showed similar performance (write) of 7.5-8MB/sec.

Impressions

Immediately, I was impressed with the relative ease with which FreeNAS installed on my test system. However, FreeNAS is not for everyone and, while simple and well thought-out, it has many not-ready-for-enterprise “features:”

  1. Change network settings = reboot;
  2. Add new network interface (VLAN, trunk, etc.) = reboot;
  3. Storage management is volume based – not partition, container or folder based (see Virutal Filesystems);
  4. Snapshots: No snapshots from WebGUI (can automate with a root script);
  5. No thin provisioning support;
  6. No iSCSI support for CHAP authentication from WebGUI (IP ACL’s only);
  7. Relatively short list of support file systems;

That said, FreeNAS works and is easy to setup and works “out of the box” with VMware ESX 3i (ESXi). The online help forum is robust and content rich and the FreeBSD is both knowledgeable and helpful. If you’re looking for a simple NAS solution without clustering or fail-over and your are already familiar with UFS filesystem management, FreeNAS will be a good fit. Likewise, if you just need a way to export a storage volume(s) in a simple and reliable way (ie. SOHO application), you might consider FreeNAS for your short list along with OpenFiler.

Summary

Given it’s lack of enterprise features (promised in upcoming version 0.7) it’s a “pass” for our Eco-System approach unless it is used as a tier-2+ storage provider. Given its simplicity, FreeBSD’s long history of reliability and security, perhaps several FreeNAS iSCSI target’s managed by an enterprise featured head-end (i.e. Nexenta) could offer an interesting combination.

11 comments

  1. For some reason SNMP does not appear to be working. NMAP shows no open port on 161. I see that it is indeed running when I check the process list. The firewall is disabled as well.

    I hope they fix this in the next release.


  2. SNMP works in my test lab. Be careful, FreeNAS requires an “enable” even though you have properly configured the system. Once “enabled” you should be able to SNMP-walk the MIB list:

    snmpwalk -c public -v 1 freenas_IP

    Cheers!


  3. I found out SNMP doesn’t bind to the correct IP when DHCP is enabled. I changed the Ethernet interface to a static IP and all is well now.

    https://apps.sourceforge.net/phpbb/freenas/viewtopic.php?f=57&t=1001&sid=170c2044d5d2274ad41a9338f87915f8&p=4536#p4536


  4. Thanks to Alan Grow who, after 12,000 views of this article, noticed a syntax error in the gzip extraction process which read:

    gzip -c /FreeNAS-amd64-embedded-xxx.img | dd of=/dev/sdi

    He properly points out that it should be either:

    gunzip -c /FreeNAS-amd64-embedded-xxx.img | dd of=/dev/sdi

    or

    gzip -d -c /FreeNAS-amd64-embedded-xxx.img | dd of=/dev/sdi

    Thanks Alan! You’re one in 12,000 ;-)


  5. [...] converter. Turns out a lot of people are using the same setup as me, ESX/ESXi & FreeNAS. From here I figured out how to install FreeNAS from my laptop to the CF Card without having to go through the [...]


  6. Hi, I installed perfectly fine onto a USB drive but somehow cannot login after boot. I try using “admin” and “freenas” as default but nothing works.

    Anyone know the default login and password to be used while booting the damn thing?

    Many thanks


  7. [...] run FreeNAS from the white 1GB USB thumb drive plugged into the back of the machine (here’s a guide to installing FreeNAS to a USB drive).  Once it was booted and set up on my network, I removed the keyboard, mouse, and monitor and did [...]


  8. [...] have a built in media server so as long as you're only accessing files you should be set. How To: Install on USB __________________ CS:S [...]


  9. Is there an updated version on how to setup freenas onb a flash disk for FreeNAS 8?

    Also how do I do this on a windows box to then be used on the FREENAS server we have?

    Thanks

    GW


  10. I had to make a few tweaks to run this on a mac. I wrote up a small guide and linked back to you ;)

    http://www.geekmachine.at/2011/11/install-burn-freenas-image-on-sdhc.html


  11. [...] are included in practically every Linux distribution, and “no cost” solutions -like FreeNAS – make NFS cheap and easy?” While it is true that solutions like this have been very popular [...]



Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 49 other followers

%d bloggers like this: