[email protected]Office hours: Mon – Fri 9:00AM – 5:00PMLinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedFebruary 23, 2023

How to create RAID 0 (disk striping)

How To Create RAID 0 (Disk Striping)

RAID 0 (disk striping) is the process of dividing a body of data into blocks and spreading the data blocks across multiple storage devices, such as hard disks or solid-state drives (SSD), in a redundant array of independent disks (RAID) group.

 

About RAID-0 

RAID-0 is usually referred to as “striping.” This means that data in a RAID-0 region is evenly distributed and interleaved on all the child objects. For example, when writing 16 KB of data to a RAID-0 region with three child objects and a chunk-size of 4 KB, the data would be written as follows:

4 KB to object 0
4 KB to object 1
4 KB to object 2
4 KB to object 0

  • Requirements

The minimum number of disks is allowed to create RAID 0 is 2, but you can add more disk but the order should be twice as 2, 4, 6, 8. If you have a Physical RAID card with enough ports, you can add more disks.

To create RAID 0 follow the nest steps:

  • Update the system and install “mdadm” package:

    The mdadm is a small program, which will allow us to configure and manage RAID devices in Linux.

    Creating partitions for RAID

Now create 2 partitions for raid, with the help of following commands.

#fdisk /dev/sd

  1. Press ‘n‘ for creating a new partition.

  2. Then choose ‘P‘ for Primary partition.

  3. Next, select the partition number as 4.

  4. Give the default value by just pressing two times Enter key.

  5. Next press ‘P‘ to print the defined partition.

Please follow the same above instructions to create a partition on sd*(2) drive.

After creating partitions, verify both the drivers are correctly defined for RAID using the following commands.

#mdadm –examine /dev/sd[*-*]

#mdadm –examine /dev/sd[*-*]1

 

Creating RAID md devices 

Now since we have all the partitions with us, we will create RAID 0 array on those partitions, with the help of following commands.

# mdadm -Cv -l0 -c64 -n2 /dev/md0 /dev/sd{*,*}1

    -C, –create (Create a new array.)

    -v, –verbose (Be  more  verbose about what is happening.)

    -l, –level=  (Set RAID level.)

    -c, –chunk= (Specify chunk size of kilobytes.)

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

Now since our raid 0 array is created successfully. Verify the changes using below command

# cat /proc/mdstat

 

Create file-system and mount point

Raid 0 array is ready, we will create a filesystem on top of /dev/md0 so it can be used for storing data.

#mkfs.xfs /dev/md0

Once xfs filesystem has been created for Raid device, now create a mount point directory and mount the device /dev/md0 under it.

# mkdir /raid0
# mount /dev/md0 /raid0/
Next, verify that the device /dev/md0 is mounted under /raid0 directory.

#df -hTOnce

You’ve verified mount points, it’s time to create an fstab entry in /etc/fstab file.

# vim /etc/fstab

Add the following entry as described. May vary according to your mount location and filesystem you using.

/dev/md0                /raid0              xfs    defaults         0 0

Run mount ‘-a’ to check if there is any error in fstab entry.

# mount -a

Keep reading
How to Implement Network Segmentation and Resource Isolation in Linux.
February 6, 2024

How to Implement Network Segmentation and Resource Isolation in Linux.

How to Implement Network Segmentation and Resource Isolation in Linux. Securing and managing networks in a Linux environment involves advanced practices like network segmentation and resource isolation. This guide explores these concepts, providing detailed instructions and examples for…

Read article
How to open or close ports in Linux.
February 6, 2024

How to open or close ports in Linux.

How to open or close ports in Linux. Effectively managing ports on your Linux system is crucial for both security and service accessibility. This comprehensive guide will provide a detailed walkthrough on opening and closing ports using the robust tools iptables and ufw. Understanding these…

Read article
How to use ypdomainname command.
January 23, 2024

How to use ypdomainname command.

How to use ypdomainname command. In the realm of Linux networking, the ypdomainname command plays a crucial role in the context of the Network Information Service (NIS). NIS, formerly known as Yellow Pages, is a distributed database service that facilitates the sharing of network configuration and…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, colocation, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Office hours: Mon – Fri 9:00AM – 5:00PM