Create RAID1 for New Hard Disks via SSH/Online

Following steps are my way on delivering RAID1 (mirrored disks) via SSH in my production server. What we need is 2 new HDD which having same disk space and already plug into the server. Variables as below:

OS = CentOS 5.6 64bit
/dev/sdb = new hard disk #1
/dev/sdc = new hard disk #2
/dev/sdb1 = partition 1 hard disk #1
/dev/sdc1 = partition 1 hard disk #2
/dev/md1 = RAID1 partition after both disk mirrored
/home2 = mount point for RAID1

1. Review the information about total space and available space on a file system:

[root@centos ~] df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
47G  3.3G   41G   8% /
/dev/sda1              99M   13M   81M  14% /boot
tmpfs                 249M     0  249M   0% /dev/shm

2. Review the disk information detected in the system. Make sure /dev/sdb and /dev/sdc are in the list:

[root@centos ~] fdisk -l
 
Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        6527    52323705   8e  Linux LVM
 
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk /dev/sdb doesn't contain a valid partition table
 
Disk /dev/sdc: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk /dev/sdc doesn't contain a valid partition table

3. Install mdadm via yum:

yum install mdadm -y

Continue reading “Create RAID1 for New Hard Disks via SSH/Online” »