The rapid development of computer and network technology has increased the requirements of storage performance and data reliability. In the enterprise environment, when the company server has simultaneous access to 3000+ users, and the user simultaneously performs different file read and write operations, the read and write performance of a single hard disk is limited and the performance bottleneck is prone to occur. Common parallel interface hard drives such as early IDE hard drives reach 133MBPS,SCSI small computer system interface hard disk maximum transfer rate is 320Mbps, current mainstream serial interface HDD SATA interface hard disk SATA1 transfer rate is 300Mbps, The SATA2 transfer rate is 600Mbps and the current SATA3 interface can reach 6Gbps maximum. In order to solve the performance problem, early use of sled technology is single Large expensive Disk, but because the price is expensive, in the enterprise can not be large-scale application. In 1987, Patterson,gibson and Katz of the University of California, Berkeley, published a paper "A case for redundant Arrays of inexpensive Disks (RAID)", since the concept of a redundant array of inexpensive disks was generated, However, in the actual application of the enterprise found this technology still need to spend a lot of money to support, so renamed redundant Arrays of independent disks that redundant array of independent disks.
"1"
Benefits of RAID:
The benefits of raid in capacity and management
Easy and flexible capacity expansion
Virtualization enables manageability to greatly enhance
performance benefits of RAID
"Disk chunking" technology leads to improved performance
The benefits of raid in reliability and availability
Improved reliability with redundant technology and hot-standby, heat exchange
"2"
The concept of mirrored redundancy:
Mirror redundancy uses disk mirroring technology;
Disk mirroring is a simple device virtualization technology, where each I/O operation is performed on two disks, and two disks look like a disk;
Mirrored redundancy can improve the read performance of the disk.
"3"
The concept of verifying redundancy:
Based on the redundancy algorithm, the verification information of the data on the member disk in the array is computed, and the officer information is saved on other disk resources;
ensure data reliability;
Compared to mirror redundancy, it is less expensive to verify redundancy.
"4"
RAID Level:
Different RAID levels represent different storage performance, different data reliability, and different storage costs
How the RAID0 works:
RAID0 is a stripe in the form of uniform distribution of data across the array of disks, the data storage unit is chunk (stripe), the default size is 64K.
Performance: Improved read and write performance
Redundancy capability: None
Space utilization: 100%
At least 2 pieces of disk
How the RAID1 works:
RAID1 a redundant copy of the data on the virtual disk in the form of a mirrored redundancy, placed on the member disk.
Performance: Write performance degradation, read performance improvement
Redundancy capability: Available
Space utilization: 50%
At least 2 pieces of disk
How the RAID5 works:
The RAID5 uses an array of independent accesses, and the checksum information is distributed evenly across the disks of the disk.
Performance: Improved read and write performance
Redundancy capability: Available
Space utilization: (n-1)/n
At least 3 pieces of disk
How the RAID10 works:
RAID10 organizes the array in a way that mirrors first and then strips back.
Performance: Improved read and write performance
Redundancy capability: Available
Space utilization: 50%
At least 4 pieces of disk
In addition to commonly used raid50,jbod two kinds of arrays, not commonly used RAID2, RAID3, RAID4 and so on.
"5"
RAID configuration commands:
Hardware RAID is used to store data in the enterprise, but the Linux system itself also provides RAID capabilities, where we do a demonstration of how software RAID is implemented
Create an example of a 2G RAID0 device:
#fdisk/DEV/SDA
Explanation: Creating a disk partition
N (new partition)
+1g
N
+1g
T (adjust partition type)
5
FD (set partition type to RAID type)
T
6
Fd
W (Save exit)
#partprobe/DEV/SDA
Explanation: Synchronizing partitioned data
#cat/proc/partitions
Explanation: See if the partition was successfully synchronized
#mdadm-C/dev/md0-a yes-l 0-n 2/dev/sda{5,6}
Explanation:-c means enter create mode,-a indicates whether the device file is automatically created for it,-n indicates the number of devices, and-L indicates the level of RAID set
#cat/proc/mdstat
Explanation: View all enabled devices for the current system
#mke2fs-j/dev/md0
Explanation: Advanced formatting, creating md0 as a ext3 type file system
#mount/dev/md0/mnt
Explanation: Mount the RAID0 to the/MNT directory and you can start using the device.
#cd/mnt
Explanation: Enter into the/mnt directory, if you see the Lost+found file, the instructions mount successfully
Create an example of a 2G RAID1 device:
#fdisk/DEV/SDA
Explanation: Start creating a disk partition
N (New)
+2g
N
+2g
N
+2g
T (adjustment type)
7
FD (adjust to raid type)
T
8
Fd
T
9
Fd
W (Save exit)
#partprobe/DEV/SDA
Explanation: Synchronizing disk partition information
#cat/proc/partitions
#mdadm-C/dev/md1-a yes-n 2-l 1/dev/sda7/dev/sda8
Explanation: Create a type RAID1, automatically create a device file, and the number of devices is 2 RAID1 type partition MD1
#cat/proc/mastat
Explanation: Displays all enabled devices for the current system
#mke2fs-j/DEV/MD1
Explanation: Advanced formatting, setting the file system type of MD1 to Ext3
#mount/dev/md1/media
Explanation: Mount the MD1 device file to the/media directory
example of an emulated RAID1 device disk corruption:
#cp/etc/inittab/media/
Explanation: Copy a file under/etc to the/media directory
#mdadm-D/dev/md1
Explanation: View RAID Array details
#mdadm/dev/md1-f/dev/sda8
Explanation: The-f emulation disk is corrupted and the sda8 in the MD1 array is corrupted
#mdadm/dev/md1-r/dev/sda8
Explanation: Deleting disk-R in array md1
#mdadm/dev/md1-a/dev/sda9
Explanation: Add a new hard drive sda9, you can see the SDA9 information will be synchronized to SDA7 data after a period of time
#mdadm/dev/md1-f/DEV/SDA7
Explanation: Damage to SDA7 disk emulation
#umount/media
Explanation: Uninstalling the/media file directory
#mdadm-S/DEV/MD1
Explanation: Stop MD1 Array
#rm/dev/mad1
Explanation: After deleting the md1 array, it completely disappeared.
#mdadm-A/dev/md1/dev/sda7/dev/sda9
Explanation: Reassemble the SDA7 and sda9 disks to form a MD1 array, but because SDA7 is bad, there is only one md1 disk in sda9
analog RAID1 Device hot-standby, heat exchange Example:
At this point there is only one disk in Md1 sda9
#mdadm/dev/md1-a/dev/sda8
#mdadm/dev/md1-a/DEV/SDA7
Explanation: The status of the free disk is displayed after SDA7 enters the array
#mdadm/dev/md1-f/dev/sda9
Explanation: Simulates a damaged disk sda9, after which the SDA7 disk will automatically sda9 on top of the location
#watch ' Cat/proc/mdstat '
Explanation: Periodically executes the specified command and displays the result in full screen
automatically assemble files without specifying a disk:
#mdadm-D--scan >/etc/mdadm.conf
Explanation: Save the current raid information to a configuration file for later assembly
#mdadm-A/DEV/MD1
Explanation: No need to specify specific disks such as SDA7, SDA9, etc.
My Linux, I am the master! "Redundant array of independent disks raid classification and implementation method