RAID

From Koset

Jump to: navigation, search

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.

chkconfig smb on
chkconfig sshd on

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

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

The array will need some time to build. Sit back and watch the hypnotic glow of the red LED.

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

fstab

Add this line:

/dev/md0 /b ext3 defaults 1 2

smb.conf

[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

Repair

Can't find your md device?

mdadm /dev/md1 --auto-detect

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

How to Migrate to RAID

Retrieved from "http://koset.net/RAID"
Personal tools