Raid:
Redundant Arrays of Inexpensive Disks
Independent
Berkeley:a Case for redundent Arrays of inexpensive Disks RAID
Improved IO capability:
Parallel disk read and write;
Increased durability;
Disk redundancy to achieve
Level: Multiple disk organizations work together in different ways;
How the raid is implemented:
External disk array: Adapter capability with expansion cards
On-chip RAID: Motherboard integrated RAID controller
Software RAID:
Levels: Level
raid-0:0, strip reel, strip;
RAID-1:1, mirrored volume, mirror;
RAID-2
..
RAID-5:
RAID-6
RAID10
RAID01
RAID-0:
Read and write performance improvement;
Free space: n*min (S1,s2,...)
No fault-tolerant capability
Minimum number of disks: 2,
RAID-1:
Read performance improvement, write performance slightly decreased;
Free space: 1*min (S1,s2,...)
Have redundancy capability
Minimum number of disks: 2,
RAID-4:
1101, 0110, 1011
RAID-5:
Improved read and write performance
Free space: (N-1) *min (s1,s2,...)
Fault tolerance: 1 disks
Minimum number of disks: 3,
RAID-6:
Improved read and write performance
Free space: (N-2) *min (s1,s2,...)
Fault Tolerance: 2 disks
Minimum number of disks: 4, 4+
Mixed type
RAID-10:
Improved read and write performance
Free space: n*min (S1,s2,...) /2
Fault tolerance: Each group of images can only be broken one piece;
Minimum number of disks: 4, 4+
RAID-01:
RAID-50, RAID7
Jbod:just a Bunch of Disks
Function: The space of multiple disks is combined with a large continuous space;
Free space: sum (s1,s2,...)
Common levels: RAID-0, RAID-1, RAID-5, RAID-10, RAID-50, JBOD
Implementation method:
How to implement Hardware
How to implement Software
Implementation of software RAID on CentOS 6:
Combined with MD (multi devices) in the kernel
Mdadm: a modular tool
Syntax format for commands: mdadm [mode] <raiddevice> [options] <component-devices>
Supported RAID levels: LINEAR, RAID0, RAID1, RAID4, RAID5, RAID6, RAID10;
Mode:
Create:-C
Assembly:-A
Monitoring:-F
Management:-F,-R,-a
<raiddevice>:/dev/md#
<component-devices>: any block device
-C: Create pattern
-N #: Create this raid with # blocks of devices;
-L #: Indicates the level of RAID to be created;
-A {Yes|no}: Automatically create device files for target RAID devices;
-C Chunk_size: Indicates the block size;
-X #: Indicates the number of free disks;
For example: Create a RAID5 of 10G free space;
-D: Displays details of the raid;
Mdadm-d/dev/md#
Management mode:
-F: flag specifies that the disk is damaged;
-A: Adding disks
-R: Remove disk
Observe the status of MD:
Cat/proc/mdstat
To stop the MD device:
Mdadm-s/dev/md#
Watch command:
-N #: Refresh interval, unit is seconds;
watch-n# ' COMMAND '
Exercise 1: Create an RAID1 device with free space of 10G, request its chunk size is 128k, file system is EXT4, have a free disk, boot can automatically mount to/backup directory;
Exercise 2: Create an RAID10 device with free space of 10G, request its chunk size is 256k, file system is EXT4, boot can be mounted automatically to/mydata directory;
Blog job: RAID level features;
Linux Base raid