Neues aus...
Since more and more data is produced, sooner or later you will want to store that data in a way that will prove the test of time. For the short term that means in a way that will survive the failure of the medium its currently residing on.
Therefore a year ago I decided to build a fileserver.
Since I did not want to spend too much money, I settled with the following components

Current technology allows me to skip on an expensive hardware raid controller with lots of disadvantages (raid write hole, proprietary on disk format, extremely difficult do replace if broken, did I mention expensive).
Instead all raid controller functionality can be done in software.
The current gold standard in File Server Operating Systems is OpenSolaris with the ZFS Filesystem so OpenSolaris it is.
Since money is a limited resource, I decided to use five disks in a raidz (roughly comparable to raid5) configuration, which means, that one disk may fail without data loss. The root disks shall be configured as mirrored.
Installation of OpenSolaris is quite forward, drop in the Live CD, start the installer, answer the few installer questions, and wait a few further minutes.
Since my network card was not supported out of the box, I had to load a driver for it at its manufacturer (yes, the manufacturer provided a Solaris driver, which is compatible to OpenSolaris.)
More Solaris drivers for network hardware can be found at Free NIC drivers for Solaris
the interactive OpenSolaris format utility tells me the device names of the harddisk:
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c4d0/pci@0,0/pci-ide@f,1/ide@0/cmdk@0,0
1. c4d1/pci@0,0/pci-ide@f,1/ide@0/cmdk@1,0
2. c8t0d0/pci@0,0/pci11ab,11ab@13/disk@0,0
3. c8t1d0/pci@0,0/pci11ab,11ab@13/disk@1,0
4. c8t2d0/pci@0,0/pci11ab,11ab@13/disk@2,0
5. c8t3d0/pci@0,0/pci11ab,11ab@13/disk@3,0
6. c8t4d0/pci@0,0/pci11ab,11ab@13/disk@4,0
Creating a raidz storagepool is extremely easy and fast:
# zpool create share raidz c8t0d0 c8t1d0 c8t2d0 c8t3d0 c8t4d0
To enable nfs on that storagepool, now mounted under /share just type
# zfs set sharenfs=on share
And that's it (-:
To enable the root mirror, go to the format utility, select the disk to be added to the mirror and, using the fdisk function, create one big Solaris partition. Then either use the partition editor to create a (at least as big as the corresponding slice on the first disk) slice for the data on that disk, or copy over the geometry of the first disk to the second using:
# prtvtoc /dev/rdsk/c4d0s2 | fmthard -s - /dev/rdsk/c4d1s2
Add the second disk to the first disk:
# zpool attach -f rpool c4d0s0 c4d1s0
That's it. Now make the second disk bootable:
# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c4d1s0
Have fun with your fileserver. In a few minutes, the rootpool will have been fully resilvered (i.e. ZFS lingo for synced)
# zpool status
pool: rpool
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror ONLINE 0 0 0
c4d0s0 ONLINE 0 0 0
c4d1s0 ONLINE 0 0 0
errors: No known data errors
pool: share
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
share ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c8t0d0 ONLINE 0 0 0
c8t1d0 ONLINE 0 0 0
c8t2d0 ONLINE 0 0 0
c8t3d0 ONLINE 0 0 0
c8t4d0 ONLINE 0 0 0
errors: No known data errors
Since with every harddisk the question is not if, it is when it will die. So you should check the disks in regular intervals using:
# zpool scrub share
zpool status will then tell you if any error occurred. Then replace the failing disk.
Neues und altes aus der Welt der Technik, Erlebnisse und Abenteuer in Japan und Deutschland.
Beobachtungen zu Land und Leute, Technisches und vielleicht auch mal ein Schneckencomic.
Leave a reply