|
CD-ROM RAID
|
|
What?!
Yes, we (Wessel Dankers and I) had this idea about using our multiple cdrom drives to make
a RAID from it somehow. A RAID (Redundant Arrays of Independent Disks) is a set of ordinary devices linked together in a special
way. There are various ways to link them, all having their pros and cons. We use RAID0, also known as striping. With
striping, the first block of data is stored on the first disk in the array, the second block in the second disk, etcetera, and
if you have N disks in the array, the N+1'th block is stored on the first disk and so on. The benefit of this method is speed; if
you read a large file, all disks are accessed at almost the same time. The maximum data throughput is that of all disks added
together. There is one problem however, if one of your disks crashes, the others become useless too.
Why?!
Lightning flash, booming voice: Because we can! Evil laughter: Muhahahahahaha!!!
How?!
Its very simple in fact, if you use a flexible operating system like Linux. First of all, you should check your kernel supports
RAID, loopback device (NOT the networking loopback thing), your cdrom drives and ofcourse the filesystem you want to use on your
RAID. You also need more obvious stuff, like a CD burner and appropiate software. Those are the ingredients. Now for the recipy
(where N is the number of disks you want to make a RAID of, X is a disknumber, BLAH is the fs of your choice if not ISO9660, and
cdromX should be symlinks to or replaced by your cdrom devices, furthermore you may need to use some other commands, these are just
a guideline):
- For each cdrom drive, make a file with size 650 Mb. Use a command like:
dd if=/dev/zero of=cdX bs=1024k count=650
- Make a loopback device from every file:
losetup /dev/loopX cdX
- Make a RAID from every loopback device:
mdadd /dev/md0 /dev/loop1 /dev/loop2 ... /dev/loopN
- Start your RAID in striping mode, blocksize 64 Kb:
mdrun -p0 -c64k /dev/md0
- Non ISO fs: Format your RAID:
mkBLAHfs /dev/md0
- Non ISO fs: Mount your RAID:
mount /dev/md0 /mnt/raid
- Non ISO fs: Copy everything to your raid:
cp -dpR everything /mnt/raid
- Non ISO fs: Unmount your RAID:
umount /dev/md0
- ISO fs: Make an ISO filesystem from everything:
mkisofs -o /dev/md0 everything
- Turn off your RAID:
mdstop /dev/md0
- Remove the loopback devices:
losetup -d /dev/loopX
- Burn every cd image:
cdrecord cdX
- Remove the image files:
rm cdX
- Put the CD's into your cdrom drives
- Make a RAID from every cdrom drive:
mdadd /dev/md0 /dev/cdrom1 /dev/cdrom2 ... /dev/cdromN
- Start your RAID:
mdrun -p0 -c64k /dev/md0
- Mount your RAID:
mount /dev/md0 /mnt/raid
- Enjoy
DO THIS AT YOUR OWN RISK! We are not responsible if you delete all your partitions, waste 10 cdroms, blow up your computer
or anything else while trying to do this.
Our experience
I have Linux 2.1.129ac2, two ATAPI cdrom drives (one Aopen 24x and a FX600S 6x drive). The filesystem on the
two CD's is a 1300 Mb ISO9660 with RRIP_1991A extensions. It works great!
Wessel however, who has
Linux 2.0.36 and SCSI cdrom drives (a Plextor PX-R412C and a Pioneer DR-U12X), had a crash while mounting
the RAID with the CD's swapped, and one while executing the following command: cat `find -type f` >/dev/null
Copyright (C) Guus Sliepen. Last updated: 27 november 1998. Send comments to root@sliepen.eu.org