Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Data Storage

Journal Journal: Ideas for a Home Grown Network Attached Storage (slashback)

Summary for this thread :
Ideas for a Home Grown Network Attached Storage?

[...]I would like to build my own NAS and am interested in hardware/software ideas. While the small form factor PC cases are attractive, my NAS will dwell in the basement so I am thinking of a cheap/roomy ATX case with lots of power.[...]

Notice: this text is a mix of several authors plus personnal updates, I thank everyone. This time I tried to credit authors from /. crowd ;-)

My conclusions are at the end along with request for comments.

from the /. crowd :

General advice

One big growable partition: Take a bunch of disks, turn them into RAID5 array. Make a logical volume (LVM on Linux) and add the RAID-array to it. Create a growable device on the LVM and format with a standard growable FS.
When you get new disks simply create a new RAID5 array and add that to the logical volume and add to your current and grow the FS on it.

You don't want everything on one big RAID0, I lost 200G of data that way. I can say I'll never do that mistake again.

FileSystem type

Common linux file systems (ext, reiser, etc) contains critical data-losing type bugs on file systems bigger than 2TB, except XFS. This was found to be the case in even the most recent 2.6 kernels.
Tony Battersby posted a patch to the LBD mailing list recently to address the ones he could find, but lacking a full audit, you probably shouldn't use any filesystem other than XFS.
Considering the gravity of these bugs, you might consider using XFS for everything, if the developers left these critical bugs in for so long, it makes you wonder about the general quality of the filesystems.

What of IBM's JFS? We run that here on our .75ish TB file server, and it's been great for us. We've not had any data corruption issues since we deployed it ~1yr ago, and it's survived a number of power outages with no problems. I'm impressed so far :)

See Tivos. If they use XFS, it's probably because it deletes even very large files instantaneously whereas most other filesystems takes longer the larger the file is. This is a clear advantage if you want to be able to delete a large movie file from disk at the same time that you want to record TV to that disk.

Summary for this thread :
Ideas for a Home Grown Network Attached Storage?

[...]I would like to build my own NAS and am interested in hardware/software ideas. While the small form factor PC cases are attractive, my NAS will dwell in the basement so I am thinking of a cheap/roomy ATX case with lots of power.[...]

Notice: this text is a mix of several authors plus personnal updates, I thank everyone. This time I tried to credit authors from /. crowd ;-)

General advice

One big growable partition: Take a bunch of disks, turn them into RAID5 array. Make a logical volume (LVM on Linux) and add the RAID-array to it. Create a growable device on the LVM and format with a standard growable FS.
When you get new disks simply create a new RAID5 array and add that to the logical volume and add to your current and grow the FS on it.

You don't want everything on one big RAID0, I lost 200G of data that way. I can say I'll never do that mistake again.

FileSystem type

Common linux file systems (ext, reiser, etc) contains critical data-losing type bugs on file systems bigger than 2TB, except XFS. This was found to be the case in even the most recent 2.6 kernels.
Tony Battersby posted a patch to the LBD mailing list recently to address the ones he could find, but lacking a full audit, you probably shouldn't use any filesystem other than XFS.
Considering the gravity of these bugs, you might consider using XFS for everything, if the developers left these critical bugs in for so long, it makes you wonder about the general quality of the filesystems.

What of IBM's JFS? We run that here on our .75ish TB file server, and it's been great for us. We've not had any data corruption issues since we deployed it ~1yr ago, and it's survived a number of power outages with no problems. I'm impressed so far :)

See Tivos. If they use XFS, it's probably because it deletes even very large files instantaneously whereas most other filesystems takes longer the larger the file is. This is a clear advantage if you want to be able to delete a large movie file from disk at the same time that you want to record TV to that disk.

Struture

There's no reason the NAS box has to have all the files in one file system. Just create multiple partitions or logical volumes. You export directory trees across the network on NAS, not file systems.

Exporting shares

I feel strange advocating a MS-originated protocol -- but the truth us, serving files via Samba on Linux is going to be the best-performing[1], most-compatible remote file system available. [1] Samba beats the MS implementations of SMB/CIFS. No guarantees about Samba vs NFS, GFS, Coda, whatever. Structure

There's no reason the NAS box has to have all the files in one file system. Just create multiple partitions or logical volumes. You export directory trees across the network on NAS, not file systems.

