Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2

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 Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  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...

28 Responses

  1. ali nesary says:

    Thanks for this

  2. Josh Van Kley says:

    Thanks for this. I stumbled through countless write ups and reference material before reaching your article. I was able to spin up my secondary RAID 0 caching array easily while following your guide.

  3. Hello,

    Please correct the spelling of word ” defaults” not “deaults” in the entry of fstab file

    Thanks

  4. June says:

    I was able to follow up to step 6. There wasn’t any /etc/mdadm.conf file so I created one, but I couldn’t save the config.

    Here is the script

    [vagrant@localhost ~]$ sudo mdadm -E -s -v >> /etc/mdadm.conf
    -bash: /etc/mdadm.conf: Permission denied

    Please advice on how I can troubleshoot.
    Thanks a lot :)

  5. Mark Miller says:

    Hello, I am getting an error message at Step 4:
    [root@localhost fs1]# mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1
    mdadm: cannot open /dev/sdb1: Device or resource busy

    How can I fix this?

    Regards, Mark

  6. Mark Miller says:

    [root@localhost fs1]# mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1
    mdadm: cannot open /dev/sdb1: Device or resource busy

    • Please try to stop the RAID set md0
      Then reset the superblock for sdb1
      Remove the partition and recreate it.
      Please go through other RAID topics you will find the solution which i have provided in comments.

  7. Raghu S says:

    [root@raghu@example ~]# more /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Sat Sep 20 14:54:34 2014
    #
    # Accessible filesystems, by reference, are maintained under ‘/dev/disk’
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=afe2e861-fd68-46bd-a8ef-44da85166195 / ext4 defaults 1 1
    UUID=721422a7-a533-4cff-93fc-bc0249e95f96 /boot ext4 defaults 1 2
    UUID=41677dce-cc0e-4f0c-b924-f76b2bb753a6 swap swap defaults 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    sysfs /sys sysfs defaults 0 0
    proc /proc proc defaults 0 0
    /dev/md0 /mnt/raid0 ext4 deaults 0 0

    /dev/mapper/vg_tec-lv_tec /mnt/lv_tec ext4 deaults 0 0

  8. Raghu S says:

    Hi Babin Lonston,

    have followed your steps in my Vm , works good, But after i reboot my Vm everything is gone (Including Raid also ) !!!

    Fstab entry also i did .

    [root@raghu@example ~]# more /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Sat Sep 20 14:54:34 2014
    #
    # Accessible filesystems, by reference, are maintained under ‘/dev/disk’
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=afe2e861-fd68-46bd-a8ef-44da85166195 / ext4 defaults 1 1
    UUID=721422a7-a533-4cff-93fc-bc0249e95f96 /boot ext4 defaults 1 2
    UUID=41677dce-cc0e-4f0c-b924-f76b2bb753a6 swap swap defaults 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    sysfs /sys sysfs defaults 0 0
    proc /proc proc defaults 0 0
    /dev/md0 /mnt/raid0 ext4 deaults 0 0

    /dev/mapper/vg_tec-lv_tec /mnt/lv_tec ext4 deaults 0 0
    [root@raghu@example ~]# mount -a
    mount: special device /dev/md0 does not exist
    mount: special device /dev/mapper/vg_tec-lv_tec does not exist

    EXPECTING YOUR SUGGESTION !!!!!!!

    Thanks
    Raghu S

    • @Raghu adding fstab entry is not enough, you need to save the raid configuration using below command.

      mdadm -E -s -v >> /etc/mdadm.conf

      Pretty sure you have not done the below steps so only you have lost the RAID after a restart.

Got something to say? Join the discussion.

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

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?