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. Get your own self-hosted blog with a Free Domain at ($3.95/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...

32 Responses

  1. Amit Bhatt says:

    Is it possible to monitor RAID0 failover events. I set-up RAID 0 on a test environment with 2 disks of 1 GB each. Then i removed one of the disk of the disk on a running system. But still I am able to work properly on my RAID 0 filesystem of 2 GB i.e. I am able to create a new file of 2GB.

    Although I have monitor mode setup via mdadm but i believe thats not gonna work as the man page suggests “Monitor one or more md devices and act on any state changes. This is only meaningful for RAID1, 4, 5, 6, 10 or multipath arrays, as only these have interesting state. RAID0 or Linear never have missing, spare, or failed drives, so there is nothing to monitor.”

    So id there there any other way by which whenever a RAID0 disk fails we can get an alert of corruption message while doing anything on filesystem.

    Thanks in advance…..Waiting for your reply..

    • @Amit,

      Yes, we can setup an email alert as below. This will trigger the email when an error or failure in array md0.

      # mdadm –monitor –daemonise –[email protected] –delay=1800 /dev/md0

      Thanks & Regards,
      Babin Lonston

      • Amit Bhatt says:

        Thanks Bobin. This does not seems to be working. However when i am trying to send a test mail using :

        /sbin/mdadm –monitor –scan –test

        then i am getting an e-mail in my mail box.

        Regards,
        Amit

  2. ali nesary says:

    Thanks for this

  3. 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.

  4. Hello,

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

    Thanks

  5. 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

    [[email protected] ~]$ sudo mdadm -E -s -v >> /etc/mdadm.conf
    -bash: /etc/mdadm.conf: Permission denied

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

  6. Mark Miller says:

    Hello, I am getting an error message at Step 4:
    [[email protected] 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

  7. Mark Miller says:

    [[email protected] 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.

  8. Raghu S says:

    [[email protected]@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

  9. 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 .

    [[email protected]@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
    [[email protected]@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.

      • Pow says:

        I did it but just after i restart the system everything i did just vanished, in the first step of booting the “os” i get this message “Wait for mounting press S for skip mounting….”

Got something to say? Join the discussion.

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