RAID
From Koset Surakomol
Damn that was easy ... with Linux
I wanted to build a simple file server with an old PC and leftover hard disks. I used Fedora Core 8 and Samba to share the file system. I added a gigabit ethernet card which sped up transfers considerably. I also added a dual-layer dvd burner for backups.
Services
These services needed to be set to launch on boot. pre chkconfig smb on chkconfig sshd on /pre
RAID Setup
Believe me, I understand the shortcomings of software-based RAID. If I were going for performance, I'd start with a hardware RAID controller. In this case, my goal was to have tertiary back-end storage.
I had various sized disks, so they weren't right for a RAID-5, which requires same-sized disks. I settled for RAID-0, which offers no protection, but maximizes disk space usage. I found a great resource for a RAID Howto here.
Here are my commands
pre for x in a b c ; do fdisk -l /dev/sd$x; done mdadm --create --verbose /dev/md0 --level=0 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1 mdadm --detail /dev/md0 /pre The array will need some time to build. Sit back and watch the hypnotic glow of the red LED.
pre cat /proc/mdstat mkfs.ext3 /dev/md0 mdadm --detail --scan --verbose /etc/mdadm.conf cat /etc/mdadm.conf vi /etc/fstab mount -a mount df -kh /b /pre
fstab
Add this line: pre /dev/md0 /b ext3 defaults 1 2 /pre
smb.conf
pre [global]
interfaces = 192.168.1.1/24 workgroup = apple log file = /var/log/samba-log.%m lock directory = /var/lock/samba share modes = yes
[b]
inherit permissions = yes path = /b public = yes writable = yes printable = no guest ok = yes
/pre
Repair
Can't find your md device? pre mdadm /dev/md1 --auto-detect /pre
Future Plans
I aim to replace all the drives with cheap 500GB units (~ $105 ea.) My motherboard will handle six IDE drives. I could implement two 3-drive configurations or perhaps a 5-drive RAID-5 for more protection, plus one cold spare.
More
My RAID notes.
