How to setup RAID 0 on Ubuntu Linux?

RAID 0 will create striping to increase read/write speeds as the data can be read and written on separate disks at the same time. This level of RAID is what you want to use if you need to increase the speed of disk access.You will need to create RAID aware partitions on your drives before you can create RAID and you will need to install mdadm on Ubuntu.

raid0
These commands must be done as root or you must add the sudo command in front of each command.

# mdadm –create /dev/md0 –level=0 –raid-devices=2 /dev/sdb5 /dev/sdb6

–create
This will create a RAID array. The device that you will use for the first RAID array is /dev/md0.

–level=0
The level option determines what RAID level you will use for the RAID.

–raid-devices=2 /dev/sdb5 /dev/sdb6
Note: for illustration or practice this shows two partitions on the same drive. This is NOT what you want to do, partitions must be on separate drives. However, this will provide you with a practice scenario. You must list the number of devices in the RAID array and you must list the devices that you have partitioned with fdisk. The example shows two RAID partitions.
mdadm: array /dev/md0 started.

Check the development of the RAID.

# cat /proc/mdstat

Personalities : [raid0]

md0 : active raid0 sdb6[1] sdb5[0]

995712 blocks 64k chunks
unused devices:

# tail /var/log/messages
You can also verify that RAID is being built in /var/log/messages.

May 19 09:08:51 ub1 kernel: [ 4548.276806] raid0: looking at sdb5

May 19 09:08:51 ub1 kernel: [ 4548.276809] raid0: comparing sdb5(497856) with sdb6(497856)

May 19 09:08:51 ub1 kernel: [ 4548.276813] raid0: EQUAL

May 19 09:08:51 ub1 kernel: [ 4548.276815] raid0: FINAL 1 zones

May 19 09:08:51 ub1 kernel: [ 4548.276822] raid0: done.

May 19 09:08:51 ub1 kernel: [ 4548.276826] raid0 : md_size is 995712 blocks.

May 19 09:08:51 ub1 kernel: [ 4548.276829] raid0 : conf->hash_spacing is 995712 blocks.

May 19 09:08:51 ub1 kernel: [ 4548.276831] raid0 : nb_zone is 1.

May 19 09:08:51 ub1 kernel: [ 4548.276834] raid0 : Allocating 4 bytes for hash.

Create the ext 3 File System
You have to place a file system on your RAID device. The journaling system ext3 is placed on the device in this example.

# mke2fs -j /dev/md0

mke2fs 1.40.8 (13-Mar-2008)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

62464 inodes, 248928 blocks

12446 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=255852544

8 block groups

32768 blocks per group, 32768 fragments per group

7808 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376

Writing inode tables: done

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

Create a Place to Mount the RAID on the File System

In order to use the RAID array you will need to mount it on the file system. For testing purposes you can create a mount point and test. To make a permanent mount point you will need to edit /etc/fstab.

# mkdir /raid

Mount the RAID Array

# mount /dev/md0 /raid

You should be able to create files on the new partition. If this works then you may edit the /etc/fstab and add a line that looks like this:

/dev/md0 /raid defaults 0 2

Be sure to test and be prepared to enter single user mode to fix any problems with the new RAID device.

Hope you find this article helpful.

Please follow and like us:
0

52 thoughts on “How to setup RAID 0 on Ubuntu Linux?

  1. What i don’t understood is in reality how you’re not actually a lot more well-preferred than you may be now. You’re very intelligent. You already know therefore considerably in terms of this subject, made me in my opinion imagine it from a lot of varied angles. Its like women and men don’t seem to be fascinated until it’s one thing to do with Girl gaga! Your own stuffs great. Always handle it up!

  2. Just desire to say your article is as amazing. The clarity in your post is just spectacular and i can assume you are an expert on this subject. Well with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please keep up the rewarding work.

  3. Pretty nice post. I just stumbled upon your blog and wanted to say that I’ve really enjoyed surfing around your blog posts. After all I will be subscribing to your feed and I hope you write again very soon!

  4. Howdy! I know this is kinda off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having problems finding one? Thanks a lot!

  5. Great V I should definitely pronounce, impressed with your site. I had no trouble navigating through all tabs and related information ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, site theme . a tones way for your customer to communicate. Excellent task..

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

  7. We absolutely love your blog and find almost all of your post’s to be just what I’m looking for. Does one offer guest writers to write content for yourself? I wouldn’t mind creating a post or elaborating on a lot of the subjects you write concerning here. Again, awesome weblog!

  8. The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.

  9. Appreciating the persistence you put into your website and in depth information you present. It’s nice to come across a blog every once in a while that isn’t the same unwanted rehashed information. Fantastic read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.

  10. Nice post. I was checking constantly this weblog and I am impressed! Extremely useful info specially the ultimate phase 🙂 I maintain such information a lot. I used to be looking for this particular info for a long time. Thank you and best of luck.

  11. Hello just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Internet explorer. I’m not sure if this is a format issue or something to do with web browser compatibility but I thought I’d post to let you know. The design look great though! Hope you get the issue solved soon. Thanks

  12. Hey there! Quick question that’s completely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when browsing from my iphone. I’m trying to find a theme or plugin that might be able to fix this issue. If you have any suggestions, please share. With thanks!

  13. Thanks a lot for providing individuals with an extraordinarily brilliant chance to read from this website. It is always so cool and jam-packed with a good time for me personally and my office peers to search your website not less than three times weekly to read the newest guides you will have. And lastly, I’m just certainly astounded concerning the effective inspiring ideas you serve. Certain 3 facts in this post are particularly the most efficient we’ve had.

  14. I was wondering if you ever considered changing the page layout of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two pictures. Maybe you could space it out better?

  15. naturally like your web site but you need to test the spelling on several of your posts. Several of them are rife with spelling issues and I to find it very bothersome to tell the truth however I will surely come back again.

  16. Greetings from Carolina! I’m bored at work so I decided to browse your website on my iphone during lunch break. I enjoy the info you provide here and can’t wait to take a look when I get home. I’m surprised at how quick your blog loaded on my phone .. I’m not even using WIFI, just 3G .. Anyways, great blog!

  17. Hello! 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! Exceptional blog and fantastic design.

  18. Just wish to say your article is as astonishing. The clarity in your post is simply spectacular and i could assume you’re an expert on this subject. Well with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work.

  19. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!

  20. Thanks for the suggestions about credit repair on this web-site. A few things i would tell people is usually to give up the actual mentality that they can buy at this moment and pay later. Being a society all of us tend to try this for many things. This includes holidays, furniture, in addition to items we want. However, you must separate a person’s wants out of the needs. When you’re working to raise your credit ranking score you really have to make some trade-offs. For example it is possible to shop online to save money or you can click on second hand suppliers instead of highly-priced department stores with regard to clothing.

Leave a Reply to Anonymous Cancel reply