Creating a RAID-1 Disk on Linux

Here's just a brief rundown for now. We'll fill in the details when we get a chance. Send us email if you need details sooner.

We used the md program that is part of the Slackware distribution to create a striped 8G disk from two 4G drives for our /var/spool/news/alt/binaries partition on the news machine. Note that there are certainly better hardware configurations; this was what we had to work with at the time.

  1. mdcreate raid0 /dev/md0 /dev/sdc1 /dev/sdd1
  2. mdadd
  3. mdrun
  4. mke2fs
  5. fsck /dev/md0
We put this in an /etc/mdtab:
# mdtab entry for /dev/md0
/dev/md0        raid0,4k,0,bca0ce14     /dev/sdc1 /dev/sdd1
So that in our startup scripts we only need something like:
# This uses the file /etc/mdtab
echo 'Running RAID0'
/sbin/mdadd -a
/sbin/mdrun -ar
echo 'Checking filesystem'
/sbin/e2fsck -a /dev/md0
cat /proc/mdstat
echo 'Mounting RAID0'
mount /dev/md0 /var/spool/news/alt/binaries
chmod 775 /var/spool/news/alt/binaries
chown /var/spool/news/alt/binaries

Some useful links:

Updated 23-Jan-97

World | Inch