dcsimg

Pick Your Pleasure: RAID-0 mdadm Striping or LVM Striping?

A fairly common Linux storage question: Which is better for data striping, RAID-0 or LVM? Let's take a look at these two tools and see how they perform data striping tasks.

Given the price of hard drives and the number of drives you can put into a single system albeit a desktop or a server, a very common question is how to arrange the drives to improve performance. Consequently, a somewhat commonly asked Linux storage question that you see on various mailing lists is, which is better for data striping, RAID-0 with mdadm or LVM? While many people will correctly point out that this argument is somewhat pointless because each is really intended for different tasks, the question is still fairly common. Nonetheless, in the quest for the best performance possible, there is still the question of which one is better (whether it’s meaningless or not). In this article both concepts will be contrasted in regard to performance with some discussion about appropriateness. To add at least a little chaos to the situation, some simple IOzone benchmarks with RAID-0 and LVM will be presented.

Data Striping

Data striping is a commonly used technique for improving performance. It breaks data into pieces that are assigned to various physical devices, usually storage devices, in a round-robin fashion. One of the reasons that this concept was developed is that processors are capable of generating IO (reads and writes) much faster than the storage device can store or recall it. But if you can split the data among multiple storage devices then you can perhaps improve IO performance.

The process is very simple. In the case of a write function, the incoming data is split into pieces with the first piece being sent to the first device, the second piece being sent to the second device, and so on until all the devices have received a data piece or all the data has been written. If there are still pieces of data to be written then the next piece is sent to the first device and the process continues (round-robin). Data throughput is improved because the system can send one piece of data to one storage device and immediately move on to the next piece of data and the next storage device without having to wait for the first one to complete. If you like, the data storage is parallelized. In Linux there are two primary ways to achieve this, RAID-0 and LVM.

RAID-0 with mdadm

One way to achieve data striping is to use RAID-0. Most people are probably familiar with the concept of RAID (Redundant Array of Inexpensive Disks) that seeks to divide data, possibly replicate it, and place it on storage devices. There are various techniques to achieve these goals and each one has a number associated with them such as RAID-0 or RAID-1. These details of the scheme define whether the emphasis is on either data reliability or increased throughput or possibly both.

RAID-0 is a scheme to improve data throughput by taking the data and spliting it evenly between multiple disks (data striping). Figure 1 below, from Wikipedia, shows how data is split across two disks.

RAID_0.png
Figure 1 – Diagram of RAID-0 layout of Two Drives

In this example, the first data piece, A1, is sent to disk 0, the second piece, A2, is sent to disk 1, and so on.

There are two terms that help define the properties of RAID-0.


  • Stripe Width
    This is the number of stripes that can be read to or written from, at the same time. Very simply, this is the number of drives used in the RAID-0 group. In example 1 the stripe width is 2.
  • Stripe Size
    The phrase refers to the size of the stripes on each drive. The phrases block size, chunk size, stripe length or granularity will sometimes be used in place of stripe size but they are all equivalent.

RAID-0 can, in many cases, help IO performance because of the data striping (parallelism). If the data is smaller than the stripe size (chunk size) then it will be written to only one disk not taking advantage of the striping. But if the data size is greater than the stripe size, then read/write performance should increase because of the ability to use more than one disk for a read or write. Increasing the stripe width adds more disks and can improve read/write performance if the stripe width (chunk size) is greater than the data size.

Mdadm (pronounced “m-d-adam”) is a tool for Linux for managing software RAID devices in Linux. It has seven modes of operation that pretty much cover any possible task you might use software RAID.


  • Assemble
  • Build
  • Create
  • Monitor
  • Grow
  • Manage
  • Misc

Mdadm is an all-purpose RAID management tool for Linux with a long history.

LVM Striping

LVM has been discussed in a previous article about managing pools of data. As discussed, it is an extraordinary useful tool for managing storage. Fundamentally it allows you to collect physical storage devices and combine them into virtual devices (volume groups) that can be divided into logical partitions (logical volumes) that are then used as the device for file systems. You can add or subtract devices from the virtual devices (volume group) or even move them as needed. Coupling these techniques with file systems that can be resized and you have a terribly efficient way of growing or moving file systems as needed.

In addition, LVM is very flexible allowing you to control exactly how the physical devices are combined into the volume groups (VGs) and the logical volumes (LVs). It is this flexibility that allows you to do data striping. In LVM this is called striped mapping. Figure 2 below illustrates this concept.

