Tuesday, March 13, 2007

A file server for home (Part 1)

In this first part of "A file server for home" I will cover my situation and how I decided that I need a file server. In a follow-on "part 2" I will get into the actual implementation. I am the type of person who fixes their computer when it is not broken - For me it is all about learning about the computer: how it works, how it can work better, and what else I can make it do. Re-installing the operating system, upgrading, testing any interesting sounding programs that I chance upon on the internet, it is all part of the game. All of this means that my data is at constant risk. I could make a mistake when I re-partition a disk, or a misbehaving piece of software could cause havoc with my data. To make matters worse, all of my data is at risk of failure of an actual disk drive! And I often enough get my computer into a state where it is unable to boot for a few days - this instance being a good example. Now you must understand that the content of my hard drives represent many years' worth of collecting shareware, downloading documents, Linux install disk images, recording logs of my online activities, stored email archives, my digital photos and much more. Replacing this would be all but impossible! The only answer is to take the data out of my computer and save it externally. The first question you may ask is why don't I just make backups? Oh I do.... It is just that I fall behind in keeping my DVD-R based backups up to date, and in any case, CDR and DVD-based backups have been known to be fallible. Each disk that I do make contains a little bit of everything, some photos, some documents, some shareware and what not else, which makes organizing the collection of backup disks another nightmare. What is more, to take a single full backup will take a stack of about 160 disks. So basically taking backups to DVD is just simply not a viable option. A very simple alternative option would be to just get a Home NAS device, but I have discarded the idea as too expensive, too inflexible, and too limiting. There is an alternative which will better meet my needs: A dedicated file server. Actually the word "dedicated" needs to be qualified, as you will see soon enough. Building a file server PC provides me with the following benefits:
  1. I can build a DVD or tape drive into the file server to take backups directly without going via the network for the times when I need to dump some files onto a removable media. This can not be done with NAS devices.
  2. I can add many disk drives to a PC - my current motherboard supports 12 drives without the use of S-ATA port multipliers or even USB-based drives, and additional S-ATA controllers and/or port multipliers can be added for even more disk drives. Very few NAS devices actually support more than two drives or even allow you to extend a raid array.
  3. Existing NAS devices share the data via SMB only. Being a Unix and Linux user I want to have directories shared via NFS and possibly other protocols in the future.
  4. I could install and run programs on a file server, for example to make the machine act as a streaming media server. Granted, some NAS devices already includes this functionality, but you're limited to whatever functions it comes with - you don't have the freedom to replace the software with something of your own.
  5. A PC file server can potentially do other non-file server things, such as being a print server, Scan server, Web server, Mail server, Folding-at-home station, and of particular interest to me, a web proxy and DNS-caching server.
  6. A PC file server can have multiple network ports for better connectivity; it could even have a WiFi port.
  7. NAS devices do not commonly provide RAID-5 disk protection. A PC would support any level of RAID and hot-spare drives to boot. RAID-5 in software is often criticized as being "CPU-heavy", but in an idle file server I'd just be happy to give that processor something to do! Mirroring is too expensive for my "home-user" size budget.
  8. Many NAS devices don't support power-save or sleep modes for the drives. I believe that it is important to turn the drives off to extend the life-time of the drives, particularly in an always-on server.
Essentially one of the advantages of a dedicated file server is that it does not need to be dedicated, it can do other things besides! One must of course also consider what you lose when you go for a computer acting as a file server rather than a nicely build NAS appliance:
  1. To some the physical appearance of an appliance is appealing, but in my case the server will sit tucked away in the corner under a desk, so I do not consider this important.
  2. NAS devices usually have some form of online disk replacement and array re-building, but I can afford the downtime to replace drives and while doing maintenance.
  3. A NAS device is simple and probably fairly stable - you just press the button and voila ... it is running, while with a server you have some instability and, due to the added complexity, more chance for things to go wrong or stop working. Being the hacker that I am, this is possibly a good thing rather than a bad thing, but don't tell my wife.
  4. And finally, some may consider the portability of a NAS device an advantage.
There is one other important consideration, at least to me. With a PC based file server I would be able to log in on the server and do file maintenance directly on the server. To re-organize the directory structure and layout with a NAS device would require me to copy the files back-and-forth between the device and a PC. In particular, moving files from one disk or partition to another will often require the files to be passed via the network twice. This would be slow and in practice it would probably cause me to not actually get around to sorting my data (which is currently in a very sad state of disorganization). With a server I would be able to log on into the server and then perform this organization directly on, and internally to, the server. This is important because I am more likely to actually do the data organization when it doesn't have to pass over the network the whole time, and as a result my data will be better organized and therefore ultimately more useful! I am now in the planning stage for my file server. It will probably have around 1TB of usable disk space to start off with, made up mostly from my existing hard drives. But I will talk about the design and implementation in part 2 of this little series, so keep watching this space! (In other words, add it to your RSS feed aggregator)

1 comment:

Hendrik said...

Why (in Solaris's name) not using raidZ instead of RAID5? with ZFS it should be *much*much* more resilient than RAID5???

/me wanted it at home... until he found that (Open)Solaris still can't support an Asus A7V mobo's Promise PDC20265 since there are a year old outstanding bug related to PCI bridges and stuff :(