Skip to end of metadata
Go to start of metadata

A little bit about my experience building up a NAS system for home use.

The Plan

The Plan: Build a Network Attached Storage system for a home network for storing iTunes data (windows and Mac), and general archiving.

Nice to have: 

  • DHCP server / Local DNS / DNS Cache.
  • Time Machine Backup.

Hardware

The Jetway mini-ITX system for my home NAS project has the following components:

The 4 HDDs will be used as storage, and the smaller SSD will be used for booting the OS.

Building it up

The case is pretty simple, not a lot to connect. The motherboard is also simple since the CPU is pre-installed.

  1. Unscrew and remove the top panel.
  2. Unscrew and remove the disk tray.
    • It took a little bit of force to get the disk tray unstuck. I guess the padding on the rails that it hangs on had adhered to the metal.
  3. Unscrew and remove the power supply. It blocks access to space where the motherboard goes.
  4. Unpack the motherboard, install the RAM sticks. The CPU is already installed, so nothing to do there.
  5. Install the back panel.
    • Place the motherboard into the case, align with the back panel.
    • Bend up the tabs covering the NIC ports.
  6. Install the motherboard.
    • Align the motherboard correctly on the back panel.
    • Install it with the screws provided with the case.

... TODO: POST test, disk tray install ...

Installing an OS

I decided to try Fedora 14 first, as I have some experience with Fedora.

Create a Bootable Live USB

Since the system doesn't have a CD/DVD drive, I have to use a USB stick to install the OS.

See Fedora - Making a Live USB

Boot the Live USB

  1. Insert the USB drive into the target system (the Jetway mini-ITX in my case).
  2. Reboot the system, press F11 (to boot select)
  3. Select 'USB' as the boot device
  4. Wait for Fedora to boot up from the USB device (may take a while)
  5. Click Login, admire fancy Fedora 14 desktop artwork. (smile)
  6. Click on the Install to Hard Diskicon on the desktop.
    • I chose to install to the SSD, wiping out anything else.
  7. Restart the system, booting from the SSD. Answer the remaining questions.

After updating, about 2.5G was used on the SSD. Not bad considering it has a full GNome GUI and lots of stuff.

Set up some basics

  1. <ctrl-alt-F2> to get a console window, log in as root.
  2. Give users in the wheelgroup sudo privileges:

    • Un-comment this line

  3. Put my own user account into the wheel group:

  4. Configure sshdto start on boot:

  5. Start sshd:

After that, I can do everything from my regular workstation via ssh.

  • Install vim, wget, yum-utils, rpmreaper:

Static IP

Since I am going to want to use this machine as a server, possibly a DHCP / DNS server, it should be set up with a static ip.

See Static IP configuration for Linux

Marvell SATA RAID Controller

See Marvell SATA RAID Controller - Linux Not Happy

In the end I went with a Promise PCI SATA card. Fedora recognized it right away, all the hard drives showed up appropriately:

Yay! Five drives, two partitions on the first drive.

Installing ZFS

One of the best things about ZFS is it has a really easy to configure software RAID. Also it has RAIDZ, which is like RAID6 (and supposedly a little better). Since ZFS has open source license conflicts with the Linux kernel the easiest installation is zfs-fuse, which adds some overhead due to the 'fuse' layer. Since this system is for home use the overhead of fuse isn't going to be noticeable, so zfs-fuse it is!

See Installing zfs-fuse

Testing zfs-fuse

Make sure that the mount point directory does not exist in the filesystem before creating the ZFS mountpoint! If you create the mount point directory in the normal filesystem then zfs will fail to mount the pool when the system boots.

In this example, the mountpoint is /mnt/testzfs. The /mnt directory is already there, but don't create /mnt/testzfs because zfs-fuse will want to do that.

This example makes a RAIDZ pool called testpool using the four HDDs connected to the Promise IDE SATA card (sdb, sdc, sdd, sde), and mounts them on /mnt/testzfs:

iozone can be used to compare the performance of the SSD/ext4 filesystem with the zfs-fuse/HDD filesystem. First, we need to install it:

This will install iozone in /opt/iozone. Running this benchmark in the home directory will give us some idea of the performance of the SSD/ext4 filesystem:

Setting up ZFS for NAS Storage

See Setting up ZFS for NAS Storage

 

DHCP and DNS

Installing and Setting up a DHCP Server

See:

Installing and Setting up a DNS Server

See DNS Server Setup

SAMBA

See SAMBA Server Setup

NFS

See NFS Server Setup

Clients

Mac OSX

Automatically mount SAMBA drives

To automatically mount SAMBA drives on login:

  1. System Preferences->Accounts
  2. Select a user (usually the current user)
  3. Click Login Items, then '+'
  4. Click on the server and the share you want to have mounted on login.

See http://support.apple.com/kb/HT4011

Using SAMBA Drives for Mac OS Time Machine Backups

See SAMBA Time Machine Backup