striped_mapping.png
Figure 2 – Striped Mapping in LVM

Striped mapping maps the physical volumes (typically the drives) to the logical volume that is then used as the basis of the file system. LVM takes the first few stripes from the first physical volume (PV0) and maps them to the first stripes on the logical volume (LV0). Then it takes the first few stripes from the next physical volume (PV1) and maps them to the next stripes in LV0. The next stripes are taken from PV0 and mapped to LV0 and so on until the stripes on PV0 and PV1 are all allocated to the logical volume, LV0.

The advantage of the striped mapping is similar to RAID-0. When data is read from or written to the file system and if the data is large enough, it spans multiple stripes so that both physical devices can be used, improving performance.

Contrasting RAID-0 and LVM

From the previous discussions it is obvious that both RAID-0 and LVM achieve improved performance because of data striping across multiple storage devices. So in that respect they are the same. However, LVM and RAID are used for different purposes, and in many cases are used together. Let’s look at both techniques from different perspectives.

The size (capacity) of a RAID-0 group is computed from the smallest disk size among the disks in the group, multiplied by the number of drives in the group. For example, if you have two drives where one drive is 250GB in size and the second drive is 200GB, then the RAID-0 group is 400GB in size, not 450GB. So RAID-0 does not allow you to use the entire space of each drive if they are different sizes.

On the other hand, LVM allows you to combine all of the space in all of the drives into a single virtual space. You can use stripe mapping across the drives as you would in RAID-0, with the capacity being the same as RAID-0. However, LVM allows you to also use the remaining space for additional volume groups (VGs).

In the case of mdadm and software RAID-0 on Linux, you cannot grow a RAID-0 group. You can only grow a RAID-1, RAID-5, or RAID-6 array. This means that you can’t add drives to an existing RAID-0 group without having to rebuild the entire RAID group but having to restore all the data from a backup.

However, with LVM you can easily grow a logical volume. But, you cannot use stripe mapping to add a drive to an existing striped logical volume because you can’t interleave the existing stripes with the new stripes. This link explains it fairly concisely.

“In LVM 2, striped LVs can be extended by concatenating another set of devices onto the end of the first set. So you can get into a situation where your LV is a 2 stripe set concatenated with a linear set concatenated with a 4 stripe set.”

Despite not being able to maintain a striped mapping in LVM, you can easily add space to a strpped logical volume.

This article, written by the original developers of LVM for Linux, present four advantages of LVM.



  1. Logical volumes can be resized while they are mounted and accessible by the database or file system, removing the downtime associated with adding or deleting storage from a Linux server
  2. Data from one (potentially faulty or damaged) physical device may be relocated to another device that is newer, faster or more resilient, while the original volume remains online and accessible
  3. Logical volumes can be constructed by aggregating physical devices to increase performance (via disk striping) or redundancy (via disk mirroring and I/O multipathing)
  4. Logical volume snapshots can be created to represent the exact state of the volume at a certain point-in-time, allowing accurate backups to proceed simultaneously with regular system operation

These four advantages point to the fact that LVM is designed for ease of management rather than performance.

Performance Comparison of RAID-0 and LVM Striped Mapping

Comments on "Pick Your Pleasure: RAID-0 mdadm Striping or LVM Striping?"

http://kstyle3.sakura.ne.jp/apparels/5926876Typically the OES statements which the best executive managers to
obtain ct editors remain to be state and federal judge.
They will spend $27 by the hour within the mediocre, that’s on the perks deal that national personnel get for example insurance coverages, feeling bad makes, also paid back vacation trips.Courts reporters are restricted with references to career advancement ever since an individual’s occupation starts off and even inhibits during legal exposure.
It doesn’t mean who stenographers are unable to get pleasure from compensate grows along with the chance to grow their generating potential.http://www.gamecookie.com/profile/hobuttrose

Thank you for sharing your info. I truly appreciate your
efforts and I am waiting for your further
post thanks once again.

I am no longer positive where you’re getting your info, but great topic.
I needs to spend a while studying more or understanding more.

Thank you for excellent info I used to be looking for this info for my mission.

Hey! Someone in my Facebook group shared this site with us so I came to check it out.
I’m definitely loving the information. I’m bookmarking and will be
tweeting this to my followers! Superb blog
and brilliant style and design.

