Software RAID on Linux with mdadm

Now that we've completed our initial examination of the basics of RAID levels (including Nested RAID) it's time to turn our attention to RAID functionality on Linux using software. In this article we will be discussing mdadm -- the software RAID administration tool for Linux. It comes with virtually every Linux distribution and has some unique features that many hardware RAID cards don't.

RAID Controllers

We’ve spent a great deal of time examining various RAID levels such as RAID-0, 1, 5, and 6, and Nested RAID levels such as RAID-10, 50, 51, 61, and 60 or even the more complicated RAID-100 or RAID-160. In all of these discussions we have assumed there was a RAID “controller” that performed the various RAID operations. This includes sending chunks of data to the appropriate disks, computing parity, hot-swapping, disk fail-over, checking read transactions to determine if the read was successfully and if not, declaring that disk as “down”, plus other important tasks related to RAID. All of these tasks require some sort of computation and have to be performed by a RAID controller.

You really have two options for RAID controllers: (1) a dedicated RAID controller such as those on add-in RAID cards, (2) software RAID that uses the CPU for RAID chores. In the first case you have a dedicated RAID controller, typically on an add-in RAID card but it can be on a motherboard, that performs the necessary RAID computations. This controller typically uses a dedicated lower power processor, often a real-time processor such as a PowerPC, to perform the computations. Typically these controllers are put on an add-in card and you plug the drives you want in the RAID array into the card.

With software RAID, all the RAID functions run on the CPU. Pretty much all Linux distributions comes with software RAID in the form of md (Multiple Device) which is a driver within Linux that provides virtual devices created from one or more underlying devices (e.g. storage block devices). Plus the great thing is that it comes with almost all Linux distributions so you have access to the source (plus the price isn’t too bad either and it has a great deal of functionality). In addition, you can create Nested RAID configurations as needed since all RAID functions are in software (I smell a Triple Lindy coming).

One thing you have to be very careful about is what is commonly called a fakeRAID card or fakeRAID controller. FakeRAID is not hardware RAID because there is no dedicated RAID controller. Rather, they use a standard disk controller chip on an add-in card or motherboard, with some specialized firmware and drivers. At boot-time they run a special application that allows users to configure disks attached to the fakeRAID as a RAID group. But the RAID processing is really handled by the drivers which are run on the CPUs (so the CPU provides the computational power). Consequently, it’s really a software RAID solution and not hardware RAID (hence the name “fakeRAID”).

There is a great deal of discussion and grinding of teeth within the Linux community about fakeRAID. One point of the discussions is that the vendors of fakeRAID don’t tell customers that what they are actually buying is not a RAID card with a dedicated RAID controller, but rather a simple card with a disk controller coupled with drivers that use the CPU for RAID processing (false advertising). Plus there is the additional problem of developing and supporting drivers for Linux to allow these fakeRAID cards to be used. Moreover, there is a strong argument that it is probably better to use software RAID that comes with Linux (md) since it is already part of Linux and can arguably give you better performance.

However, if you want to use software RAID that comes with Linux in the kernel (md), you still need some tools to control/manage/monitor the software RAID arrays. That’s where mdadm comes in. This article will do a brief examination of mdadm and some of its options.

Introduction to mdadm

Mdadm is a software tool primarily written by Neil Brown that allows you to create, assemble, report on, grow, and monitor RAID arrays that use software RAID in Linux. Actually according to the documentation there are seven modes of operation:

  1. Create
  2. Assemble
  3. Follow or Monitor
  4. Build
  5. Grow
  6. Manage
  7. Misc

We’ll walk through these various modes of operation but the focus of this article is an introduction and not an in-depth HOWTO. You can find those types of articles on the web.

The first step in using mdadm, or any RAID for that matter, is to PLAN your RAID configuration carefully. Personally I like to work backwards starting with the purpose of the storage. Will it be used for a database? Will it be used for /home? Will it be used for high-speed scratch? Will it be used for data that requires a very high degree of reliability? Understanding the intent of the storage is really the key to creating the RAID configuration you need/want. Once you determine the storage use case, you need to develop an idea of how much I/O performance you need (throughput and IOPS) and the general ratio of read and write performance. You should also develop an idea of how much data redundancy you need for the storage.

Once you have an idea of the performance and redundancy of the array you can select the RAID configuration you think you might need. I would suggest you select a few candidate RAID configurations and then do some more reading/research on each one and select the RAID configuration that seems to be best. During this research be sure to examine the redundancy as well as the performance of the various RAID configurations and compare them to your estimations. But also be sure to examine the capacity and storage efficiency of each level. You may love the performance and storage efficiency of RAID-10 but the data redundancy may not be enough for you. Or you may love the data redundancy of RAID-61 but you may not willing to give up the performance or, perhaps more importantly, you may not be willing to have such low storage efficiency (especially if this is for your home system).

But just choosing the RAID configuration you want is not the end of your planning. You need to also consider a number of other things. Perhaps the most important thing you need to consider is if you will need to grow/shrink the storage. The reason this is important is because you are likely to have to use LVM (Logical Volume Manager) either on top of Linux software RAID or underneath it. This forces you to carefully consider how to build both LVM and software RAID and how you expand either one or both. I would recommend walking through the expansion steps to make sure you understand how to do it (you could even pass along your ideas to someone else to have another pair of eyes examine them).

One other thing you should consider before implementing your well formulated and thought-out RAID plan is the file system that sits on top of the storage. Based on your usage model for the storage, select one or two candidate file systems. Then do some research on each one to find out what problems or limitations exist, and also how you can optimize each file system for better performance (we’re all performance junkies at heart). There are a number of articles on the web that discuss tuning file systems with Linux software RAID.

Assuming that you have done your careful planning (including a backup solution), let’s move on to the first “mode” of mdadm, Creating a RAID array.

Creating a RAID array

Mdadm allows you to create a RAID array using Linux block devices. During the creation of the array, per-device superblocks are created for the RAID array (allows for the array to be assembled correctly). Using the “create” mode is the most common method for building the array and is recommended if you are just starting to use mdadm.

The basic mdadm command for creating a RAID array is fairly simple with the following generic command and typical options.

mdadm --create [md-device] --chunk=X --level=Y --raid-devices=Z [devices]

where the options are as follows:

    -c, –chunk= Specify chunk size in kibibytes. The default is 64.

    -l, –level= Set raid level, options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4, raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty

    -n, –raid-devices= Specify the number of active devices in the array.

Comments on "Software RAID on Linux with mdadm"

It’s going to be end of mine day, except before ending I am reading this wonderful
article to increase my knowledge.

My site :: Canadian Pharmacies Shipping To Usa

I simply want to tell you that I am very new to weblog and honestly savored your blog site. Most likely I’m want to bookmark your blog post . You actually have incredible well written articles. Bless you for revealing your web-site.

I truly appreciate this post.Thanks Again. Cool.

Hey there I am so excited I found your web site, I really found you
by error, while I was researching on Google
for something else, Anyways I am here now and would
just like to say cheers for a fantastic post and a all round
exciting blog (I also love the theme/design), I don’t have time to
browse it all at the minute but I have bookmarked it and also added in your
RSS feeds, so when I have time I will be back to read more, Please do
keep up the excellent work.

Look at my page; Canadadrugpharmacy com

Hi there fantastic website! Does running a blog such as this require
a lot of work? I have no knowledge of programming but I had been hoping
to start my own blog in the near future. Anyway,
should you have any suggestions or tips for new blog owners please share.
I understand this is off subject however I simply wanted to ask.

Thank you!

Feel free to surf to my site; Epharmacy

This post is worth everyone’s attention. Where can I find out more?

Here is my homepage: Pharmacie francaise en ligne cialis

