# # # For Information about Compiling Raid into your linux Kernel # ----------------------------------------------------------- # raid.uhow2 # # # Checking the proper verions # --------------------------- # mkraid -V # mkraid version 0.90.0 # # # Create the Raid Config Files # ---------------------------- # /etc/raid0.conf # /etc/raid1.conf # /etc/raid5.conf # # cd /etc ; ln -s raid5.conf raidtab # # # Create the Raid Devices # ------------------------ # mkraid /dev/md0 # mkraid --really-force /dev/md0 # - to overwrite prev raid filesystems # # See whether the Raid device was created # --------------------------------------- # cat /proc/mdstat # # Create the raid filesystem # -------------------------- # mke2fs -c /dev/md0 # mke2fs -b 4096 -m 1 -R stride=32 /dev/md0 # mke2fs -b 4096 -R stride=16 /dev/md0 # # Check the raid filesystem # -------------------- # e2fsck /dev/md0 # # Mount the Raid Filesystem # ------------------------- # mkdir /Raid # mount /dev/md0 /Raid # # Test by writing a file to the Raid FileSystem # --------------------------------------------- # dd if=/dev/zero of=/Raid/test count=1000000 # www:~# ls -l /Raid # -rw-r--r-- 1 root root 512000000 Feb 13 13:11 test # bonnie tests # # stress.sh tests # # Normal Umount # -------------- # umount /raid # # # Stop the Raid FileSystem # ------------------------ # raidstop /dev/md0 # # cat /proc/mdstat # Personalities : [linear] [raid0] [raid1] # read_ahead 1024 sectors # unused devices: # # Start the Raid FileSystem # ------------------------- # raidstart /dev/md0 # raidstart -a # raidrun -a # # cat /proc/mdstat # Personalities : [linear] [raid0] [raid1] # read_ahead 1024 sectors # md0 : active raid1 hdd1[1] hdc1[0] 11255040 blocks [2/2] [UU] resync=0% finish=53.3min # unused devices: # # Monitor Your Raid FileSystem # ---------------------------- # see raid_monitor.* # # # If a drive fails while online: # ----------------------------- # raidhotremove /dev/md0 /dev/sdb2 # raidhotadd /dev/md0 /dev/sdb2 # # ----------------------------------------------------------------- # # Testing the array # ================= # 1. Write some large files... and compare them # # mount /dev/md0 /Raid # dd if=/dev/null of=/Raid/test1 count=4000000 ( about 2Gb files ) # dd if=/dev/null of=/Raid/test2 count=4000000 # diff /Raid/test1 /Raid/test2 # umount /dev/md0 /Raid # # 2. Pull one of the drives out if it is raid5 setup - nothing should be lost # # dd if=/dev/null of=/Raid/test3 count=4000000 - create a new file # # # 3. Insert the original "simulated bad disk" - should resync the array # # # -------------------------------------------------------------- # # stress.sh # # modprobe raid5 # lsmod # # hdparm -t /dev/md0 # # hdparm -Tt to see both buffer-cache and buffered disk read timings. # # Benchmarks: # www.acnc.com/benchmarks.html AC&NC | RAID and Disk Storage Benchmarks # # Bonnie # www.spin.ch/~tpo/bench # # Malcolm Beattie # hdparm /dev/hda (and the other disks) shows you have using_dma and unmaskirq set to 1. # # # ***************** RAID0: 4KB chunk, 1KB block, stride=4 # bonnie -s 512 -m "raid0,4k" -d /zh # # ***************** RAID0: 32KB chunk, 4KB ext2 block, stride=8 [root@iam /zu]# bonnie -s 512 -m "raid0,32k,4k,8" -d /zg # # Bonnie -s 1024 -m king # # # Contributers # ------------ # Malcolm Beattie # Richard Jones # # end of file