There are two technologies on how to centralized data access storage to heterogeneous network clients (as network storage): (1) NAS (Network-Attached Storage) and (2) SAN (Storage Area Network). In this article (written in the middle of 2006), i will dig the possibility to implement these technologies on embedded platform as a sell-able product.
About NAS and SAN
There are two approach use in data storage server:
- NAS (Network-Attached Storage) as defined in wiki and here.
NAS uses file-based protocols such as NFS or SMB/CIFS where it is clear that the storage is remote, and computers request a portion of an abstract file rather than a disk block.). A such project using this approach is FreeNAS.
- SAN (Storage Area Network)
SAN attaches remote computer storage devices such as disk array controllers, tape libraries and CD arrays to a servers in such a way that to the operating system the devices appear as locally attached devices. A such project using this approach is openfiler.
In this writing, i refer network storage to both NAS and SAN. A good reference about network storage in Bahasa, can be found at “trend-pasar-bagi-storage-area-network-12-2000.rtf” file and storage-area-network-apakah-itu-12-2000.rtf.
Who Will Need This Network Storage
To identify requirement of our system, we must ask ourself who is targetting users and define what actually they need and what for
The typical applications of network storage are:
- Store multimedia (audio, video, image) files and give interface to user to play them in streaming (multimedia storage system). Combined with client (embedded board) playing GeeXboX will become a complete Home Theater System
- Digital library system (references, journal, paper, e-books)
- Document archiver system (*.doc, *.xls) to be used in thinclient-based system
- Backup storage system. NasBackup (http://www.nasbackup.com) and Unison client are the opensource backup client under windows. It is a high-performance, enterprise-grade system for backing up MS Windows desktop PCs, laptops and servers to network disks
- SQL database storage system. This will have wide range implementation.
- Presentation server (this system will serve control request from networked client that need to display his
presentation. although it’s out of network storage intention, but i think it can be built using this technology)
- Internet cache storage for proxy server
- Distro repository
- Asterisk IP-PBX system, with sounds, music-on-hold and voicemail files are in shared mode, can be accessed from network with authentication
How to Compete with Existing Products
There are network storage products currently, such as Linksys NSLU2 Network Storage Link USB2. It’s fairly cheap in price about US$101 for quantity 1. So, how our product will compete with that such cheap products?
- Collect all user requirements around the use of this storage technology for example
- database system integration
- Application oriented storage. It’s the way to battle with the mass products
- Build own customized hardware. Refer to this products used in openwrt.
Install for The First Time
- Download FreeNAS iso from here and burn the image to CD
- Boot PC x86 from CD
- Set appropriate setting, including the IP number
- Point your browser to that IP number: http://_ip_number_/ , and enter admin as the username and freenas as the password
- If you want to install FreeNAS to CF or harddisk select the installation menu
The services provided by FreeNAS listed here:
- CIFS (Samba)
CIFS is the protocol used under Microsoft Environment. It’s this protocol that is used when you
select ‘Network neighborhood’ under Windows.
File Transfer Protocol is used to connect two computers over an IP network so that the user of one computer can transfer files and perform file commands on the other computer.
NFS is the CIFS equivalent for UNIX/Linux World. If you have a Linux machine that needs access to FreeNAS, it’s the protocol to be used.
RSYNC is a multi-platform incremental copy over network utility that can be used for backup. If you want to backup some of your files regularly, it’s the protocol to use: The incremental sync process permits a copy of the differences in the files across the link, from the last backup. RSYNCD setting mode are as Server, Client and/or Local synchronization.
SSH (Secure Shell) permits an alternate and highly secure form of FTP access to the FreeNAS storage. SSH is enabled via the Services/SSHD page. It will permit the use of:
- SFTP file transfer
- SCP File transfer
- SSH access and remote commands execution
Unison is a multi-platform file-synchronization tool. Unison can synchronize changes to files and directories in both directions simultaneous, there is no ‘source’ and ‘destination’ and at the end of the process both sides should be in the same state.
AFP permits Apple MacOSX users to access the storage resources of FreeNAS.
- iSCSI Target (since 0.685b version)
You must have a minimum of 256MB of RAM for using iSCSI-target.
- Dynamic DNS (since 0.685b version)
UPnP enables the UPnP file server (Works great with the media player GeeXboX for example)
Upgrade FreeNAS to 0.685b-nb20070510
In FreeNAS-0.684b, i found a bug in NFS service when configure it
using webGUI configuration. It doesn’t provide (+) sign to add Authorization network, so it will complain with error. Oliver suggest me to use FreeNAS nighty build version with fixed such bug.
FreeNAS upgrading can be done via the Firmware Update page in webGUI configuration. It needs an .IMG file to be used for upgrading.
In this case, i will just reinstall the FreeNAS with newer version from CD. Burn the .ISO file to CD and install them to Compact Flash.
Running FreeNAS on eBox-2300
After reinstall newest FreeNAS (0.685b-nb20070510) on Compact Flash 256 MB, i tried to run it on eBox-2300. eBox-2300 runs on 200 Mhz Vortex86 System-On-Chip. eBox-2300 specifications and user manual are here and here respectively.
Setting FreeNAS for the First Time
The first setting to be done is mainly to set the IP address.
- Connect VGA port to monitor, just to see FreeNAS menu option
- Select 2, to set IP address. In this case, I set this to 192.168.78.226/24 that reachable from our network
- Using other PC client, point the browser to this address: http://192.168.78.226. Enter admin as username and freenas as password. Here is the snapshot.
Configuring Hard Drive
This tells you how to add storage device(s), format and mount the disk(s).
I inserted 128 MB USB flashdisk to be used as the storage. FreeNAS will automatically run hotplug to detect this type of device, as seen at Diagnostics->Logs:System. It’s detected as da0 device.
Add Disk by selecting Disks->Management and click the (+) sign to add the disk to the disk list need for network storage as shown at the right figure
Select detected USB disk (i.e da0) and set the disk parameter. I select ‘FAT32‘ in Preformat FS dropdown menu (it’s an information field that don’t impact the comportment of FreeNAS). Click add button and then apply button to save the disk setting. You should have disk list as shown at the attached figure. We can then use this disk as our network storage.
If you want to format the disk, select Disks->Format menu. I myself need this disk formatted. I selected UFS (FreeBSD native file format) as the File system format, instead of FAT32, as recommended in FreeNAS user guide. Disk initialization log detail will appears.
To use it, we must mount it. Select Disk->Mount Point, click on the (+) sign. I’m using USB128M as Share Name and left the others as default. Then click Apply changes button to take effect of the changes.
Use the Services
To be able to access the NAS shares, we must enable services on the freeNAS server over which we can connect to the shares. Users then can access the shares using his preferred service, either from windows or from Linux, by using smb, neighborhood, ftp or any else way that supported by FreeNAS. All accessed data is unity, that means they don’t depend on which service they come.
- To enable CIFS service, select Services->CIFS and check the enable checkbox. I just left the settings default as the following. Click Save and Restart button. We can then access (write, read and modify) the shares from Linux using SMB or from Windows explores as shown here and here.
- To enable FTP service, select Services->FTP and check the enable checkbox. I used the ftp settings as follow. I enabled anonymous and local user login (to be used if you want to create local user with Access->Users and Groups menu). Click Save and Restart button. Here is the snapshot when i accessed the share with Konquerer ftp.
- To enable SSH service to allow SFTP, SCP and SSH access and remote command execution, select Services->SSHD and check the enable checkbox. I used the sshd settings as follow. I enabled Permit root login because there is only this one user in my system (if you want to create another user instead of root user, go to Access->Users and Groups). Click Save and Restart button. The snapshot when i make ssh to that server and make transfer via SFTP are shown here and here.
SFTP will use $USERDIR as its default current directory, so if you want copy/access files on another location (mounted disks), you must change the targetted directory by yourself.
- To enable NFS service, select Services->NFS and check the enable checkbox. I just left the settings default as follow. Click Save and Restart NFS button. Error found in version 0.684b when activating this services that tells about ‘No networks declared’ has been fixed in this nighty-build version. I tried to write a file in nfs-mounted storage, as shown here.
- To enable RSYNCD service, select Services->RSYNCD, select the server type tab and then check the enable checkbox. I activated RSYNCD Server with default setting as follow. Click Save and Restart button. This is the snapshot how i synchronize local changes to the remote. I created local and remote directory named rsync. Then i make changes to the file inside rsync local directory and synchronize it to remote
- To enable Unison service, select Services->Unison. I set the Unison as follow to use USB128MB share on Flash disk device. Click Save and Restart button.
- To enable uPnP A/V Media Server service, select Services->uPnP. I add shared directory (i.e /mnt/USB128M/mmedia) that will be used to store multimedia files in the settings as follow. You must create directory manually if it didn’t exists yet. Click Save and Restart button. Notes: New added files on the share are not updated automatically. You must restart(disable/enable) this service to rebuild the new file list.
Design consideration are as follow:
- How big is the storage
Legends: [ ]:Todo, [X]:Has done, [V]: Partially done, [-]:Tried, but failed [V] Getting information about NAS and SAN [X] What is NAS and SAN [X] Get information about NAS-like and SAN-like products have been already in market, especially in Indonesia [ ] How to measure NAS and SAN performance [ ] Functionality [V] Trying freeNAS [X] Download freeNAS from here [X] Install FreeNAS-0.684b on Compact Flash [X] Run compact flash disk on embedded board EBOX [X] Update to FreeNAS-0.685b-nb20070510 [V] Explore all FreeNAS capabilities (based on services it provides) [X] CIFS (Samba) [X] FTP [X] NFS [V] RSYNCD [X] Server [ ] Client [ ] Local [X] SSHD [X] Unison [ ] Trying Unison synchronization [ ] AFP (optional, as i don’t have Apple’s) [X] UPnP for GeeXboX [ ] GeexBoX trial [ ] Development system, can be found here [X] Get all FreeNAS Documentation [X] Hardware used, can be found here [ ] Define physical storage capacity and type [ ] Trying Openfiler [ ] Download Openfiler from here [ ] Develop freeNAS [ ] High Availability [ ] Database storage [ ] Add distro repository module [ ] Implement RAID [ ] Add asterisk system [ ] Add LCD to the box [ ] Create multimedia home system [ ] Develop GeexBox [ ] Create backup solution system [ ] Using Rsyncd and NasBackup client [ ] Using Unison and its client [ ] Develop Openfiler [ ] Testing freeNAS [ ] Determine freeNAS testing objectives [ ] Testing Openfiler [ ] Determine Openfiler testing objectives
- The Free NAS Server Wiki
- Low Cost SAN Solutions
- Network Storage Link for USB 2.0 Disk Drives from Linksys
- Buffalo network-attached storage series
- Trend Pasar bagi Storage Area Network (SAN). Onno W. Purbo. It can be download from here
- Storage Area Network – apakah itu?. can be downloaded here
- Indonesian Linksys Prices and in pdf
- Network-Attached Storage with FreeNAS tutorial