Sunday, August 17, 2014

home NAS/TV PC

Idea

For about ten years, I used a variety of  huge cases to build my own NAS boxes, based on LVM and Linux software RAID 5.  I've used ZFS on a HP MicroServer since 2011 and have been very happy with its reliability and performance, on the few occasions I've needed anything above a few MB/s.  In order to use iTunes, Netflix, blinkbox, NOW TV and the catch-up TV services, I also need a Windows box connected to my TV and amplifier.  I've been using a tired old Dell Vostro with Windows Vista, which took up too much space, was slow and was noisy while playing HD video.

My idea was to run Windows on an a new MicroServer and run FreeNAS within a VM.  I don't need more than a few MB/s for downloading or playing video, so I wasn't concerned about the performance loss of running FreeNAS in a VM.

Kit


  • 1 x HP ProLiant MicroServer G7 N54L (AMD Turion™ II 2.2GHz & 4GB RAM)
  • 1 x Intel 40GB 320 Series SSD
  • 4 x WD RED 4TB SATA HDDs
  • 1 x Asus ATI Radeon HD 5450 video card
  • 1 x Asus Xonar DGX sound card
  • 1 x SATA DVD drive
  • 1 x Molex to two SATA power cable
  • 1 x eSATA to SATA cable
  • 1 x SATA to SATA cable

Installation

I wanted to use all of the space on the HDDs for RAID-Z, so I needed another disk for the Windows installation.  I connected the SSD to the SATA port that's intended for a DVD drive and stuck it in the space between the HDD and DVD drive bays.  In order to use the DVD drive and SSD, I had to run a cable from the eSATA port on the back of the case to the internal DVD drive and make use of the Molex to two SATA power cable.

Windows 7 installed without any issues and seems to boot and run quickly even with VMware taking 1GB of the RAM for my FreeNAS VM.  The video and sound card drivers installed easily, so I was ready to go after installing few hundred Windows updates.  I am using VMware Player to present the physical disks to the VM directly and was using the FreeNAS VMDK as a file on the Windows SSD.  

Issues

I had (for no good reason) assumed that the low profile video card would have come with both regular and low profile brackets, so had to call on the services of my dad to cut some holes into one of the blank brackets that came with the server.

Having said that I didn't regularly need much disk performance, one point where it became important, was for the initial copy of data from my previous NAS.  Waiting for my 4TB of data to copy in via the VM would have taken more than a week, so I re-installed FreeNAS onto an old USB flash drive using the internal port on the MicroServer.  This allows me to use the same system within the VM or natively, when speed is more important than video playback and the GUI.

VMware doesn't seem to support booting from USB storage devices and the MicroServer doesn't have a boot device menu, so I used the Plop boot manager in both cases.  Plop can call the boot loader from a USB storage device, and can be started from VMware using a small ISO or from the Windows boot loader, so works great for me!

Results

I now have one fast and quiet box in place of the two that I previously needed for the same functionality.  I've yet to try any games or see how the box would deal with 1080p video, as my TV only supports 720p.

Tuesday, March 9, 2010

Fishworks gets de-duplication

Sun's 7000 series storage products (known as Fishworks) are about to be updated with improved replication (much needed in our case) and de-duplication.

Thursday, February 25, 2010

OpenSolaris 2010.03 + rsync == backup perfection?

The release of OpenSolaris 2010.03 is going to add ZFS de-duplication to the already extensive list of ZFS features. De-duplication and the ZFS implementation are expertly explained on Jeff Bonwick's Blog. ZFS already sports a great double parity RAID implementation (known as RAID-Z2), excellent snapshot support, end-to-end checksumming, transparent compression and variable block sizes. The combination of theses features already make Solaris 10 and OpenSolaris great for backup servers, but the addition of de-duplication is going to make Sun's offerings unbeatable for this task.

With de-duplication, variable block sizes and compression saving your disk space, snapshots giving your backups history and the checksums giving you confidence in your backups' integrity, the only task left, is to get some data onto your backup server. Anyone who has ever used `rsync`, will tell you that it's the best tool for this job and, whilst I wholeheartedly agree, I am also interested to try out ZFS' replication. This allows you to transfer a snapshot (think incremental backup) or a whole file system (full backup) to a remote system using nothing more than `zfs`, a few pipes and `ssh`.

