Manage dynamic disks (RAID)

Understanding of RAID

Insert picture description here

RAID 0
Insert picture description here

RAID 1
Insert picture description here
RAID 2
Insert picture description here
RAID 5 (distributed read-write and parity calculation)
Insert picture description here

RAID 6 (distributed read-write and parity information)
Insert picture description here
RAID comparison
Insert picture description here

MDADM

Create raid 0

1. Add 4 hard disks (custom size)
2. Create raid 0 (after successful creation, the following message is displayed as success)
-C: create a new RAID
-a: automatically create the corresponding device
-l specify the RAID level to be created
-n: Specify the number of hard disks
/dev/md0: path
/dev/sdb and /dev/sdc: two devices
0: raid level
Insert picture description here
3. View the detailed information of the created disk: madam -D /dev/md0
4. Create A configuration file makes the created raid take effect permanently:
Insert picture description here
3. Create a file system for permanent mounting:
a. Format the file system with md0 as ext4: mkfs -t ext4 /dev/md0
b. Create a mount point: mkdir /mnt/ raid0
c. Mount: mount /dev/md0/ /mnt/raid0/
d. View: df -hT
e. Copy the file (pay attention to the path):
Insert picture description here
4. Modify the fstab file (the last line is the added information section to achieve permanent mounting Upload):
vim /etc/fstab
Insert picture description here

Create and backup disks of other raid levels

Insert picture description here

Control RAID

1. Uninstall and then close (this operation restart will also start raid):
umount /dev/md0
madam -S /dev/md0
2. Clear the RAID information on the underlying disk of the RAID
mdadm --zero-superblock /dev/sdb

Creation of RAID 5 (use one of the hard drives as backup hard drives at the same time)

1. Create and backup disk
Insert picture description here

2. View detailed information: mdadm -D /dev/md0

Simulated failure

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45849066/article/details/111615275