Criando partição para RAID, tipo 0xFD
|
[root@centos md1]# fdisk /dev/md2 Command (m for help): n Select (default p): p Command (m for help): t Hex code (type L to list all codes): 8e Command (m for help): w |
Criando LVM
|
[root@centos md1]# pvcreate /dev/md2p1 Physical volume "/dev/md2p1" successfully created. [root@centos md1]# vgcreate vol_raid /dev/md2p1 Volume group "vol_raid" successfully created [root@centos md1]# lvcreate -l +100%FREE -n lv_raid vol_raid Logical volume "lv_raid" created. [root@centos md1]# mkfs.xfs /dev/mapper/vol_raid-lv_raid [root@centos md1]# mount /dev/mapper/vol_raid-lv_raid /md2/ |
Converter uma RAID1 para RAID5
|
[root@centos ~]# mdadm /dev/md2 --grow --level=5 --chunk=512 mdadm: level of /dev/md2 changed to raid5 mdadm: New chunk size (512K) does not evenly divide device size (1046976k) mdadm: After shrinking any filesystem, "mdadm --grow /dev/md2 --size 1046528" mdadm: will shrink the array so the given chunk size would work. [root@centos ~]# mdadm --grow /dev/md2 --size 1046528 mdadm: component size of /dev/md2 has been set to 1046528K [root@centos ~]# mdadm /dev/md2 --grow --chunk=512 chunk size for /dev/md2 set to 65536 [root@centos ~]# mdadm --grow /dev/md2 --raid-devices 3 mdadm: Need to backup 1024K of critical section.. |
Instalando mdadm
|
[root@centos]# yum search mdadm [root@centos]# yum -y install mdadm.x86_64 [root@centos]# man mdadm |
Parar uma RAID
|
[root@centos]# mdadm --stop /dev/md0 [root@centos]# watch -n1 cat /proc/mdstat |
Criar Raid0 (sdb + sdc) = md0 = raid0
|
[root@centos]# mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1 |
Criar Raid1 (sdd + sde) = mdq = raid1
|
[root@centos]# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdd1 /dev/sde1 |
Criar Raid5 com um…
Continue reading →