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.

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.

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?"

Link exchange is nothing else however it is simply placing the other person’s blog link on your page
at proper place and other person will also do same for you.

Feel free to visit my weblog: cheap car insurance in md

I just could not leave your web site prior to suggesting that I actually
loved the standard information an individual provide in your guests?

Is going to be again often in order to inspect new posts

Feel free to visit my web site … cheap car insurance california

I seriously love your website.. Pleasant colors & theme.
Did you develop this website yourself? Please reply back as
I’m trying to create my own site and would love to know where you got this
from or what the theme is called. Many thanks!

Here is my blog: Cheap car insurance

Very handful of sites that transpire to be in depth beneath, from our point of view are undoubtedly effectively worth checking out.

Please pay a visit to the internet sites we follow, which includes this one, because it represents our picks through the web.

Although websites we backlink to below are considerably not associated to ours, we really feel they’re in fact really worth a go as a result of, so have a look.

Really enjoyed this article post.Much thanks again. Will read on…

Read my latest blog post “Making Mobile Marketing Work For Your Business ” from ” http://massmarketing.pro/making-mobile-marketing-work-for-your-business.html

If you like it, don’t forget to share.

What’sGoing down i’m new to this, I stumbled upon this I’ve found
It positively helpful annd it has aided me out loads. I hope to conjtribute &
assist different customers like its aided me. Great job.

my page – Cheap car insurance

My relatives every time say that I am wasting my time
here at web, but I know Iam getting experience all the time by reading such pleasant posts.

My blog – cheap full coverage car insurance

Hi, thjs weekend iis good iin support of me, since this time i am reading this great informative post here at
my house.

Also visit my web blog; cheap car insurance

I enjoy reading through a post that can make people think.
Also, many thanks for permitting me too comment!

Feel free to visit my webpage … cheap car insurance michigan

What’s up to every body, it’s my first visit of this web site; this weblog includes remarkable and genuinely good data for visitors.

my web-site cheap car insurance michigan

Magnificent goods from you, man. I have understand your stuff previous to and you are just too fantastic.

I actually like what you have acquired here, really like what you are
sayinbg and the way in which yyou say it. You make it enjoyable and you still care for tto keep it sensible.
I can’t wait to read far more from you. This
is actually a wonderful site.

My homepage: Cheap car insurance

We’re a group of volunteers and sttarting a new scheme in our
community. Your web site provided us with valuable info to work on.
You have done an impressive job and our whole community will be thankful to you.

my weblog Cheap Car Insurance

Hello there, I found your site by means of Google whilst
searching for a comparable subject, your web site
got here up, it appears good. I have bookmarked it in my google bookmarks.

Hi there, just changed into aware of your blog thru Google, and found that
it is really informative. I’m going to watch out for brussels.
I’ll be grateful for those who proceed this in future. A lot of people
shall be benefited out of your writing. Cheers!

Here is my page; giuseppe zanotti men

Hey! I know this is kinda off topic buut I was wondering if youu knew
where I could find a captcha plugin for my comment form?
I’m using the same blo platform as yours and I’m having trouble finding one?
Thanks a lot!

my site: cheap car insurance

It’s really a nice and helpful piece of information. I’m happy that
you shared thhis helpful info with us. Please keep us informed like this.

Thanks for sharing.

Feel free to surf to my site Cheap car insurance

I’m amazed, I have to admit. Rarely do I encounter a blog that’s both
equally educative and entertaining, and let
me tell you, you have hiit thee nail on the head.
The issue is something that tooo few folks are speaking intelligently about.
I am very happy that I foujnd this during my hunt ffor something
concerning this.

Heree is mmy page … cheap car insurance

constantly i used to read smaller content which as well clear their motive, and that is also happening with this paragraph which I am reading here.

my blog … Cheap car insurance

Plus it’ll give you some more awesome artwork to display on your refrigerator.
Whatever fun sex games for couples you choose to play is irrelevant.
Just ask her about her fantasies and let her imagination take over.

Its like you learn my thoughts! You seem to know a lot about this, like you wrotte the guide in it or something.
I think that you just could do with some p.c.
to force thee message house a littlle bit, but other than that, this is
excellent blog. A fantastic read. I will certainly bbe back.

Takee a look at my weblog – Cheap car insurance

I couldn’t resist commenting. Perfectly written!

Here is my blog post cheap car insurance

I’m not that much of a internet reader to be honest bbut your blogs really nice, keep itt up!
I’ll go ahead and bookmark your website to
come back later. Cheers

