Linux Notes Day Nineth

Source: Internet
Author: User

1. RAID basic concept and mdadm implement soft raid

2, Mdadm command and bash Loop advanced

3, Linux management of LVM detailed

4, compression decompression and the use of archiving tools


One, raid:redundant array inexpensive Disks inexpensive redundant disk array.

1.1 The hard drive is connected to the motherboard via the IDE interface and cable, how can a user or system think of multiple disks as a whole, we need to use software to simulate a disk (RAID) or connect a cable to a board, The board is plugged into the motherboard (hard RAID). With the use of SCSI hard disk, disk cost is higher, no longer cheap, so the name redundant array independent disks redundant array of independent disks.

RAID level:


RAID level Read performance Write performance
Fault tolerant Disk Utilization At least the number of disks Note
Raid0 Improve Improve No N*disk 2 bucks.
Raid1 Improve Slightly down
Yes 1*disk 2 bucks.
Raid4 Improve Improve Available (fixed plate) (n-1) disk 3 bucks. XOR or operation
Raid5 Improve Improve Have (take turns) (n-1) disk 3 bucks. Raid5+0
Raid10 Improve Improve Yes N/2disk 4 bucks. With a lot of
Raid0+1 Improve Improve Yes N/2disk 4 bucks.
Raid6 Improve Improve Yes (n-2) disk 4 bucks. 2-Block Check disc

Note: Due to raid4 fixed check disk, check disk pressure, poor performance, it is RAID5;RAID5 a few disk rotation check, fault-tolerant, good performance; Raid4, RAID5 can only bad a plate.

1.2 Linux 2.6 launches MDADM,MD to do soft RAID,DM (device mappen) for LVM.

Use of the Mdadm tool: MD supports organizing any device into raid, such as disks and partitions, if the SDA1 sda2 Sda3 three partitions are made RAID5, one of the partitions destroys the entire disk, so it makes no sense to raid different partitions on the same disk.

Mdadm: Modal commands

-A: Assembly mode for re-identifying previously implemented raid

-C: Create mode for creating raid

-F: monitoring mode, mail monitoring

Management mode:-f,-r,-a

-c option in Create mode:

-N #: The number of disks used to create the RAID device

-L #:raid Level

-a yes: Automatically generate device files for raid created

-C chunk_size: Soft raid self-made block size

Device files for MD devices, usually beginning with MD in the/dev directory, followed by a number;

Cat/proc/mdstat view current system to enable RAID information

For example: Create a 10G raid0.

1, create 2 partitions, and change the ID of FD 2, mdadm-c/dev/md0-a yes-n 2-l 0/dev/sd{b,c}1

3. Formatted E2FS-T ext4/dev/md0

4, mount the trial, if you want to Mount/dev/fstab,mount-a view, DF-LH view raid space

For example: Create a 10G raid5 mdadm-c/dev/md1-a yes-n 3-l 5/DEV/SDA/DEV/SDB/DEV/SDC











Linux Notes Day Nineth

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.