Soft RAID-mdadm tossing note

Source: Internet
Author: User

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:


CRATERAID1: [html] mdadm-Cv/dev/md0-l 1-n 2/dev/sdb/dev/sdc
CRATERAID5:

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


View status:


Remove faulty device: [plain] mdadm/dev/md5-r/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 ....

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.