Raid stands for Redundant Arrays o Independent Disks. It provides fault tolerance capability and / or performance enhancement depending on the level o RAID you are implementing.
| step | Step | Raid- Linear | Raid-0 (danger) | Raid-1 (mirror) | Raid-4/5 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| make Partition | fdisk | fdisk -l /dev/hdb && list the disk information fdisk /dev/hdb && prepare a new partition it will go into fdisk prompt.
| |||||||||||||||||||||||||||||||||
| Raid information | vi /etc/raidtab | raid 0 | raid 1 | raid 5 | |||||||||||||||||||||||||||||||
| raiddev | /dev/md0 | /dev/md0 | /dev/mdo | /dev/md0 | |||||||||||||||||||||||||||||||
| raid-level | linear | 0 | 1 | 5 | |||||||||||||||||||||||||||||||
| nr-raid-disks | 2 | 2 | 2 | 3 | |||||||||||||||||||||||||||||||
| nr-spare-disks 後備 | 0 | 0 | 1 | 1 | |||||||||||||||||||||||||||||||
| persistent-superblock | 0 | 0 | 0 | 1 | |||||||||||||||||||||||||||||||
| chunk-size | 4 | 4 | 4 | 128 | |||||||||||||||||||||||||||||||
| device | /dev/hdb1 | /dev/hdb1 | /dev/hdb1 | /dev/hdb1 | |||||||||||||||||||||||||||||||
| raid-disk | 0 | 0 | 0 | 0 | |||||||||||||||||||||||||||||||
| device | /dev/hdd1 | /dev/hdd1 | /dev/hdd1 | /dev/hdd1 | |||||||||||||||||||||||||||||||
| raid-disk | 1 | 1 | 1 | 1 | |||||||||||||||||||||||||||||||
| device | /dev/hdc1 | ||||||||||||||||||||||||||||||||||
| raid-disk | 2 | ||||||||||||||||||||||||||||||||||
| device | /dev/hdc1 | ||||||||||||||||||||||||||||||||||
| spare-disk | 0 | ||||||||||||||||||||||||||||||||||
| raid-disk | |||||||||||||||||||||||||||||||||||
| Buid Raid (from information) | mkraid /dev/md0 | mkraid --really-force /dev/md0 | |||||||||||||||||||||||||||||||||
| Check Raid | cat /proc/mdstat | cat /proc/mdstat&& the symbol "[UUU]" means that all three disks forming the RAID-5 are healthy | |||||||||||||||||||||||||||||||||
| Format Raid | mke2fs /dev/md0 | mke2fs -b 4096 -R strids=32 /dev/md0 | |||||||||||||||||||||||||||||||||
| Mount | mkdir /mnt/temp mount -t ext2 /dev/md0 /mnt/temp mount | mount -t ext2 /dev/md0 /mnt/temp | |||||||||||||||||||||||||||||||||
| Check the Raid | df -m hdparm -t /dev/hdd1 /dev/md0 | ||||||||||||||||||||||||||||||||||
| test it failure | raidsetfault /dev/md0 /dev/hdb1 | ||||||||||||||||||||||||||||||||||
| /etc/fstab | /dev/md0 /mnt/temp ext2 defaults 0 0 | ||||||||||||||||||||||||||||||||||
| Recover | replace a new one | replace | |||||||||||||||||||||||||||||||||
| modify /etc/raidtab | modify /etc/raidtab | raidhotremove /dev/md0 /dev/hdd1 | raidhotremove /dev/md0 /dev/hdd1 | ||||||||||||||||||||||||||||||||
| invoice mkraid /dev/md0 | invoke mktraid /dev/md0 | raidhotadd /dev/md0 /dev/hdd1 | raidhotadd /dev/md0 /dev/hdd1 | ||||||||||||||||||||||||||||||||
| cat /proc/dstat && view condition | cat /proc/mdstat | ||||||||||||||||||||||||||||||||||
沒有留言:
張貼留言