Linux disk array and various hot backup

Source: Internet
Author: User

The disk array is divided into:

Arrays with redundancy: RAID0 raid4 raid5 raid6 raid10 raid01 ....

Read-write Speed Advantage array: RAID1 raid4 raid5 raid6 raid10 raid01 ....

How to make a disk array, separately enumerated:

1. Array with redundant function raid0

1.1 requires at least two disks, SDB and SDC, to separate one partition from the two disks: SDB1 and SDC1,

1.2 You need to change the partition number-FD when partitioning, then W exits.

1.3 Make RAID0, before making this disk array, need to install Mdadm package, using Yum is the best way to install

Mdadm-cv/dev/md0-a yes-l 1-n 2/dev/sd{b,c}1

1.4 Displaying the information for the development of the array

Mdadm-d/dev/md0

1.5 Because the array is redundant, damaging a piece of disk has no effect on read-write operations, but the speed is greatly reduced and now simulates a damaged disk

Mdadm/dev/md0-f/DEV/SDB1

1.6 Removing a damaged disk

Mdadm/dev/md0-r/DEV/SDB1

1.7 Viewing operational information for a disk array

Mdadm-d/dev/md0

The result is a stat clean downlow: Indicates that although a piece of disk has been damaged, it can continue to be used, but the performance is reduced a lot

2. Boot and auto mount of the disk

In the above already said how to make disk RAID0, the way to make disk probably also that several steps, need to boot hangs in the words, then go to/etc/rc.d/rc.sysinit inside to configure, specifically add the following code snippet is ok

Update_boot_stage Rcraid
[-x/sbin/nash] && echo "raidautorun/dev/md0" | Nash--quiet
If [-f/etc/mdadm. conf]; Then
/sbin/mdadm -a-s
Fi

For automatic mounts, add this code below the/etc/fstab, and of course, before using the disk array, you should also format and hang the processing

/dev/md0/mnt/raid ext3 defaults 0 0

3. Hot backup and thermal recovery for disk arrays

As we all know, a lot of important data need to do hot backup and make the service available.

When doing a hot backup, if Raid0, that requires at least three disks, now assume that three disk partitions are SDB1 SDC1 SDD1

The commands for making a hot backup are:

Mdadm-cv/dev/md0-a yes-l1-n 2/dev/sd{b,c}1-x/DEV/SDD1

Make SDD1 as a hot backup disk, SAB1 and SDC1 as the use of disk

View disk array Status: Mdadm-d/dev/md0 Displays the status of three disks

Now simulate corrupting a disk SDB1:

Mdadm/dev/md0-f/DEV/SDB1

View RAID0 Status: Mdadm-d/dev/md0

You can see that SDD1 is synchronizing data

Use monitoring to view synchronization status:

!wa, you can see the data Synchronization bar display progress graph, SDD1 is being enabled.

Indicates that the hot backup has completed the conversion.

5. Stop using the disk array:

umount/media/

Mdadm-s/dev/md0

6. Add an existing disk array

Mdadm-a/dev/md0/sd{a,b,c,d}1

!cat for monitoring.

More information on RAID will be completed later.

Related Article

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.