Linux RAID5 volumes and LVM logical volumes

Source: Internet
Author: User

LinuxRAID5volumes andLVMlogical volumes Add Disk

Add 3 hard drives, because building RAID5 volumes requires at least 3 drives

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/C1/wKiom1P0S1mS024IAAFxjSLufRg217.jpg "title=" Picture 210.jpg "alt=" Wkiom1p0s1ms024iaafxjslufrg217.jpg "/>

to restart, Linux to identify newly added hard drives

# reboot

View all hard disk devices and information in the system

[Email protected] ~]# fdisk-l

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/C1/wKiom1P0S2aT4NgCAAPHyVhalLg180.jpg "title=" Picture 211.jpg "alt=" Wkiom1p0s2at4ngcaaphyvhallg180.jpg "/>

Planning Disks

planning sdb:

[Email protected] ~]# Fdisk/dev/sdb

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/C1/wKiom1P0S3STa_RGAAD8uwXkhNc153.jpg "title=" Picture 212.jpg "alt=" Wkiom1p0s3sta_rgaad8uwxkhnc153.jpg "/>

change Partition to FD (RAID volume )

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/46/C2/wKioL1P0TJvjt15KAAHWDKW3Sb0230.jpg "title=" Picture 213.jpg "alt=" Wkiol1p0tjvjt15kaahwdkw3sb0230.jpg "/>

Planning for SDC is the same as planning SDB

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/C1/wKiom1P0S5LgnCBCAANQAS6Bog4243.jpg "title=" Picture 214.jpg "alt=" Wkiom1p0s5lgncbcaanqas6bog4243.jpg "/>

planning for SDD is the same operation

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/46/C1/wKiom1P0S5-hz2ceAAK_4x6oSvM099.jpg "title=" Picture 215.jpg "alt=" Wkiom1p0s5-hz2ceaak_4x6osvm099.jpg "/>

installationMdadmPackage

Create RAID5 , need to install Mdadm Package

[Email protected] ~]# mount/dev/cdrom/mnt/cdrom/

Mount:block device/dev/sr0 iswrite-protected, mounting read-only

[Email protected] ~]# cd/mnt/cdrom/packages/

[Email protected]]# ls mdadm*

mdadm-3.2.5-4.el6.x86_64.rpm

[Email protected]]# rpm-ivh mdadm-3.2.5-4.el6.x86_64.rpm

Warning:mdadm-3.2.5-4.el6.x86_64.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey

Preparing ... ###########################################[100%]

Package mdadm-3.2.5-4.el6.x86_64 is already installed

CreateLvmLogical Volumes

-C,--create: Create a new array

-L,--level=: sets the RAID level. this is RAID5

-N,--raid-devices=: Specifies the number of available device in the array , here is 3, which represents 3 hard Drives

Sd[bcd]1, the whole meaning of sdb1,sdc1,sdd1 represents 3 partitions

[Email protected]]# mdadm-c/dev/md5-l5-n3/dev/sd[bcd]1

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/C1/wKiom1P0S67isEstAADVmntaU4c950.jpg "title=" Picture 216.jpg "alt=" Wkiom1p0s67isestaadvmntau4c950.jpg "/>

Create PV Physical volume, converting/DEV/MD5 to physical volume

[[Email protected] ~] #pvcreate/dev/md5

Physical volume "/DEV/MD5" successfully created

Create VG Volume Group, /DEV/MD5 created as a volume group, named VG

[[Email protected] ~] #vgcreate vg/dev/md5

Volume Group "VG" successfullycreated

View System Volume Group information

[[Email protected] ~] #vgdisplay

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/46/C3/wKioL1P0TNHAUEK_AAEuOr_-bPA393.jpg "title=" Picture 217.jpg "alt=" Wkiol1p0tnhauek_aaeuor_-bpa393.jpg "/>

Create LV Logical Volume

in a volume group Create a logical volume named LV in VG with a capacity size of 39GB

[[Email protected] ~] #lvcreate-L 39g-n LV VG

Logical volume "LV" created

format Mail logical Volume , file system for EXT4

[Email protected] ~]# mkfs-t EXT4/DEV/VG/LV

CreateRAID5

Create a directory under the root directory with the name RAID5

[Email protected] ~]# MKDIR/RAID5

mount a logical volume under /raid5

[Email protected] ~]# mount/dev/vg/lv/raid5/

Check your hard drive usage to see /RAID5

[Email protected] ~]# DF-HT

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/C3/wKioL1P0TOGyVfriAAEsFWncIwc948.jpg "title=" Picture 218.jpg "alt=" Wkiol1p0togyvfriaaesfwnciwc948.jpg "/>

Edit the configuration file of the system mount directory to enable automatic mount

[Email protected] ~]# Vi/etc/fstab

Last line add

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/C3/wKioL1P0TO3ToABzAACeo0bVrJc724.jpg "title=" Picture 219.jpg "alt=" Wkiol1p0to3toabzaaceo0bvrjc724.jpg "/>

Create the directory AAA under /RAID5, Create a successful, description RAID5 volume to complete the creation.

[Email protected] ~]# CD/RAID5

[[email protected] RAID5] #mkdir AAA

[[email protected] RAID5] #ll

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/C1/wKiom1P0S9_jRR8UAADCXnS9Fjs273.jpg "title=" Picture 220.jpg "alt=" Wkiom1p0s9_jrr8uaadcxns9fjs273.jpg "/>


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.