Also visit my weblog: cheap car insurance for students

Hi there! Would you mind if I share your blog with my twitter
group? There’s a lot of people that I think would really appreciate your
content. Pleas let me know. Many thanks

My weblog … Cheap car insurance

If you are going for best contents like I do, only pay a quick visit this web site daily as it presents feature contents,

Here is my blog post; cheap car insurance in ma

Great site you have here but I was wondering if
you knew of any message boards that cover the same topics talked
about in this article? I’d really love to be a part of community where I can get responses
from other knowledgeable people that share the same interest.
If you have any recommendations, please let me know.
Thanks a lot!

Here is my blog :: car insurance companies

Hey! Do you use Twitter? I’d like to follow you iif that would
be okay. I’m definitely enjoying your blog and look forward to
neew posts.

Heere is my wweb page; cheap car insurance

It’s really a great and useful piece of information. I am glad that you shared this helpful
info with us. Please keep us informned like this.

Thanks foor sharing.

Also visit my web page – cheap car insurance in ky

Aw, this was an extremely nice post. Spending some time
and actual effort to create a great article… but what can I say… I hesitate a lot and never manage to get anything done.

Look into my web-site; car insurance company

You could certainly see your skills in the article
youu write. The arena hopes for more passionate writers like you who are
not afraid to say how they believe. Always follow your heart.

My weblog :: cheap car insurance in sc

I pay a quick visit every day some web pages aand blogs
to read posts,except this blog gives feature based articles.

My page; very cheap car insurance

Can you tell us more about this? I’d care to find out more details.

Stop by my webpage … cheap car insurance michigan

Thanks for sharing your thoughts about cheap
multi car insurance. Regards

my page -Cheap car insurance

It’s amazing designed foor me tto have a web site, which is
helpful in support off my experience. thanks admin

Also visit my webpage – Satellite Internet Coleman Falls Virginia

It’s hard to come by knowledgeable people about this topic, but you sound like you know what you’re talking about!

my web-site – cheap car insurance

Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your webpage?
My blog is in the exact same niche as yours and my visitors would definitely
benefit from some of the information you present here.
Please let me know if this ok with you. Cheers!

Thanks for a marvelous posting! I actually enjoyed reading it, you
might be a great author. I will remember to bookmark
your blog and definitely will come back sometime soon. I want to encourage you to continue your great writing, have
a nice holiday weekend!

My web-site :: cheap car insurance

acheter viagra viagra generique
viagra achat viagra
viagra generico comprar viagra en espana

Present antixidants to assist detoxify the body (a mandatory course of to achieving profitable andd
long lasting weight loss).

my web site: Escorts in Southampton

The Adidas miCoach Fiit Good (great title, guys) is
for monitoring our coronary heart raye daa throughout exercises.

Also visit my weblog – Noelia

If youu want to rent a nutritionist for virtualy zerro greenback check out Fooducate
app which can help you chooise the appropriate meals inn your weight oss program.

My web site – Escorts in Southampton

As everyone knows, Nikee is a huge brand within the sporting world, it
has mae a remarkable entry into the world of health devices.

Take a look at my website :: body rub

Principally, a monitor tells you whether or not
your coronary heart is functioning as it ought to, and whether
it’s okay to icrease tempo or superb to decrease some.

Also visit my site; holidays to las vegas

Fitbit makes use of the latest know-how to track your sleep, exercise
and calories and helps you use the info to get the results you need.

Also visiot my website: wedding theme

You will put oon weight only once you eat in excess of your
body’s requirements.

My homepage … Maryjo

I am no longer certain the place you are getting your info, however great topic.

I must spend a while finding out more or understanding more.
Thank you for excellent info I used to be on the lookout for this info for my mission.

First off I want to say wonderful blog! I had a quick question which I’d like to ask if
you do not mind. I was interested to find out how you center yourself
and clear your thoughts before writing. I have had trouble clearing my
thoughts in getting my ideas out. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are usually wasted just trying to figure out
how to begin. Any suggestions or tips? Many thanks!

Here is my web-site … canadian pharmacy

Apple recommends working with the iPhone, along with carrying the Watch for improved accuracy.

Here is my blog; Escorts in Southampton

Just like the Fitbit Force, it will possibly use the small OLED to display Caller ID notifications from iOS or Android smartphones.

Feel free to visit my blog – Escorts in Southampton

Thhe actual tracker is the little machine as proven within the image that you
simply slide into your silicone band.

My web-site; lingerie mall online

Leave a Reply