diff --git a/content/technical/2011/12/freebsd-zfs-powered-nas.html b/content/technical/2011/12/freebsd-zfs-powered-nas.html index 14f529f..8ed1b7f 100644 --- a/content/technical/2011/12/freebsd-zfs-powered-nas.html +++ b/content/technical/2011/12/freebsd-zfs-powered-nas.html @@ -1,81 +1,131 @@ -TODO: Add photos +## Summary -Recently the Time Machine drive on my Mac Pro started to randomly +Here's the tl;dr version: I sold my Mac Pro to fund building a home +NAS. The result is a HP MicroServer with 4Gb RAM and 3 × 2Tb hard +drives running FreeBSD from the system drive and a ZFS pool across the +three 2Tb drives. Total cost: AU$731.67. + +## Rationale + +Recently the Time Machine drive in my Mac Pro started to randomly disappear and Mac OS X would say that I had removed it improperly, which was not true given it was an internal drive still inside the machine. -I'd seen this behaviour before and in that case it resulted in the drive +I've seen this behaviour before and in that case it resulted in the drive being replaced due to its inability to complete a short S.M.A.R.T. scan. This drive (also a Samsung) was suffering a similar problem except that initiating the S.M.A.R.T. scan would actually cause it to disappear from the SATA bus. A check on the Samsung site showed that the drive was out of warranty so I was up for a replacement. -The Mac Pro wasn't getting used for much since I got a i7 powered Mac Book Pro. -Its main duties involved storing my iTunes library, Aperture library and -running my weather logger. It wasn't exactly a very energy efficient machine -to run all the time. It would in fact keep the study warm overnight when the -door was closed. +The Mac Pro wasn't getting used for much since I got a i7 powered Mac +Book Pro. Its main duties involved storing my iTunes library, Aperture +library and running my weather logger. It wasn't exactly a very energy +efficient machine to run all the time. It would in fact keep the study +warm overnight when the door was closed during winter. There was also a problem with replacing the failing drive: I couldn't afford to do so. So I decided to move the weather logging to my [ALIX board][alix] and sell the Mac Pro to fund building a home NAS. I was able to sell the Mac Pro very quickly on eBay for $1500 but gave myself a budget of $1000 for -the NAS. I wanted the NAS to have reliable redundant storage, which for me +the NAS. I wanted the NAS to have reliable, redundant storage, which for me meant [ZFS]. This implied the new machine would need to run one of [Solaris], -[Illumos], [FreeBSD], [FreeNAS] or [SmartOS]. The requirement to run one of +[illumos], [FreeBSD], [FreeNAS] or [SmartOS]. The requirement to run one of these OS's ruled out an off the shelf NAS appliance. -[ZFS]: TODO -[alix]: TODO -[Solaris]: TODO -[Illumos]: TODO -[FreeBSD]: TODO -[SmartOS]: TODO +[ZFS]: http://www.opensolaris.org/os/community/zfs/ +[alix]: /2011/12/openwrt-on-alix/ +[Solaris]: http://oracle.com/solaris +[illumos]: https://www.illumos.org/ +[FreeBSD]: http://www.FreeBSD.org/ +[SmartOS]: http://smartos.org/ +[FreeNAS]: https://www.illumos.org/ I did a lot of research into different ways to build the machine and tried out all the OS options in virtual machines. I considered using -basic PC hardware, MiniITX, HP MicroServer, etc. Each had its own pros -and cons. The basic PC approach was possibly the cheapest but it was the -largest. MiniITX was more expensive and choice of multi hard drive bay -cases were limited. I ended up settling on the [HP Proliant MicroServer] -running FreeBSD. +basic PC hardware, MiniITX, HP MicroServer, etc. Each had its own +pros and cons. The basic PC approach was possibly the cheapest but it +was the largest. MiniITX was more expensive and choice of multi hard +drive bay cases were limited. I ended up settling on the [HP Proliant +MicroServer][microserver] running FreeBSD. [microserver]: http://h10010.www1.hp.com/wwpc/hk/en/sm/WF06b/15351-15351-4237916-4237917-4237917-4248009-5163345.html -The MicroSever is a neat little unit. It uses a low poert dual core AMD + + +
+ +
The end result. Click/tap to toggle inside view.
+
+ +
+ +
CD for size comparison.
+
+ +
+ +
Oblique view (excuse the finger prints).
+
+ + +## The Build + +The MicroServer is a neat little unit. It uses a low power dual core AMD Turion II CPU and comes with 2Gb ECC RAM and a 250Gb HD. I has 4 non-hot swappable hard drive bays all packaged up in a squat little box. I ordered mine with an extra 2Gb or RAM as ZFS likes to have plenty of RAM available to run well. -During my reesarch hard drive prices sky rocketed due to the floods +During my research hard drive prices sky rocketed due to floods in Thailand, however I was able to get some at pre-flood prices from -[ht.com.au][ht]. They have since put the price up $40 (TODO) and placed order -limits on them, so I got in at the right time. +[ht.com.au][ht]. They have since put the price up ~$40 and placed order +limits on them. For the drives I chose 2Tb Seagate Barracuda Green's. They feature SATA 3 -and a 64Mb cache and run at the atypical 5900RPM. These drives seemed to be +and a 64Mb cache and run at an atypical 5900RPM. These drives seemed to be a good balance across energy efficiency, noise, performance and price. [ht]: http://ht.com.au/ -The final parts list ended up being the rater diminuative: +The final parts list ended up being rather diminutive: -* 1 × HP MicroServer (658553-371) + 2Gb extra RAM $336.82 -* 3 × 2Tb Seagate Barracuda Green Hard Drives $394.85 +* 1 × [HP MicroServer][microserver] (658553-371) + 2Gb extra RAM $336.82 +* 3 × [2Tb Seagate Barracuda Green Hard Drives][hard-drives] $394.85 + +[hard-drives]: http://www.ht.com.au/cart/1/part/V0531-Seagate-Barracuda-Green-ST2000DL003-hard-drive-2-TB-SATA-600/detail.hts The total cost ended up being $731.67, healthily under budget. -Installng FreeBSD and setting up the ZFS pool was very -straightforward. I'm running the drives in a RAIDZ configuration, -giving 3.6Tb of usable storage. I currently have two ZFS filsystems -on that. One in a normal configuration and the other for photos with -`copies=2` set. I plan to try out enabling ZFS deduplication on the -former filesystem soon. +
+ +
Installing the extra RAM.
+
-So the system all ran well for a few days however on the forth day one of +
+ +
Installing the hard drives.
+
+ +## Software + +Installing FreeBSD and setting up the ZFS pool was very +straightforward. I'm running the drives in a RAIDZ configuration, +giving 3.6Tb of usable storage. I currently have two ZFS file systems +on that. One in a normal configuration and the other for photos with +`copies=2` set. + +The system all ran well for a few days however on the forth day one of the brand new drives failed and started making a terrible clicking, beeping noise. Fortunately HT replaced it very promptly and the replacement has been running fine since. During the time the failed drive was out for @@ -84,3 +134,29 @@ no data loss. Once the new drive was installed it was a simple matter of issuing `zfs replace ada1` and it began the process of resilvering the data onto the new drive and all it has been running well since. + $ zpool status + pool: storage + state: ONLINE + scan: resilvered 1.07T in 9h32m with 0 errors on Tue Nov 29 07:13:29 2011 + config: + + NAME STATE READ WRITE CKSUM + storage ONLINE 0 0 0 + raidz1-0 ONLINE 0 0 0 + ada1 ONLINE 0 0 0 + ada2 ONLINE 0 0 0 + ada3 ONLINE 0 0 0 + + errors: No known data errors + +After setting up the OS and file systems the only other thing I +needed to so was make the storage available to other machines on the +network. Since my house is all Macs I built [netatalk] via the FreeBSD +ports collection to make the storage available via AFP. + +[netatalk]: http://netatalk.sourceforge.net/ + +With that done it's the sever shows up in the Finder via Bonjour and +copying/accessing data is dead simple. + diff --git a/content/technical/2011/12/freebsd-zfs-powered-nas.yaml b/content/technical/2011/12/freebsd-zfs-powered-nas.yaml index 799bea4..b00abb8 100644 --- a/content/technical/2011/12/freebsd-zfs-powered-nas.yaml +++ b/content/technical/2011/12/freebsd-zfs-powered-nas.yaml @@ -1,9 +1,9 @@ --- title: Home NAS Powered by FreeBSD and ZFS -extra: TODO +extra: Building a home NAS with a HP MicroServer running FreeBSD and ZFS. kind: article section: technical -created_at: 2011-12-08 17:57:00 +created_at: 2012-01-21 17:08:00 keywords: - zfs - freebsd diff --git a/output/images/2012/01/IMG_0097.jpg b/output/images/2012/01/IMG_0097.jpg new file mode 100644 index 0000000..8da569b Binary files /dev/null and b/output/images/2012/01/IMG_0097.jpg differ diff --git a/output/images/2012/01/IMG_0098.jpg b/output/images/2012/01/IMG_0098.jpg new file mode 100644 index 0000000..bd94b06 Binary files /dev/null and b/output/images/2012/01/IMG_0098.jpg differ diff --git a/output/images/2012/01/_MG_0581.jpg b/output/images/2012/01/_MG_0581.jpg new file mode 100644 index 0000000..fb60499 Binary files /dev/null and b/output/images/2012/01/_MG_0581.jpg differ diff --git a/output/images/2012/01/_MG_0582.jpg b/output/images/2012/01/_MG_0582.jpg new file mode 100644 index 0000000..c5b9bcd Binary files /dev/null and b/output/images/2012/01/_MG_0582.jpg differ diff --git a/output/images/2012/01/_MG_0583.jpg b/output/images/2012/01/_MG_0583.jpg new file mode 100644 index 0000000..dcb7d72 Binary files /dev/null and b/output/images/2012/01/_MG_0583.jpg differ diff --git a/output/images/2012/01/_MG_0584.jpg b/output/images/2012/01/_MG_0584.jpg new file mode 100644 index 0000000..9413a21 Binary files /dev/null and b/output/images/2012/01/_MG_0584.jpg differ