Linux storage experiment 2: RAID operations

Source: Internet
Author: User
Linux storage experiment 2: RAID operating Linux storage experiment 1: creating a file system on a hard disk... Linux storage experiment 2: RAID operations

Linux storage experiment 1: creating a file system http://www.2cto.com/ OS /201303/194226.html on a hard disk
The basic knowledge part is not detailed design, in short several common patterns: raid0, raid1, raid0-1 or raid1-0, raid5 different models between the most desired goal is different, its storage efficiency and security are also different. (1) create RAID www.2cto.com Step 1: Create 5 10 mb scsi hard disks Setting-> hard disk-> add... fdisk/dev/sdb: the partition is/dev/sdb {5, 6, 7, 8, 9}. all of these are logical partitions. Step 2: creating Raid 5 + 1 hotspare raid with four hard disks requires at least three devices mdadm -- create -- auto = yes/dev/md0 -- level = 5 -- Raid-devices = 4 -- spare-device = 1/dev/sdb {5, 6,, 9} then our RAID 5 was built. one hot backup disk will be automatically replaced if it is damaged in the future. In addition,/dev/md0 is our raid5 code. in the future, all operations will be replaced by/dev/md0. Step 3: view the composition of RAID mdadm -- detail/dev/md0: the information shown above is displayed. four partitions are used for raid and one is used for spare device. Step 4: create a file system mkfs-t ext3/etc/md0 on a RAID device Step 5: mount and perform a read/write test mkdir/mnt/raid mount/dev/md0/mnt/raid Step 6: import the definition of the RAID device to/etc/mdadm. conf to enable the RAID device to take effect after each restart. configuration file:/etc/mdadm. conf, you need to know that UUID obtained UUID: mdadm -- detail/dev/md0 | grep-I UUID write format: ARRAY/dev/md0 UUID = UUID step obtained by the preceding query Step 7: set automatic mounting vi/etc/fstab write:/dev/md0/mnt/raid ext3 defaults 1 2 umount/mnt/raid mount-a Step 8: Restart the OS, view RAID information (2) hot backup disk Step 1: Mount and perform continuous read/write operations before mounting. Cp-a/etc // var/log // mnt/raid Step 2: run the following command to simulate the damage of a hard disk in RAID: mdadm -- manage/dev/md0 -- fail/dev/sdb8 mdadm -- detail/dev/md0: 1. if one device breaks down and the device is/dev/sdb8 is displayed below, the/dev/sdb9 used as the hot backup disk (spare device) will automatically replace the broken disk, continue to use. Step 3: Use commands to simulate a damaged hard disk as a hot backup disk and add it to RAID. here, we add the/dev/sdb1 (the primary partition) to the RAID disk as a hot backup disk, remove/dev/sdb8 mdadm -- manage/dev/md0 -- add/dev/sdb1 -- remove/dev/sdb8 mdadm -- detail/dev/md0, /dev/sdb0 is used as a hot backup disk. now Failed Devices is 0. Step 4: Check the RAID composition ....
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.