We have a server (HP ProLiant ML10 Gen 9) that came with Two Identical Hard disks. It was assumed that the server supports hardware RAID 1 (Mirror), and the CentOS-7 was installed in it. But later we got to know that the server doesn't support Hardware RAID1 and also the software RAID1 was not configured properly.
lsblk output shows like this
[root@himalaya ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
└─md126 9:126 0 1.8T 0 raid1
├─md126p1 259:0 0 200M 0 md
├─md126p2 259:1 0 1G 0 md
└─md126p3 259:2 0 1.8T 0 md
├─cl_himalaya-root 253:0 0 50G 0 lvm /
├─cl_himalaya-swap 253:1 0 7.8G 0 lvm [SWAP]
└─cl_himalaya-home 253:2 0 1.8T 0 lvm /home
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 200M 0 part /boot/efi
├─sdb2 8:18 0 1G 0 part /boot
└─sdb3 8:19 0 1.8T 0 part
sr0 11:0 1 4.1G 0 rom
cat /proc/mdstat output shows like this
[root@himalaya ~]# cat /proc/mdstat
Personalities : [raid1]
md126 : active raid1 sda[0]
1953511424 blocks super external:/md127/0 [2/1] [U_]
md127 : inactive sda[0](S)
3160 blocks super external:imsm
unused devices: <none>
As you can see in the above pictures the boot partition is in drive sdb whereas the root (/) partition and other files are in the drive sda.
Unfortunately the harddisk partitions are not identical. Now I want to create a software RAID1 without deleting my content from drive sda. So I kindly request someone to help me on how to move the boot partition from the drive sdb to drive sda. (the drive sdb can be formatted after moving the boot partitions to sda). and then how to create identical partitions and configure RAID1 Array.
Please Note: That Drive sdb seems to be failed/failing. And the /boot partition is located in this drive sdb. But before replacing the harddisk I want to find a way to fix this.
[root@himalaya ~]# fdisk -l
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 3907022847 1953511423+ ee GPT
Partition 1 does not start on physical sector boundary.
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 3907022847 1953511423+ ee GPT
Partition 1 does not start on physical sector boundary.
WARNING: fdisk GPT support is currently new, and therefore in an experimental ph ase. Use at your own discretion.
Disk /dev/md126: 2000.4 GB, 2000395698176 bytes, 3907022848 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: 4C553ADE-504A-495C-9195-7B11C068ED27
# Start End Size Type Name
1 2048 411647 200M EFI System EFI System Partition
2 411648 2508799 1G Microsoft basic
3 2508800 3907020799 1.8T Linux LVM
Disk /dev/mapper/cl_himalaya-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/cl_himalaya-swap: 8321 MB, 8321499136 bytes, 16252928 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/cl_himalaya-home: 1937.1 GB, 1937093165056 bytes, 3783385088 se ctors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Thanks in Advance.