Very good article. Will read on…

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 site to come back
down the road. Cheers

2013 Scarpe Hogan Italia Online Interactive Hogan Uomo
Nuovo Gray/bianco EmwJf Espace augmente de démarrage
à 380 litres et 1220 litres avec les sièges rabattus économie flat.if est votre principale
priorité lors du choix de votre Audi A3, alors opter pour un moteur
diesel est le choix le plus judicieux. Hogan Scarpe Donna Italia Vendi Scarpe
Hogan Donna 2014 Online fRfJm Gary Burnett,
professeur agrégé au département de génie de l’Université
de Nottingham en Angleterre, a voulu savoir quel effet réel sur la capacité
des individus à naviguer. scarpe hogan outlet italia Hogan Scarpe
Uomo 2013 Collezione Primavera Estate rCkVc Le comte,
déjà un officier allemand décoré, a abandonné sa femme et de la famille de
servir comme simple soldat dans son ami l’armée du roi
George III en poste au Canada. Hogan Prezzi Acquistare Scarpe Hogan 2014 fDSmZ Un autre Devon, un konklu
Ahmad alhendavi, rekonna l potentiel de la grande, plus G de Jeunes De tout l de l et Lev contribution, en tante Que sitoyen agi, o
w durable. Vendi 2013 Hogan Scarpe Donna 2013 Scarpe Hogan Outlet Online YboND
L’autre chose que j’aime, c’est que vous pouvez voir à travers les clips de courte durée, ils montrent que le film
a vraiment tout ce que vous pourriez souhaiter dans un film Halloween à thème..

Currently it sounds like BlogEngine is the top blogging platform out there right now.
(from what I’ve read) Is that what you’re using on your blog?

I always used to study paragraph in news papers but now
as I am a user of internet so from now I am using net for articles
or reviews, thanks to web.

Why visitors still make use of to read news papers when in this technological world everything is
available on net?

Hi there i am kavin, its my first time to commenting anywhere, when i read this piece
of writing i thought i could also create comment due to this good post.

I have been exploring for a little for any high-quality articles or weblog posts on this kind
of area . Exploring in Yahoo I ultimately stumbled upon this web
site. Reading this information So i’m satisfied to show that
I have a very good uncanny feeling I found out just what I needed.

I such a lot for sure will make certain to do
not omit this website and give it a glance on a continuing basis.

website (Cameron)

Major thankies for the blog post. Keep writing.

bookmarked!!, I like your blog!

Please let me know if you’re looking for a article author for your weblog. You have some really good articles and I believe I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some material for your blog in exchange for a link back to mine. Please send me an email if interested. Many thanks!|

I love this site – its so usefull and helpfull.

more from : Michael Kors clearance

Hi, the whole thing is going well here and ofcourse
every one is sharing information, that’s
genuinely good, keep up writing.

Spot on with this write-up, I honestly believe this site needs a great deal more attention. I’ll probably be returning to read more, thanks for the info!|

Ahaa, its good dialogue about this piece of writing at
this place at this weblog, I have read all that,
so now me also commenting here.

web site – Jimmy,

Fantastic blog! Do you have any helpful hints for aspiring writers?
I’m planning to start my own website soon but
I’m a little lost on everything. Would you recommend
starting with a free platform like WordPress or go for
a paid option? There are so many choices out there that I’m totally overwhelmed ..
Any suggestions? Bless you!

web site [Beulah]

schlagzeug lernen münster
schlagzeug lernen münster, schlagzeugunterricht münster, schlagzeugunterricht in
münster
https://de-de.facebook.com/schlagzeugunterrichtmunster.gryz
Schlagzeugunterricht Münster | Schlagzeugschule …

http://www.muenster-schlagzeugunterricht.de/

Schlagzeugunterricht Münster Der Schlagzeuger und Schlagzeuglehrer Mathias
Gryz bietet Ihnen Schlagzeugunterricht an. Schlagzeug
lernen mit Spass

You actually make it seem so easy with your presentation but
I find this matter to be actually something that I think I would never understand.
It seems too complex and extremely broad for me. I’m looking forward for your next post, I’ll try to get the hang of it!

site (Maybell)

Its like you read my mind! You appear to know a lot about this,
like you wrote the book in it or something. I think that you could do
with a few pics to drive the message home a little
bit, but instead of that, this is fantastic blog. An excellent read.
I will certainly be back.

