Secure Dynamic Disk Policy
The Linux kernel can simulate raid controllers to manage hard disks, but only supports levels 0, 1, 4, and 5.
Raid0, also known as striping
Distribute continuous data access to multiple disks to improve storage performance. The speed is the fastest, but the most dangerous.
Raid1 is also called mirror or tracing ing.
To maximize the availability and maintainability of user data, 100% of user data is automatically copied to another hard disk, which is a little slow because multiple hard disks need to be written at the same time.
RAID5 requires at least three hard disks
The data is not backed up when the stored data is not stored, but the data and the corresponding parity information are respectively stored on different disks. When a disk data is damaged, use the remaining data and the corresponding parity information to restore the damaged data.
Raid0 + 1, also known as raid10
Combined with the advantages of raid0 and raid1, many companies are using
Software raid in Linux
1. The default kernel supports the software RAID Controller.
2. You need to use the raidtools tool to create and manage raid devices. Instead, use the mdadm tool instead of Fedora core5.
3. Software RAID device file name:/dev/MDN (n = 0, 1, 2 ...)
4. The software RAID device can be viewed as a partition and mounted after formatting.
# Mkfs. ext3/dev/md1
# Mount/dev/md1/OPT
Use mdadm to create and manage raid
Raid0
Add Hard Disk
The members of a RAID device are hard disk partitions. You must first partition the hard disk. the partitions cannot be on the same physical hard disk.
# Fdisk/dev/SDB
N create a primary partition, t partition type FD, W write save
# Fdisk/dev/SDC
# Mdadm-CV/dev/md0-l0-N2/dev/sdb1/dev/sdc1
-C, -- create creates a new array
-V, verbose display details
/Dev/md0 Array Device Name
-L, -- level = array level, for example, 0, 1, 4, 5, 6
-N, -- raid-devices = number of array activities
/Dev/SD [BC] 1 List of devices included in the array
# More/proc/mdstat view the array status
# Mkfs. ext3/dev/md0 create a file system
# Mount/dev/md0/mnt/raid
Enable automatic mounting, modify/etc/fstab, and add
/Dev/md0/mnt/raid ext3 defaults 0 0
RAID5 Fault Simulation
A raid 5 device md0 has been created.
# Mdadm-CV/dev/md0-L5-N3-x1-c128/dev/SD [B, c, d, e] 1
1. Mark/dev/sdb1 as a damaged device.
# Mdadm/dev/md0-F/dev/sdb1
At this time, the array begins to reconstruct and restore data.
2. Remove the damaged device.
# Mdadm/dev/md0-r/dev/sdb1
3. Add new devices to the array
Note: 1. Partition the hard disk correctly, and 2. Add the device name to be consistent with the removed device name, for example, sdb1.
# Mdadm/dev/md0-A/dev/sdb1
Generate the configuration file/etc/mdadm. conf
The format is as follows:
Device/dev/sdb1/dev/sdc1/dev/sdd1/dev/sde1 array/dev/md10 level = raid10 num-devices = 4 UUID = 12334343 dkfj
The UUID information is obtained through # mdadm-D/dev/md10.
# Mdadm-Ds scan the File Information
Common array maintenance commands
1. Enable Array
# Mdadm-as/dev/md0
-A: Enable an existing array
-S is based on/etc/mdadm. conf
If the mdadm. conf file is not created, enable it as follows:
# Mdadm-A/dev/md0/dev/SD [BC] 1
2. Stop the Array
# Mdadm-S/dev/md0
3. Display array details
# Mdadm-D/dev/md0