RAID5 upgraded to RAID6

Source: Internet
Author: User

To upgrade RAID5 to RAID6, you must use the logical volume method. In the logical volume, you can use pvmove to dynamically move data.
Procedure:

(1) Create RAID5:
Mdadm-C/dev/md5-l5-n3/dev/sda {5 .. 7} ### create raid5
Pvcreate/dev/md5 ### create a physical volume
Vgcreatevg01/dev/md5 # create a volume group
Lvcreate-l100 % FREE-nlv01vg01 # create logical volume
Mkfs. ext3/dev/vg02/lv02 # format
Mount/dev/vg02/lv02/Oracle ### mount the logical volume to the directory and copy the data to the directory to check whether the data is damaged.

(2) Remove a disk from RAID 5 to create raid 6.
Mdadm/dev/md5-f/dev/sda5-r/dev/sda5 # Break a device in md5 and remove it
Mdadm-C/dev/md6-l6-n4/dev/sda5/dev/sda8missingmissing # form a new RAID6.
Pvcreate/dev/md6
Vgextendvg01/dev/md6 # Add RAID6 to the volume group
Pvmove/dev/md5 # key part, used to release the data in the original md5 RAID 5, which will be written to the disk in the raid 6 queue of the same volume group vg02. Here, you must wait until pvdisplay shows that all the space in/dev/md5 is released before subsequent operations can be performed.


(3) Add the Block devices in RAID 5 to md6.
Vgreducevg02/dev/md5 # Remove a physical volume
Mdadm-S/dev/md5 # Stop md5
Mdadm -- zero/dev/sda6 # Clear the information on the super block
Mdadm -- zero/dev/sda7
Mdadm/dev/md6-a/dev/sda {6, 7} # Add the block device released by RAID5S to raid6.
So far, the update is successful. Check whether the update is successful. Check whether the data in the mounted directory oracle is lost. If the data is not lost, the update is successful.
Here, you can also use iostat to view the data status of a block device. When you remove a block device or add a block device.

Recommended reading:

Debian soft RAID Installation notes-use mdadm to install RAID1

Common RAID technology introduction and demo (Multi-chart)

The most common disk array in Linux-RAID 5

RAID0 + 1 and RAID5 Performance Test Results

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.