Saturday, June 6, 2009

Debian installer on Xen post-install

Here are a few things that I like to do to a Xen domU that's been installed by the Debian lenny installer:

# for foo in hooks scripts/init-premount; do 
bar=/usr/share/initramfs-tools;
mkdir -p $bar/disabled/$foo;
dpkg-divert --divert $bar/disabled/$foo/thermal --rename $bar/$foo/thermal;
done
# update-initramfs -tu
# update-rc.d -f hwclock.sh remove
# update-rc.d -f hwclockfirst.sh remove
#


The first couple of 'lines' disable the loading of thermal modules from the initial RAM disk. The last two lines disable reading from and wiring to the hardware clock (as it doesn't exist in the domU).

The following lines are mostly for me. I like to have 'xvda1' and 'xvda2' mapped to separate logical volumes on the dom0 and this makes Debian's grub implementation grumpy. It's worth doing, so that you can resize these logical volumes without messing with the partition table that would otherwise have been created on 'xvda'.

# sed -i /grub/d /etc/kernel-img.conf
# perl -pi -e 's#/boot(/[^-]+)-\S+(\s|$)#$1$2#' /boot/grub/menu.lst
#


The first line stops the Debian kernel packages' post installation scripts from running 'update-grub', which fails when no '/dev/xvda' exists. This does, however, mean that the grub menu will not be updated when a new kernel is installed. The second line mitigates this by updating the menu file to use the links in '/', rather than the specific paths to the files in '/boot/'. This should allow pygrub to boot new kernels as they are installed, even though the grub menu will not be updated.

Wednesday, February 18, 2009

Linux to Solaris

For some time I've been interested in Solaris (particularly OpenSolaris) but I've never had the time or interest to take my explorations beyond installing the system and doing basic SysAdmin tasks. While reading some comments on an interesting blog post about 'The Enterprise Linux problem', I saw the following link:

http://opensolaris.org/os/community/advocacy/immigrants/

It provides links to some great posts that will help experienced SysAdmins get used to Solaris.

Thursday, February 5, 2009

Comparison of console management techn{iques,ology}

Here's a great bit of work by Ian Durkacz (University of Edinburgh, School of Informatics, April 2007) which compares various methods of remotely connecting to the console of a Linux server:

http://www.dice.inf.ed.ac.uk/units/infrastructure/Projects/06-Consoles/consoleoptions.pdf

It covers KVMoIP, multi-port serial cards, serial concentrators, IPMI and Dell Remote Access Cards (DRAC) and provides rough per-server prices.

Tuesday, February 3, 2009

Pipe viewer

"Pipe viewer is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion."

http://www.catonmat.net/blog/unix-utilities-pipe-viewer/

Wednesday, January 21, 2009

Add partition devices on linux

I often end up with a Linux block device or file which contains a PC partition table. The `kpartx` utility (part of the Linux multipath-tools) can create device nodes for partitions which were not detected at boot.

# kpartx -av /dev/loop1
add map loop1p1 : 0 144522 linear /dev/loop1 63
#

Wednesday, December 10, 2008

Remove 'NO_HW' devices from `ioscan`.

When you pull a disk out of an HPUX system, `ioscan` will still show the device:
# ioscan -fnCdisk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 0 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 1 0/1/1/0.1.0 sdisk NO_HW DEVICE HP 73.4GST373454LC
/dev/dsk/c2t1d0 /dev/rdsk/c2t1d0
disk 2 0/1/1/1.2.0 sdisk NO_HW DEVICE HP 73.4GST373454LC
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0

Here's how to remove all 'NO_HW' devices from the `ioscan` output:
ioscan -fCdisk|grep NO_HW|awk '{print $3}'|xargs -i -t rmsf -H {}

Monday, October 27, 2008

Finding a PID for a listening TCP port in Solaris

From SunManagers:

On recent versions of Solaris, "pfiles" will tell you about each and every program running which file descriptor matches to what.
cd /proc
pfiles *| more