or "Roll-Your-Own" Network Attached Storage Device
Posted on October 4, 2003
Setting up the Software
Creating the Software Array
Originally was going to set up a RAID-1 configuration for the system disk. Unfortunately, because /dev/hdb shares an IDE channel with the CD-RW drive, Redhat detects /dev/hdb as having a different configuration from the other drives. The BIOS on the motherboard sees the Cylinders/Heads/Sectors of all the hard drives correctly: 19485/16/63. RedHat sees all drives EXCEPT /dev/hdb as being 19485/16/63; for /dev/hdb RedHat sees the configuration as 1255/255/63. Trying to set up a RAID-1 on two hard drives with dissimilar geometries causes filesystem corruption on both hard drives as soon as you reboot the system. Even writing a logical partition table to /dev/hdc using fdisk to change the C/H/S to match /dev/hdb does not work.
After several unsuccessful attempts, it was decided to just create a RAID-5 array using hard drives c - h and leave the system partition unmirrored. It is easy enough to back up the configuration files to a CD-RW and reload the system if the system disk fails. The real concern is having a always-on file server for the household.
There are two ways to configure the RAID-5 array: manually or using mdadm.
1. Creating the RAID-5 manually:
Array disks are /dev/hdc, /dev/hdd, /dev/hde, /dev/hdf, /dev/hdg, /dev/hdh
Edit /etc/raidtab and add:
# This stanza sets up the RAID5 config for the shared file system
raiddev /dev/md0
raid-level 5
nr-raid-disks 6
nr-spare-disks 0
persistent-superblock 1
parity-algorithm left-symmetric
chunk-size 64
device /dev/hdc
raid-disk 0
device /dev/hdd
raid-disk 1
device /dev/hde
raid-disk 2
device /dev/hdf
raid-disk 3
device /dev/hdg
raid-disk 4
device /dev/hdh
raid-disk 5
then
mkraid /dev/md0
2. Creating the RAID-5 using mdadm:
mdadm -C /dev/md0 -l raid5 -n 6 /dev/hdc /dev/hdd /dev/hde /dev/hdf/dev/hdg/dev/hdh
Wait until the array creation process finishes. Next, create a filesystem on the array:
mkreiserfs /dev/md0
Create a mount point for the filesystem
mkdir /vault
Add the following line to /etc/fstab:
/dev/md0 /vault reiserfs defaults 1 0
Then mount the filesystem:
mount /vault
Setting up the Samba share
I won't go into the details of setting up a Samba share simply because there are many resources available. A great starting point is Samba.org and, of course, the man pages that are included with Samba itself. Here is a copy of the /etc/samba/smb.conf file:
# Samba config file created using SWAT
# from Vault (127.0.0.1)
# Date: 2002/10/26 05:15:41
# Global parameters
[global]
workgroup = WORKGROUP
netbios name = VAULT
server string = Vault
encrypt passwords = Yes
local master = Yes
domain master = No
preferred master = no
os level = 0
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
unix password sync = Yes
log file = /var/log/samba/%m.log
max log size = 0
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = No
printing = lprng
[homes]
comment = Home Directories
valid users = %S
read only = No
create mask = 0664
directory mask = 0775
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[Vault]
comment = Welcome to the Vault
admin users = Administrator
path = /vault
read only = No
create mask = 0664
directory mask = 0775
browseable = Yes
Note that the parameter encrypt passwords is set to Yes because some clients on my net work run Win2K or XP. Pre-Win2K clients require that this be set to No since the older clients do not encrypt their passwords.
This system has been running for over a year with absolutely no problems. The only down-time is a system reboot when a new version of the kernel is available. My wife is happy that her files are always available and that she can backup her laptop email to a safe place. No more hunting across several systems to find our most important files and backups. Our network of systems (Dual Athlon MP running Windows 2000, Athlon XP running Windows XP Pro, two IBM RS/6000s running AIX 5.1L, Sun Ultra 10 running Solaris 9, laptop running XP Home, and an Apple iBook running OS X 10.2.6) are all sharing files with each other via the Tux Server. It's nice to have a happy home network.
![]() |
![]() |
![]() |
Quick Links
Mailing Lists:
Mini-ITX Store
Projects:
Show Random
Accordion-ITX
Aircraft Carrier
Ambulator 1
AMD Case
Ammo Box
Ammo Tux
AmmoLAN
amPC
Animal SNES
Atari 800 ITX
Attache Server
Aunt Hagar's Mini-ITX
Bantam PC
BBC ITX B
Bender PC
Biscuit Tin PC
Blue Plate
BlueBox
BMW PC
Borg Appliance
Briefcase PC
Bubbacomp
C1541 Disk Drive
C64 @ 933MHz
CardboardCube
CAUV 2008
CBM ITX-64
Coelacanth-PC
Cool Cube
Deco Box
Devilcat
DOS Head Unit
Dreamcast PC
E.T.PC
Eden VAX
EdenStation IPX
Encyclomedia
Falcon-ITX
Florian
Frame
FS-RouterSwitch
G4 Cube PC
GasCan PC
Gingerbread
Gramaphone-ITX-HD
GTA-PC
Guitar PC
Guitar Workstation
Gumball PC
Hirschmann
HTPC
HTPC2
Humidor 64
Humidor CL
Humidor II
Humidor M
Humidor PC
Humidor V
I.C.E. Unit
i64XBOX
i-EPIA
iGrill
ITX Helmet
ITX TV
ITX-Laptop
Jeannie
Jukebox ITX
KiSA 444
K'nex ITX
Leela PC
Lego 0933 PC
Legobox
Log Cabin PC
Lunchbox PC
Mac-ITX
Manga Doll
Mantle Radio
Mediabox
Mega-ITX
Micro TV
Mini Falcon
Mini Mesh Box
Mini-Cluster
Mobile-BlackBox
Moo Cow Moo
Mr OMNI
NAS4Free
NESPC
OpenELEC
Osh Kosh
Pet ITX
Pictureframe PC
Playstation 2 PC
Playstation PC
Project NFF
PSU PC
Quiet Cubid
R2D2PC
Racing The Light
RadioSphere
Restomod TV
Robotica 2003
Rundfunker
SaturnPC
S-CUBE
SEGA-ITX
SpaceCase
SpacePanel
Spartan Bluebird
Spider Case
Supra-Server
Teddybear
Telefunken 2003
TERA-ITX
The Clock
ToAsTOr
Tortoise Beetle
Tux Server
Underwood No.5
Waffle Iron PC
Windows XP Box
Wraith SE/30
XBMC-ION