Exporting shares

I feel strange advocating a MS-originated protocol -- but the truth us, serving files via Samba on Linux is going to be the best-performing[1], most-compatible remote file system available. [1] Samba beats the MS implementations of SMB/CIFS. No guarantees about Samba vs NFS, GFS, Coda, whatever.

RAID or not RAID

Regarding RAID, it's been my experience working at The Archive that RAID is often more trouble than it's worth, especially when it comes to data recovery. In theory, recovery is easy, you just replace a bad disk and it will rebuild the missing data, and you're good to go. In practice, though, you will often not notice that one of your disks are borked until two disks or borked (or however many it takes for your RAID system to stop working), and then you have a major pain in the ass on your hands. At least with one filesystem per disk, you can attempt to save the filesystem by dd'ing the entire raw partition contents onto a different physical drive of same make + model, skipping bad sectors, and then running fsck on the good drive. But if you have one whopping huge 2.4TB filesystem, then you can't do that trick without a second 2.4TB device to dd it all onto, and even if you have that, it's probably going to be copied over the network, which makes an already slow process slower .. if you can stomach it, you might just want to make one filesystem per hard drive and NFS (or Samba, or whatever) export each of your six filesystems separately.

On the contrary:

Saying so about RAID is insane.
See mdadm/mdmonitor to get a mail as soon as there is a failure .
Personally I would recommend setting up nagios or some other software monitoring. Everytime something goes wrong on a machine, we write a script to monitor that. Now, very few things go wrong unnoticed.
I'd really much prefer that to not having a RAID array. We've used that system (*knock*,*knock*,*knock*), for 4 years, and with about 5TB of filesystems at work, we've never ever lost a RAID'ed filesystem. We have lost several, incredibly important filesystems that weren't RAID'ed.
If you have spare drives arround, you can configure mdadm to automatically add them into the system. Unlike the standard md tools, you can have one spare for any number of md arrays.

Beware of some misleading "advice": "RAID 5 is about as fast as RAID-0 on reads..." ok but "...the bottleneck on writes is the parity calculation, not access time for the drives." is false:
Even the paltry 366Mhz Celeron in my fileserver can perform parity calculations at nearly 1GB/sec. The bottleneck with RAID5 most certainly *is* the physical disk accesses (assuming any remotely modern hardware)
I would suggest using a motherboard with multiple PCI buses. Basically, look for something that's got two (or more) 64 bit PCI-X slots, as these boards nearly always have multiple PCI buses.
Also putting multiple IDE drives on a channel will destroy performance.
Using RAID50 instead of RAID5 is pointless.
Just buy yourself some four port IDE controllers, put one drive each port and use Linux's software RAID to create two four-disk RAID5 devices (or one 8-disk device if you prefer). Then put LVM over the top to make the space more manageable. If you've got the hardware resources, make sure each disk controller is on its own PCI bus, or at the very least sharing it with something inconsequential (like the USB controller or the video card)

External USB / FireWire enclosures

The state of external enclosures, USB chipsets and firewire chipsets is a sad thing.
I had to go through 3 different USB chipsets (different motherboards) before my external enclosure would write data without random corruption.
Firewire's no better, either. I had an Adaptec firewire card (Texas Instruments chipset, I believe) and it worked with my external drives, yet after 5 or 10 minutes, would randomly drop the drive and corrupt data.

Testimonial

