Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Hosting referral link if you planning to start your blog ($3.82/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Babin Lonston

I'm Working as a System Administrator for last 10 year's with 4 years experience with Linux Distributions, fall in love with text based operating systems.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

52 Responses

  1. charly says:

    thanks a million, I’ve used this tutorial two times as a Debian noob to set it up in my VM first and then a full machine :)

  2. Nizam says:

    Hello,

    I was wondering, If I have RAID 1 already configured on my server with drive sda and sdb, Now I want to add two new drives sdc and sdd, Can i make raid 1 with new drives on the same server and if Yes, Will it impact anything?

  3. Robert M. Koretsky says:

    There is no reply to this comment made by linuxonin:

    “Hi Babin, thanks for your reply but what I mean is what if i want to add my existing installed OS (CentOS) as a pair of my sdb device to make it Raid1 so it should be sda (OS installed) and sdb as Raid1.

    Is there any steps I need to follow? this one should not work because sda is currently busy running as OS.”

    Is what linuxonin saying impossible? Is it something anyone would want to do on Debian/Slackware(opensuse)/Redhat(CentOS7)? If so, why is there no documentation on how to mirror the system disk on any of the major distros?

    • @Robert,
      //what if i want to add my existing installed OS (CentOS) as a pair of my sdb device to make it Raid1 so it should be sda (OS installed) and sdb as Raid1.//

      You will loose your Operating system. It’s not possible to add and existing OS installed drive to a RAID array..

      While the initial installation you need to setup the required RAID level and make an RAID1 or RAID5 then you need to install the Operating system on it.

      Here an example a physical HP server have 6 local disks with 300 GB each, We used to create a RAID array in 2 disks with the RAID1 level then we boot the server from RHEL or centos DVD to start the installation. You will get a Single disk of 300GB in OS level. Actually, there will be two disks if one fails you will still survive you can replace the faulty disk and you can recover it from parity.

      Now you have 4 free disks each 300GB of a size, You need to create a separate array to store user data’s. Ok, it’s done.

      If you try to add the existing OS installed disk to a new array you can’t add it. In the physical server, it will mark as already used in a different array.

      Even if you try to add in software raid it won’t allow, you need to dismantle your array to free your disk before adding it to a new array set.

      // this one should not work because sda is currently busy running as OS.”//

      You asked question and you have answered yourself, dear

      // Is what linuxonin saying impossible? //

      Yes it’s not possible to add a OS disk to RAID array. You will loose Operating system.

      // how to mirror the system disk on any of the major distros? //

      According to your RAID LEVEL you have the mirroring features except RAID 0

  4. Riso says:

    Hi, thanks for this article, I’ve got a problem when I want to unplug SDC in settings/storage in VB its grey so i could not even click on remove option then i tried deleting it from VB VMs but then Linux wont even start… so if you could help me somehow thanks

  5. linuxonin says:

    Thank you for creating this article, very great help. I have 1 question/concern on this:

    You used an example here the drives sdb and sdc, so you have no conflict to do it. How about if I want to raid1 my existing drive which is sda, would that be the same steps that you did here?

    • @linuxonin,

      Here sda installed with OS ( centos ) for raid array we have used sdb, sdc.

      Yes same steps.

      • linuxonin says:

        Hi Babin, thanks for your reply but what I mean is what if i want to add my existing installed OS (CentOS) as a pair of my sdb device to make it Raid1 so it should be sda (OS installed) and sdb as Raid1. Is there any steps I need to follow? this one should not work because sda is currently busy running as OS.

  6. jtl says:

    Hello. Thank you for writing this article. After unplugging a drive and seeing the data is still available, when I plug the drive back in, what do I do? In other words, how do I repair/replace a failed hard drive in RAID1?

  7. Naguinix says:

    Beautiful, Thanks a lot from Colombia !

  8. Charles R says:

    Using Ubuntu 15.10 the mount command will cause the OS not to boot. It tested fine via the above instructions (I had moved GBs of data to it before booting) however when booting Ubuntu stated /dev/md0 didn’t exist. I had to boot off a USB stick and remove the mount from fstab. Then it booted fine and I used the Disks app to auto mount the RAID. Which works great.

    Also mdadm.conf is located in /etc/mdadm/.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 257,757
  2. 11,967
  3. 39,682

Are you subscribed?