1

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.

Thanks in Advance.

2
  • Hopefully truly needless to ask, but: 1. Any data already on it? 2. Do you have TESTED backups. 3a). If it just is a clean install so far just reinstall, either with HW raid or SW RAID (The Linux SW RAID is pretty good and more flexible than some HW RAID). 3b). If you need to keep the setup. First refer to the back up part, then read up on MD, then test backups again and add to the post what your goal is.
    – Hennes
    Commented Jan 5, 2022 at 11:52
  • Hi, In response to your comments: 1. Yes, we have all the data stored in the drive sda (also an Application server is running in this machine). 2. We do have the backup of the data. 3. Before reinstalling the whole server, It would be great to find a way to fix this issue by moving the boot partition from drive sdb to sda. since the drive sbd is failing/failed. and the drive sdb can be replaced if its failed. It would be a great help to fix this issue and successfully configure RAID1.
    – Surya H
    Commented Jan 6, 2022 at 11:32

1 Answer 1

0

The /boot/efi partition cannot exist on the raid partition. therefore, it is more correct to use an sdb disk. Create a raid1 from sdb3 in a degraded state, e.g:

mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb3

Create appropriate LVM partitions on it, add them to the Volume Group - and move the data around(pvmove). Then you can format sda - and create a similar partition structure - add to the array on sdb

PS. The system should have one partition with /boot/efi - so some work will have to be done to be able to boot from any of the disks. Google: dosfstools + EFI + RAID

2
  • Hi Zersh, Thanks for taking your time and replying. I would like to inform you that the drive sdb is failed/failing, because of which I cannot move the data from sda to sdb. I have edited my post as well. Kindly let me know for any other possible ways to fix this. Your help is much appreciated.
    – Surya H
    Commented Jan 10, 2022 at 9:51
  • Then plug the New disk into the server without shutting it down (hot-add). You will have 3 disks in the server and you can move the boot partition to it first, then create an array and move the data.
    – zersh
    Commented Jan 10, 2022 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .