Software RAID on Centos 6


RAID devices are virtual devices created from two or more real block devices. Linux supports RAID1 and other levels. You need to have same size partition on both disks i.e. on second disk create partitions exactly the same size as those on the first disk, and set the type as fd (Linux raid autodetect). You need to use the following commands to create RAID5

I have disks :
/dev/sdb
/dev/sdc
/dev/sdd

#mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
RAID buliding will be start in background hence need to check the status
to this give bellow command

# watch cat /proc/mdstat

When above shows as completed and there is no progress further

You can see /dev/md0 is ready to use.
you can create lvm with this or use simple block device

# mkfs.ext4 /dev/md0
use bellow command to see status details of your configured RAID

# mdadm --query --detail /dev/md0

bellow is the output of command

[root@centos ~]# mdadm --query --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Tue Mar 10 09:03:30 2015
     Raid Level : raid5
     Array Size : 4190208 (4.00 GiB 4.29 GB)
  Used Dev Size : 2095104 (2046.34 MiB 2145.39 MB)
   Raid Devices : 3
  Total Devices : 3
    Persistence : Superblock is persistent

    Update Time : Tue Mar 10 09:06:16 2015
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : centos.mydomain.com:0  (local to host centos.mydomain.com)
           UUID : 45ee0a03:2f6ccbb7:86f4ba20:5c7b5cb6
         Events : 18

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc
       3       8       48        2      active sync   /dev/sdd



Comments

Popular posts from this blog

Running web ssh client on port 443 /80 with nginx as reverse proxy

Running cockpit behind nginx reverse proxy with nginx ssl and cockpit non ssl

Setup VOD streaming server with nginx using RTMP on Ubuntu 18.04