I am curious to find out what blog platform you happen to be utilizing?
I’m experiencing some small security problems with my latest blog and I would like to find something
more risk-free. Do you have any suggestions?

my page – Order generic cialis online canada

I’m extremely impressed together with your writing abilities as well as with the layout for your weblog.
Is this a paid subject or did you customize it your self?
Anyway stay up the excellent quality writing,
it’s rare to peer a great blog like this one nowadays..

Also visit my website – Cialis 10mg prix pharmacie

Hi, i read your blog occasionally and i own a
similar one and i was just curious if you get a lot of spam feedback?
If so how do you protect against it, any plugin or anything you
can advise? I get so much lately it’s driving me mad
so any assistance is very much appreciated.

My site: Drug lookup

Yes! Finally something about cialis without prescription in canada.

Also visit my blog post Drug stores canada

What’s up, the whole thing is going fine here and ofcourse
every one is sharing information, that’s truly fine, keep up writing.

Check out my web site: Safe online pharmacy cialis

Really informative blog.Really thank you! Fantastic.

You ougght too be a part of a contest for one of the greatest websites on the net.

I will recommend this site!

Feel ree to surf to my homepage femara

Major thankies for the article.Thanks Again. Really Cool.

What as up colleagues, how is all, and what you desire to say about this piece of writing, in my view its really remarkable designed for me.

I view something really special in this web site.

Hey there this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have
to manually code with HTML. I’m starting a blog soon but have no coding skills so I wanted
to get guidance from someone with experience. Any help would be greatly

Have a look at my website :: prednisone

Excellent goods from you, man. I’ve understand your stuff previous to and you are just extremely wonderful.
I really like what you have acquired here, really like what you are saying and
the way in which you say it. You make it entertaining and you still take care
of to keep it smart. I can’t wait to read much more from you.
This is actually a great website.
homepage (Gerald)

Heya i am for the first time here. I found this board and I find It
truly useful & it helped me out a lot. I hope to give something back and
aid others like you aided me.

Also visit my webpage … prednisone

Check beneath, are some absolutely unrelated internet websites to ours, even so, they may be most trustworthy sources that we use.

Thanks in support of sharing such a nice opinion, post is fastidious,
thats why i have read it fully

Feel free to surf to my website … prednisone

I drop a comment whenever I like a article on a blog or if I have something to valuable to contribute to
the conversation. It is caused by the sincerness displayed in the article
I read. And on this article Software RAID on Linux with mdadm | Linux Magazine.
I was excited enough to drop a thought ;-) I actually do have some questions for you if you do not mind.

Could it be only me or do a few of the remarks appear like they are left by brain dead
individuals? :-P And, if you are writing on other
places, I’d like to follow anything new you have to post.
Could you list all of your community pages like your linkedin profile,
Facebook page or twitter feed?

web site (Penney)

Everyone loves what you guys tend to be up too. This type of clever work and reporting!
Keep up the wonderful works guys I’ve included
you guys to our blogroll.

my web-site; canadian drugstore

Hi there, I discovered your web site by way of Google at the same time as looking for a comparable subject, your site came up, it seems good.
I have bookmarked it in my google bookmarks.
Hi there, simply become alert to your blog through Google,
and located that it is truly informative. I am gonna watch out
for brussels. I will appreciate should you proceed
this in future. Lots of other people can be benefited out of your writing.

Stop by my web blog canadian pharmacies shipping to usa

Wow, fantastic blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your site is great, let alone the content!. Thanks For Your article about sex.

Unquestionably believe that that you stated. Your favorite
reason appeared to be on the web the simplest factor to have in mind of.
I say to you, I definitely get irked whilst other people consider worries that they just do not understand about.
You controlled to hit the nail upon the highest and defined
out the entire thing without having side effect , other folks could
take a signal. Will likely be back to get more. Thank

Review my website … canadian pharmacies

Hey there just wanted to give you a quick heads up. The
words in your post seem to be running off the screen in Opera.
I’m not sure if this is a formatting issue or something to do with browser compatibility but I figured I’d post to let
you know. The style and design look great though! Hope you get the issue fixed soon. Kudos

