Configure Software RAID 1 in Centos



  • Hi All,
    Good Morning.I have configured the RAID1 in centos 6.2 by 2*250 GB hard disk. I checked my RAID1 by booting the system in single hard disk but the hard disk does not booted and also made one hard disk as failed and added new hard disk and synched the data from one hard disk and also checked the synched hard disk which was not booting in single hard disk.I have installed the grub in two hard disk and tried the same issue coming.The error I saw was "Kernal Panic Error". Can anyone help me to solve this issue.


  • Service Provider

    I'm sure that this is not the issue as 6.2 is very stable, but why are you on 6.2? That's many years unpatched. All CentOS 6 systems should be on 6.5 as of quite a long time ago. You need to get those systems updated, you are missing hundreds or thousands of important patches, including a few really epic ones (like Heartbleed.)


  • Service Provider

    How did you make it boot to a single disk?


  • Service Provider

    What process did you use to create the array?


  • Service Provider

    What is the output of...

    cat /proc/mdstat
    

    When you have the system running?



  • @scottalanmiller
    My Client is using the Centos 6.2 and I am configuring the RAID 1 in Centos 6.2.I have confirmed the RAID 1 by the cat /proc/mdstat.Then I booted the system with the two hard disk at the same time and then I booted the hard disk which was synched the data was alone booted by disconnecting the other hard disk from the system from the motherboard.Then the system was booted to see the data in Centos but it was booting without the other hard disk


  • Service Provider

    Why are you disconnecting a drive from the motherboard? Is this not a production system and you are just testing to see what would happen in the case of a full hardware failure?


  • Service Provider

    @Lakshmana said:

    Then the system was booted to see the data in Centos but it was booting without the other hard disk

    I don't understand this line.



  • @scottalanmiller There are two hard disk(sda,sdb) with RAID 1 where one of the hard disk (sdb) is made as failure and that was removed successfully.Then new hard disk(sdc) is added after removing the sdb and after that sdc is added successfully and now sda,sdc are present with RAID 1 which was resynched the data properly.When I connect only sdc to check whether the data is present in sdc alone the hard disk does not boot into Centos.When I connect two hard disk sda,sdc means the OS is booting without any issue.And I tried to boot with sda alone but the sda alone is not booted properly.The system is not production system.The system is being tested and this testing method to be implemented in Client to save data from the File Server


  • Service Provider

    @Lakshmana said:

    When I connect only sdc to check whether the data is present.....

    This should never happen. You should not be doing this. RAID is a single subsystem and you should not be poking around in it. You are trying to do things that are not meant to be done. Don't attempt to look at individual disks. That is not meant to ever happen. Just because it can be done doesn't mean that it is a good idea.


  • Service Provider

    If you want to find out if the data is all on the disk, use the MD stat file we looked at above, it tells you the status of the data on the disk.



  • @scottalanmiller Ok Sir.But my manager said that he needs to see the data to be present in the individual hard disk so only trying to see the data in individual disk.Why this cannot be done.Can you please say


  • Service Provider

    @Lakshmana said:

    @scottalanmiller Ok Sir.But my manager said that he needs to see the data to be present in the individual hard disk so only trying to see the data in individual disk.Why this cannot be done.Can you please say

    Tell him "too bad." He doesn't understand what he is asking. What he wants will cause data loss. He needs to educate himself on RAID before he starts making demands. Just because a manager tells you to break things, doesn't mean that you should just break them. If he doesn't want the system to work, make sure everyone is aware that he is demanding that it be broken.



  • @Lakshmana said:

    @scottalanmiller Ok Sir.But my manager said that he needs to see the data to be present in the individual hard disk so only trying to see the data in individual disk.Why this cannot be done.Can you please say

    a RAID is not a backup. It's not meant to be used in this manner,


  • Service Provider

    @Lakshmana said:

    Why this cannot be done.

    Because you are breaking the RAID system. RAID is never meant to be torn apart and used in parts. The array is a singular storage system. When you break it apart not everything is there, and worse, the system now has failed components and needs to repair. Even if you found what you needed, now things are broken and files all have to be copied again.

    It's like Schrodinger's cat. If you open the box, you ruin everything.

    You need to use the RAID tools and let RAID do its job. If he doesn't trust the RAID, why are you using it?



  • @thecreativeone91 Whether that method is not possible with the one hard disk Sir.You said that the data loss may be occured but I tried the process by booting sda hard disk alone in rescue mode and seen the data with out any loss in the shell mode.


  • Service Provider

    @Lakshmana said:

    @thecreativeone91 Whether that method is not possible with the one hard disk Sir.You said that the data loss may be occured but I tried the process by booting sda hard disk alone in rescue mode and seen the data with out any loss in the shell mode.

    The data loss is not at this time, it is when you go to use the system again. What is the purpose of a storage system that you "break" to verify? That doesn't work. How will you use this once it is in production?



  • What was the point of this? if the raid failed you just put a new one in and rebuild it. The RAID Controller/Software will report when a raid is degraded, there is no need to "check it" manually.


  • Service Provider

    @thecreativeone91 said:

    What was the point of this? if the raid failed you just put a new one in and rebuild it. The RAID Controller/Software will report when a raid is degraded, there is no need to "check it" manually.

    "Checking it" is what will break things, too. It's just pointless, it is actually reckless and self defeating. If you want to ensure that the data is good, you can't do it this way.



  • @scottalanmiller said:

    you can't do it this way.

    Ok Sir.I will explain this to my Manager and after that I acknowledge you sir



  • @scottalanmiller Screenshot from 2015-03-02 19:04:32.png
    Sir Please refer this image one person said me that RAID 1 member can be boooted by installing bootloader.Whether it is possible Sir.I don't know about that one small doubt came after this image seen


  • Service Provider

    Yes, in case of a broken RAID array you can install a bootloader, of course. But that doesn't change that what you are doing should not be done. This is for cases where the other drive is broken, not when a manager asks you to damage the system.



  • @scottalanmiller Ok 😄 I understood.I went to Manager said that it cannot be done and the RAID configured device will lost the data and this is impossible.But he ask the explanation behind this and said to explain briefly



  • I'm a bit lost - is @Lakshmana using hardware RAID or software RAID inside CentOS?

    If it's hardware RAID, and he pulls a drive, won't the system always work? because both drives are suppose to be identical?

    If it's software RAID, then I understand why he has failures.



  • @Dashrender Its Sofware RAID1


  • Service Provider

    @Lakshmana said:

    @scottalanmiller Ok 😄 I understood.I went to Manager said that it cannot be done and the RAID configured device will lost the data and this is impossible.But he ask the explanation behind this and said to explain briefly

    It's not that it is impossible, of course it can be done, the problem is is that you break the RAID device so the system is broken. So you are "checking" data that is no longer valid. You can verify that the RAID was working, but you've broken that RAID device and are starting over. So there was no value in checking it because now you have to rebuild it and.... check again? The act of checking it breaks the array.


  • Service Provider

    @Dashrender said:

    I'm a bit lost - is @Lakshmana using hardware RAID or software RAID inside CentOS?

    Linux MD RAID.



  • No wonder pulling a drive causes this to fail.


  • Service Provider

    @Dashrender said:

    If it's hardware RAID, and he pulls a drive, won't the system always work? because both drives are suppose to be identical?

    It's not hardware but hot swap that enables this. You can easily do this with MD RAID too, if done correctly. The problem is, the moment that you do this, the drive that you pull is out of date and no longer a valid member of the array. So anything that you "check" is now ruined AND you are running without RAID until you replace the drive and it rebuilds. So the thing that you check gets blown away the instant that you check it.



  • @scottalanmiller said:

    @Dashrender said:

    If it's hardware RAID, and he pulls a drive, won't the system always work? because both drives are suppose to be identical?

    It's not hardware but hot swap that enables this. You can easily do this with MD RAID too, if done correctly. The problem is, the moment that you do this, the drive that you pull is out of date and no longer a valid member of the array. So anything that you "check" is now ruined AND you are running without RAID until you replace the drive and it rebuilds. So the thing that you check gets blown away the instant that you check it.

    I completely understand that - and maybe @Lakshmana does as well. So the act of testing this only proves the system will continue to function while the system is running, but probably won't survive if you reboot the system or power it down and back up. And once you put reattach a drive, even if it's the original one you pulled for the test, it has to be completely rebuilt. But pulling the drive does prove if the system is working or not.