Soft RAID-mdadm toss note RAID-disk array, in short, used to improve hard disk utilization and speed RAID type (theory): RAID0: read/write performance (at least two hard disks) --- hard disk usage is the sum of all hard disks, and performance is the sum of all hard disks. RAID1: read/write performance... soft RAID-mdadm tossing note
RAID-a disk array. In short, it is used to improve the utilization and speed of hard disks.
RAID type (theory ):
RAID 0: read/write performance (at least two hard disks)-Hard disk usage is the sum of all hard disks and performance is the sum of all hard disks.
RAID 1: read/write performance, redundancy (at least two hard disks) --- space utilization: the smallest of all disks (n/2); read performance is close to RAID 0, the write performance is weaker than raid 0; the write performance is redundant.
RAID 5: read/write performance, redundancy (at least 3 hard disks) --- space utilization: 1-1/n. the read performance is close to RAID0, and the write performance is weaker than RAID0. redundancy: damage to a hard disk is acceptable;
RAID 6: read/write performance, redundancy (at least 4 hard disks) --- space utilization: 1-2/n. compared with RAID 5, the read/write performance is weaker than RAID 5. redundancy: two hard disks may be damaged;
Mdadm common parameters
(Highlighted ):
-F: fail. set a disk to a faulty state.
-L: LEVEL. set the disk array LEVEL.
-R: Remove faulty device
-A: add new devices to the disk array.
-S: stops a disk array.
-V: -- verbose: Display details
-D, -- detail: print details of one or more md devices
-X: -- spare-devices: specifies a backup disk, that is, the number of redundant devices of the initial array, that is, the number of spare devices;
-N: number of disks
-A: -- assemble: Adds A previously defined array.
-B: -- build: create an array without super blocks (Build a legacy array without superblocks .)
-C: -- create: create a new array
-F: -- follow, -- monitor: Select monitoring mode
-G: -- grow: changes the size or form of the activated array.
-I: -- incremental: add a separate device to the appropriate array and possibly start the array.
-- Auto-detect: requests the kernel to start any automatically detected array
-H: -- help: help information. this option is displayed after the preceding options are used.
-- Help-options: displays more detailed help information.
-V: -- version: prints the mdadm version.
-B: -- brief: less details. Used for -- detail and -- examine options
-Q: -- query: View a device and determine whether it is a md device or a part of a md array.
-E: -- examine: print the content of the md superblock on the device.
-C: -- config =: specifies the configuration file. the default value is/etc/mdadm. conf.
-S: -- scan: scan the configuration file or/proc/mdstat to search for lost information. Configuration file/etc/mdadm. conf
Use mdadm to create RAID (the level is only a number, and other parameters are basically the same ..)
CRATERAID 0:
[Plain] mdadm-Cv/dev/md0-l 0-n 2/dev/sdb/dev/sdc // Single line comment: /dev/sdb/dev/sdc can be replaced by/dev/sd [B, c]
Format mounting:
Save the configuration to prevent array loss after restart:
In order to continue creating the demo RAID5, let's talk about some stuff in advance and clear the RAID data...
If there is a Mount before cleaning, you must detach it. then stop the RAID array. Otherwise, an error will be reported.
The following parameters are used:-S, -- zero-superblock.
[Plain] mdadm-Cv/dev/md0-l 1-n 5/dev/sd [B, c, d]-x 1/dev/sde
CRATERAID6: [plain] mdadm-Cv/dev/md0-l 1-n 6/dev/sd [B, c, d, e]-x 1/dev/sdf
Advanced: set faulty devices, remove devices, and replace disk devices
Set the faulty device: [plain] mdadm/dev/md5-f/dev/sdd
Check the details and you will find that the hard disk/dev/sdd is missing, but it is running well ....
Add a disk device: [plain] mdadm/dev/md5-a/dev/sdd
Set the RAID array to boot [plain] vim/etc/fstab
Insert in the last row
/Dev/md5/mnt ext4 default 0 0
Then return to the command mode: x or: wq save and exit
Note: To add a RAID entry to fstab, the corresponding format must be formatted and mounted ....
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.