Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

How to setup RAID 0 on Ubuntu Linux?

1 min read

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.

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

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

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.

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

30 Replies to “How to setup RAID 0 on Ubuntu Linux?”

  1. “This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I have shared your web site in my social networks!”

  2. The simplest way to install Raid 0 ubuntu 20.04 is.
    1) Install ubuntu in a smallest partition first as usual
    2) Activities ->disk, use disk tool to create a raid partition on disk 1, delete all partition on disk 2 and automatically disk tool will assign disk 2 as raid member
    3) reinstall ubuntu, selecting the raid partitiion on disk 1

    You will find the installation speed 4 X faster..
    This shall be easiest way…ever!

  3. Unquestionably consider that which you stated. Your favourite reason appeared to be at the web the simplest factor to understand of. I say to you, I certainly get annoyed even as other people consider worries that they just do not recognize about. You controlled to hit the nail upon the top and also outlined out the whole thing with no need side effect , other people can take a signal. Will likely be back to get more. Thank you

  4. I loved as much as you’ll receive performed right here. The cartoon is attractive, your authored material stylish. however, you command get got an impatience over that you would like be turning in the following. unwell indubitably come more earlier once more since exactly the same nearly a lot frequently within case you shield this increase.

  5. Good – I should certainly pronounce, impressed with your site. I had no trouble navigating through all tabs as well as related info 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 anything, site theme . a tones way for your customer to communicate. Nice task..

  6. Howdy this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding experience so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!

  7. After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.

  8. Hiya, I am really glad I have found this info. Today bloggers publish only about gossips and internet and this is actually irritating. A good blog with interesting content, that’s what I need. Thanks for keeping this web site, I will be visiting it. Do you do newsletters? Can not find it.

  9. Very great post. I simply stumbled upon your blog and wished to mention that I have truly loved surfing around your blog posts. After all I will be subscribing on your feed and I’m hoping you write again very soon!

  10. Have you ever considered publishing an e-book or guest authoring on other sites? I have a blog based on the same topics you discuss and would really like to have you share some stories/information. I know my visitors would enjoy your work. If you are even remotely interested, feel free to shoot me an e-mail.

  11. You actually make it appear so easy together with your presentation but I find this topic to be actually something that I believe I’d by no means understand. It sort of feels too complicated and extremely huge for me. I am taking a look forward to your subsequent post, I¦ll try to get the dangle of it!

  12. Whats up very nice website!! Guy .. Beautiful .. Superb .. I will bookmark your website and take the feeds additionally?KI’m glad to search out so many helpful information here in the publish, we want work out more strategies on this regard, thank you for sharing. . . . . .

  13. You are my breathing in, I possess few web logs and infrequently run out from brand :). “Yet do I fear thy nature It is too full o’ the milk of human kindness.” by William Shakespeare.

  14. I will immediately clutch your rss as I can not find your e-mail subscription link or e-newsletter service. Do you’ve any? Kindly allow me recognize in order that I may subscribe. Thanks.

  15. Its such as you read my thoughts! You seem to understand a lot approximately this, like you wrote the e book in it or something. I feel that you simply can do with some to force the message house a bit, but instead of that, this is fantastic blog. A fantastic read. I’ll certainly be back.

Leave a Reply

Your email address will not be published.