My webpage Cialis

It’s difficult to find knowledgeable people for this subject, however, you seem like you know what you’re talking about!
web page, Chu,

Software RAID on Linux with mdadm | Linux Magazine
wvkilxbwq http://www.g18vo6d90q0k6rg5a522n8o4dd8g7bk2s.org/

Hi there, its good paragraph about media print, we
all be aware of media is a impressive source of information.

Have a look at my weblog; cialis

Excellent pieces. Keep posting such kind of information on your
blog. Im really impressed by your site.
Hello there, You have done a fantastic job. I will definitely digg
it and personally suggest to my friends. I am sure
they will be benefited from this site.

Feel free to visit my blog post; cialis

Aw, this was an incredibly nice post. Finding the time and actual effort to create a top notch article… but what can I
say… I hesitate a lot and never seem to get anything done.

Also visit my web page :: cialis

Highly energetic blog, I enjoyed that bit.

Will there be a part 2?

Visit my webpage :: cialis

I’m not that much of a online reader to be honest but your sites really nice,
keep it up! I’ll go ahead and bookmark your website to come back down the road.
All the best

Also visit my website; cialis

Your style is so unique in comparison to other people I’ve read stuff from.
Many thanks for posting when you’ve got the opportunity, Guess I’ll just book mark this web site.

My blog post cialis

It’s nearly impossible to find experienced
people on this subject, however, you sound like you know what
you’re talking about! Thanks

Feel free to surf to my web page; cialis

Right here is the right web site for everyone who wishes
to find out about this topic. You realize so much its almost tough
to argue with you (not that I really would want to…HaHa).
You certainly put a fresh spin on a topic that’s been discussed for
decades. Excellent stuff, just great!

Here is my blog post publix pharmacy store locator

It’s awesome for me to have a website, which is helpful in favor of my knowledge.
thanks admin

My weblog; cialis 5mg cost without insurance

This is a topic that’s near to my heart… Thank you!
Exactly where are your contact details though?

Here is my blog … cialis generic pharmacy

Hi there! Do youu use Twitter? I’d liuke to follow you if that would
bbe ok. I’m absolutely enjoying your blog and look forward to
new posts.

Review my webpage :: where buy generic cialis online

Excellent post. I absolutely love this website. Stick with it!

My blog post – cialis daily dose

I visited multiple web sites but the audio feature for audio songs current at this websitfe is in fact wonderful.

my blog cialis over the counter

I am really enjoying the theme/design of your site.
Do you ever run into any internet browser compatibility problems?
A couple of mmy blog audience have complained about my website nnot operating correctly in Explorer
but loloks great in Chrome. Do you have anyy ideas tto help fixx this issue?

Allso visit my web page – cheap cialis 20mg

Hi to all, the contents present at this web page are actually awesome foor
people experience, well, keep up the nice work fellows.

Feel free to visit my homepage … tadalafil vs cialis

I do agree with all the ideas you hav introduced for your post.
They are really convincing and will definitely work.

Nonetheless, the posts are too brief for newbies.

Could you please extend them a bit from next time?

Thanks for the post.

Stop by my web blog cialis rx

Ev zapatos converse hombre identemente,zapatos converse hombre, en el caso de que sitio web es incorrectamen zapatos salomon barato te ejecutado que podría en lugar de destruir la credibilidad de de un solo pequeña o tamaño medio empresarial o profesional individual que quien pos Zapatos Asics Mujer ee.Más de un nivel más funcional,zapatos salomon barato, monos tiende

We found the sewing machine was very beneficial w Asics sko Denmark heth Moncler Jakker Kvinder Salg er we usedpretreated board or hot mounted adhesive. That versatility isawesome,Asics sko Denmark, that is an integral part of why we think you will find numbers of companies outthere that will make a serious see this machine. A house detection sys

Leave a Reply