I did this a while back. (3+ years, so it's obviousely not 1TB).
My fileserver runs 24/7 and has been doing that for about 3 years (minus downtime for moving).
I use 4 40GB SCSI drives in RAID 5 configuration, using Linux software RAID.(Obviousely I would have used large IDE now, but these were the cheapest per GB at the time, and I already had the SCSI controller laying around)
This gives me about 136GB of useable space. PArtition is running ext3 as filesystem. The CPU is a Pentium II 450 and it has 256MB of RAM. Is running on a Tyan dual mobo with builtin 10/100 and SCSI.
The server is running an older RedHat release with no GUI, upgraded to Kernel 2.6.8.1.
The RAID is shared on the network using Samba.
Read performance is decent, getting around 5-7MBytes/sec read speed which is pretty good on a 100Mbit link. Write speed is slower, around 3-5MB/s

Misc

When you're dealing with that much storage, you really need to catagorize your files into what needs to be backed up and what doesn't.
If you use Linux, LVM will become your new best friend. Think of: noise and power use, heat and airflow

Don't forget to enable S.M.A.R.T. drive monitoring
I do a lot of software raids and with smartctl, no drive crash has ever surprised me. i always had the time to get a spare disc and replace it on the array before something unfunny happened.
do a smartctl -t short /dev/hda every week and a -t long every month or so ...
read the online page of it: http://smartmontools.sourceforge.net/
Software raid works perfect on linux... and combined with LVM the things gets even better
A number of people also recommended MDADM [freshmeat.net] for building and maintaining software RAID systems on Linux.

This won't be best solution noise-wise, but this would extend the drive lifetime. Cut extra holes to the case and build air-flow tunnel to help cooling the drives. I measured drop from 46C to 25C with 12cm nexus low speed fan.

Some small commercial solutions

Device for Samba sharing a USB drive 100$
Need to add: USB drive or drive + USB adapter, up to 8.

Rebyte 150$
A simple flash Linux distro with a converter board that plugs in to an IDE slot. Supports all the standard raid setups. I recommend investing in cooling for hard drives -- not things you want to have fail on a NAS system.

Credits:

Hast zoeith GigsVT HoneyBunchesOfGoats sarahemm booch richie2000 -dsr- Keruo TTK Ciar ComputerSlicer23 drsmithy delus10n0 tchuladdiass Winter beegle

*** advid.net Conclusion ***

Some small commercial solutions are worth to look at -for the lazy/hurried, but a real DIY setup would be:

ATX PC tower with linux 2.6 distro and the kind of disks you can aford (ATA,SATA,SCSI), low or medium RAM and CPU are enougth, and a 10/100 NIC of course. Better perf with one drive per chanel
#1 Use software RAID5 (raidtools2 or mdadm) and LVM.
#2 One or more logical volume.
#3 A growable filesystem (XFS (lnk2), JFS (lnk2), ext3, ext2
#4 A reliable filesystem (XFS, JFS, stable ext3 ? or good old ext2 ?)
#5 Export shares with Samba.
The box: since NAS could be outside the rooms you live, add extra holes and fans to keep the disks cool. Power: UPS here of course.

Please can you comment about:

#1 Some pointed out that raid could be worse than no RAID but simple copies from one disk to another, I'm thinking of rsyncing locally or even to some other host on LAN when reachable. What do you think ?

#2 Different logical volume for different kind of files (size, lots of writes or mainly reads, backup needs). Thus we would choose the FS and tune it differently on each volume. From backup point of vue it could be simpler and smarter: think of a small FS with your most precious files (your work), it could be handled in a 1st class way (replicas,multi backup everywhere,...). What do you think ?

#3 & #4 Some more feedback for XFS, JFS, ext3, ext2 on kernel 2.6 ?

Edit 1.1:

I think ZFS from Sun is the best FS for this purpose, too bad it can't be on Linux... yet.

Rev 1.1

Hardware Hacking

Journal Journal: Running a Server at Freezing Temperatures (slashback)

Summary of this thread:
Running a Server at Freezing Temperatures
As a part of a backup solution, I'm thinking of running a backup server in my unheated, unattached garage [...] the temperatures very often drop below zero degrees Celsius.

Notice: this text is a mix of several authors plus personnal updates, I thank everyone

Hard drive

Lubricants become more viscous at low temps:
if it got really cold, the lubricants in the drive spindle could actually become solid, freezing the bearings and burning out the motor.
Tell your PC to never turn off hard disks, never turn off fans. (might freeze if they stop, and not start again).

Thermal expansion of the platters:
Hard drive platters go through a normal amount of expansion because solids expand when heated and contract when cooled. Drive controllers are designed to recalibrate occasionally to check for expansion, to insure the heads are positioned correctly, off-track positioning leads to errors. But I seriously doubt the calibration would work outside the range of temps designed into the controller.

Case

Make sure your case is hardened. Every little critter, including mice, will want to live in the warm case. We had a computer in an astronomical observatory dome and mice built their nest on the CPU. The acid in urine from the mice destroyed the motherboard.

Get a case with a thermostatically-controlled main fan (not CPU fan, main fan). Put this in a 5-sided wooden box (hardened against critters, screened on the bottom) and insulate it with construction foam (inside) on four sides and the top. Half-inch foam will probably do. Vent the system fan out the bottom.
What this will do is create a "bubble" of warm air inside the box that is vented when the fan is running and stable when it is off. This will keep your box temperature roughly even. If you are concerned about cold-starting hard disks after a period of off-time, make sure you have a power supply which remains off after a power loss and add a 100 W light bulb inside the box. When you want to power the system back on, switch the bulb on and leave it for an hour or two before you hit the power button, then turn the bulb off again. Do not bring cold hardware into a warm, humid house to warm up - you will get condensation.

Take the floppy out of the machine, and replace the hole in the front with a blank panel. It might be a good idea to do that with the CD/DVD drives as well. Make sure that the back of the case is all sealed up, (ie, no open holes for old PCI devices you no longer have). Lastly, Don't put anything over or close to it. Your going to need it to be able to suck in air, and evacuate the air with the fans.

Misc

Some positive feedback for running such a server at 5C without any problem.
Mind the capacitors min temp specs.

Software

Journal Journal: Software Survival Kit (slashback)

Summary of this thread:
What Would You Put Into A Software Survival Kit?
Plus personal updates

Systems

  • Win98SE
  • Your prefered Linux Distro
  • WinNT4
  • WinXP

Bootable media

  • TOMSRTBT
  • Win98SE Boot Disks
  • Ghost bootable floppies set
  • Knoppix
  • QNX Demo, both modem & lan Disks
  • DOS 6.22 disks
  • any Linux rescue disk/CD

System Tools

  • Partition Magic
  • Norton Ghost
  • The new FDisk for large partitions
  • LapLink, FastLynx http://www.sewelld.com/FastLynx.asp FastLynx has the advantage that it can transfer files between XP and say DOS or Linux, over Serial, Parallel, or USB
  • Delpart.exe
  • McAfee Virus Scan, command line version
  • Antivirus. http://www.free-av.com, F-Prot http://f-prot.com
  • Norton Utilities
  • Hard disk checking utilities (from Maxtor, Seagate, etc) PowerMax http://www.maxtor.com/en/support/downloads/powermax.htm , SeaDiag, HDDiag, WD Lifeguard
  • Memtest86, http://www.memtest86.com/
  • DosDiag - for checking your hardware; http://www.5star-shareware.com/Utilities/Diagnosti cs/bcm-diagnostics.html
  • Favorite tools from Sysinternal/Winternals: FileMon,RegMon,PsTools, ... ERD, NTFS DOS Pro
  • BPR, disk & partition recovery, http://www.data-recovery-software.com/
  • Offline NT Password & Reg Editor, http://home.eunet.no/~pnordahl/ntpasswd/
  • F.I.R.E. (Forensic Incident Response Environment) Linux + security tools, http://fire.dmzs.com/?section=faq
  • ? SpinRite http://grc.com/spinrite.htm
  • ? Lavasoft Adaware

User Tools

  • Undelete. A good and free version can be found at http://home.arcor.de/christian_grau/rescue/
  • ZIP, RAR, ACE. Bzip2 and gzip for DOS or Win32
  • UltraEdit
  • ? XTGold 2.0 or 2.5 - runs on DOS
  • ? XTree Ztree www.ztree.com

Misc Apps & Files

  • Acrobat Reader, Quick Time, Flash/ShockWave
  • Nero Burning Rom
  • misc drivers for personal hardware and common nomad devices
  • MS Service Packs (OS/Office)
  • Standalone Web Browser ( OffByOne, others ... )
  • PowerDVD, PaintShopPro
  • Microsofts free Word and Excel viewers

HardWare related to OS installation

  • Blank Diskettes
  • Screwdrivers
  • Spare screws
  • Spare IDE cable
  • Spare jumpers
  • Spare IDE drive or external drive
  • RJ45 cross over CAT-5 cable
  • Laplink Cable
  • RS 232 cross over serial cable

Links

  • List of rescue disks: http://plug.twuug.org/articles/rescuedisk.html

Slashdot Top Deals

You knew the job was dangerous when you took it, Fred. -- Superchicken

Working...