site (Aurora)

Hey! This is kind of off topic but I need some help from an established blog.
Is it difficult to set up your own blog? I’m not very techincal but I can figure things
out pretty quick. I’m thinking about making my own but I’m not sure where
to begin. Do you have any points or suggestions? Thank you

website (Shoshana)

Link exchange is nothing else except it is only placing the other person’s web site link on your page at appropriate place and other person will also do same in favor of you.

web site (Shannan)

After I initially left a comment I appear to have clicked on the -Notify me
when new comments are added- checkbox and from now on whenever a comment is added I
get 4 emails with the exact same comment. Is there a way you are able to remove me from
that service? Appreciate it!

site (Lettie)

I am curious to find out what blog system you have been working with?
I’m experiencing some small security issues with my latest
blog and I’d like to find something more safe. Do you have any solutions?

web site (Hector)

I’m really loving the theme/design of your blog.
Do you ever run into any internet browser compatibility issues?
A couple of my blog readers have complained about my blog not working
correctly in Explorer but looks great in Safari. Do you have
any recommendations to help fix this problem?

Have you ever considered publishing an e-book or guest authoring on other websites?
I have a blog based upon on the same information you discuss and would really like to have you share some stories/information.

I know my viewers would value your work. If you’re even remotely interested, feel free to send me an e-mail.

It’s hard to come by well-informed people in this particular topic, however, you sound like you know what you’re talking about!
Thanks

Great article. I’m going through a few of these issues as well..

H?, this w?ekend is good for me, since this point in time
? am reading this great informative par?graph here? at my residence.

Magnificent beat ! I would like to apprentice while you amend your website, how could
i subscribe for a blog website? The account helped me
a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea

Nice post. I was checking constantly this blog and I’m impressed!
Extremely useful information specially the last part :) I care for such
information a lot. I was seeking this particular info for a long time.
Thank you and good luck.

Informative article, totally what I needed.

Attractive section of content. I just stumbled
upon your website and in accession capital to assert that I acquire actually enjoyed account your blog posts.
Any way I will be subscribing to your feeds
and even I achievement you access consistently rapidly.

site – Leatha,

WOW! Great perspective!

My spouse and I absolutely love your blog and find most of your post’s to be precisely what I’m looking for. Does one offer guest writers to write content for yourself? I wouldn’t mind writing a post or elaborating on a number of the subjects you write concerning here. Again, awesome blog!|

I like the helpful information you provide in your articles. I’ll bookmark your weblog and check again here regularly. I’m quite certain I will learn many new stuff right here! Good luck for the next!|

Excellent beat ! I wish to apprentice while you amend
your website, how could i subscribe for a blog site? The account helped me a acceptable deal.
I had been tiny bit acquainted of this your broadcast
provided bright clear idea

web page; Larae,

When some one searches for his essential thing, so he/she desires to be available that
in detail, so that thing is maintained over here.

Undeniably believe that which you said. Your favorite justification seemed to be on the web the simplest thing to be aware of. I say to you, I certainly get annoyed while people think about worries that they plainly do not know about. You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people can take a signal. Will probably be back to get more. Thanks|

I have learn several excellent stuff here. Definitely price bookmarking for revisiting. I wonder how much attempt you set to make the sort of wonderful informative website.

An impressive share! I’ve just forwarded this onto a co-worker who has been conducting a little research on this. And he actually ordered me lunch due to the fact that I stumbled upon it for him… lol. So allow me to reword this…. Thank YOU for the meal!! But yeah, thanx for spending time to discuss this issue here on your web page.

Hi webmaster do you need unlimited content for your site ?
What if you could copy article from other websites, make it pass copyscape test and publish on your
page – i know the right tool for you, just type in google:
Loimqua’s article tool

Keep on writing, great job!|

Hello to every body, it’s my first visit of this webpage; this weblog carries awesome and truly excellent data in support of visitors.

We are a group of volunteers and opening a new scheme in our community. Your site provided us with valuable information to work on. You have done a formidable job and our whole community will be thankful to you.

That is a really good tip particularly to those new to tthe blogosphere.
Simple but very precise information… Appreciate your sharingg tjis
one. A must read article!

My webpage … drop crotch chinos

Thanks for sharing your thoughts about overgo. Regards

site; Cassie,

Leave a Reply