Linux Note--RAID,MDADM,LVM

Source: Internet
Author: User

  • RAID: The controller divides an interface into multiple interfaces and makes these devices a whole, and the system is just not a whole

  • Storage interface type: IDE SATA USB SCSI SAS (serial Port SCSI)

  • RAID Leve:raid Level:

  • O: Striped split data, one file stored separately on several memory, high efficiency

  • 1: Mirror, need at least two blocks of memory, while the two pieces of memory to write the same file, if a piece of damaged piece of file data can continue to use

  • RAID4: At least three pieces of memory, one of which is a check disk to record the sum of the other two pieces of data, if the bad piece can also, through the other two pieces to calculate the bad piece of data

  • RAID5:RAID4 upgrade version, using a rotation check disk, three storage disk rotation as a check disk

  • Raid0+1: Requires at least four blocks of memory, the memory of the two parts 1 and 2, and then the data are written to 1;2, in the 1;2 each two blocks of memory 1 in the corresponding 2 of the write mode location of the same, equivalent to 1 as data 2 as a backup

  • Raid1+0: At least four blocks of memory, the same memory is divided into two parts 1;2, and then the data into two parts written to 1;2, the 1;2 of the two memory and then copy the data to two memory, the equivalent of separating the data, and then the separate part of the data stored in two pieces of memory, thereby 1 ; 2 has two copies of the exact same part of the data.

  • Raid0+1 and raid1+0 contrast: The speed is similar, but the error repair speed raid1+0 faster than raid0+1, because the raid0+1 repair when the two groups of disks to be compared to recover the bad disk data, and raid1+0 only need to recover from the mirror disk, Does not affect data on other disks but the same group of disks cannot be damaged at the same time

  • JOBD: Multiple small disks superimposed, but the system is recognized as a piece, but a piece of damage, data files can not be used, the speed is not improved

  • Total:

  • 0: Improved read and write performance, no fault tolerance, space utilization: 100%c (number of disks), at least two disks

  • 1: Read performance increase write performance degraded, fault tolerance, allow damage to a disk, space utilization: at least two pieces of disk C

  • RAID5: Read and write promotion, fault tolerance, allow damage to a disk, space utilization; c-1/c at least three disks

  • Raid0+1: Read and write promotion, fault tolerance, allow damage to a disk, space utilization: at least four pieces of disk C

  • Raid1+0: Read and write promotion, fault tolerance, allow damage to a disk, space utilization: at least four pieces of disk C

  • JBOD: No elevation no fault tolerance space utilization: 100% at least two disks

  • Hardware RAID software RAID

  • Software RAID:

  • Must kernel support, kernel module: Md:multi disks simulation of a raid, it is best not to use, will increase the load on the CPU, the system crashes will cause data loss, and only soft raid to access the disk content

  • Mdadm: Make any block device raid,-d: Displays detailed information about the specified device, view the raid whole column modal command-N: Number of devices-L: Level-c-a Yes: Automatically create the file for it-C: Specify the size of the chink (data block)-X #: Specify the number of space disks Create mode:-C management mode:--del--add--fail Monitor mode:-F Growth mode:-G assembly mode:-A

  • Create a 2G raid

  • FDISK/DEV/SDA1 and 2 T--FD

  • Partprobe (detection)

  • Cat/proc/partitions (detection)

  • Mdadm-c/dev/md0-a yes-l 0-n 2/dev/sda{1,2}

  • Cat/proc/mdstat (displays RAID devices that are currently enabled by the system)

  • Simulated damage:

  • Management mode: MDADM/DEV/MD0 (RAID device)--fail/dev/sda# (specifies a partition of a damaged RAID device)

  • --remove: Remove (can also use-r)--add add

  • mdadm/dev/md#-r/dev/sda2

  • mdadm/dev/md#-a/dev/sda3

  • The partition size of 2 and 3 file system types must be the same

  • -D--scan: View raid device files: mdadm-d--scan >/etc/mdadm,canf You can use automatic assembly mdadm-a/etc/md#: Save the configuration file for later assembly

  • Stop an entire column:

  • Mdadm-s (uppercase)/dev/md#

  • Watch ': Periodically executes the specified command and displays the result in full screen-n #指定周期长度 (unit s) defaults to 2s

  • Mdadm: User space tools, Administrative Tools

  • Md:meta Device

  • Dm:device Mapper Logical device maps multiple physical devices to logical device snapshots (data backup) multiple dynamically expanding logical volumes can be built on raid

  • Pv:pvcreate (Create) Pvremove (Erase metadata) Pvmove (mobile data) PVs View PV pvdisplay Detailed View Pvscan See how many PV

  • Vg:vgcrete vgmove vgextend vgredace vgs vgdispaly Vgscan

  • Vgcrete volume name (PV) path-S # (can be with units): Specifies that the PE size defaults to 4M

  • Vgremove removing VG vgextend VG Name PV Name: Extend a PV to the volume

  • Lv:lvcrate lvmove lvextend lvreduce lvsuze LVs lvdisplay

  • Lvcrate-n name-l #G Vgname

  • Extending logical Volumes

  • -L [+]#///(Physical path)

  • Resuze2fs

  • Resize2fs-p//#

  • Reduce

  • 1. Cannot be reduced online, first uninstall

  • 2. Ensure that the size of the reduced space is still able to store all of the original data

  • 3. Check the file before shrinking to ensure that the file system is in a consistent state

  • RESIZE2FS//#

  • Lvreduce-l #//

  • Forced check: DF-LH umount e2fsck-f

  • Snapshot

  • 1. The lifecycle is the entire data length, and the data growth cannot exceed the size of the snapshot volume during this period

  • 2. The snapshot volume should be read-only

  • 3. Within the same volume group as the original volume

  • Lvcreate-l #-N slv_name-p R//

  • Back up snapshot data (it will not be synchronized if the data has been modified before the snapshot can be backed up)

  • uninstalling, deleting snapshots

  • Until

  • As opposed to while, the condition is true, exit the loop, and if the condition is the return value you can use the statement as a condition

  • Until who | Group "" &>/dev/null

  • For

  • For ((EXPR1;EXPR2;EXPR3;EXPR4)) such as ((c=3;c<=50;c+=2))

  • Loop body

  • Done

  • Ping

  • -C Frequency-w timeout wait time


This article is from the "stupid Bird first-FAI" blog, please be sure to keep this source http://benniaoxianhui.blog.51cto.com/10463960/1679210

Linux Note--RAID,MDADM,LVM

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.