Raid 0

Raid 0

What is 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 (SSDs), in a redundant array of independent disk groups.

A stripe consists of the data divided across the set of hard disks or SSDs, and a striped unit refers to the data slice on an individual drive.

How RAID 0 works

Because striping spreads data across more physical drives, multiple disks can access the contents of a file, enabling writes and reads to be completed more quickly. However, unlike other RAID levels, RAID 0 does not have parity. Disk striping without parity data does not have redundancy or fault tolerance. That means, if a drive fails, all data on that drive is lost.

Storage systems perform disk striping in different ways. A system may stripe data at the byte, block or partition level, or it can stripe data across all or some of the disks in a cluster. For instance, a storage system with 10 hard disks might stripe a 64 KB block on the first, second, third, fourth and fifth disks and then start over again at the first disk. Another system might stripe 1 megabyte (MB) of data on each of its 10 disks before returning to the first disk to repeat the process.

RAID 0 is best for storage that is noncritical but requires high-speed reads and writes. Caching live streaming video and video editing are common uses for RAID 0 due to speed and performance. Disk striping without data redundancy may be used for temporary data, scratch space or situations where a master copy of the data is easily recoverable from another storage device.

Some RAID levels use disk striping to distribute and store data across multiple physical drives. Disk striping is synonymous with RAID 0 and spreads the data across all the disk drives in a RAID group without parity data.

Hands-on for Centos 7/ RHEL

To implement this follow the configuration below

  • 1 BOOT PARTITION

  • ADD 2 HDDS OF ANY SIZE

  • To Check if our harddisks are mounted or not
lsblk

  • Install mdadm to create a raid
yum install mdadm -y
  • Create Raid-0 with the command below
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb /dev/sdc

  • To check if it's created or not
cat /proc/mdstat

  • You can examine drives as well
mdadm --examine /dev/sdb

  • List Blocks
lsblk

  • Create a new partition
fdisk /dev/md0

1.Press 'n' for new
2.Press 'p' for primary
3.Press '1' for partition number
4.Press 'w' for creation of partition

  • Make Filesystem
mkfs.ext4 /dev/md0p1

  • Mounting the partition
mkdir /mnt/raid0
mount /dev/md0p1 /mnt/raid0
  • Check for the partition folder if it's mounted or not
cd /mnt/raid0 
ll

  • Check for partitions and used space by command below
df- h

  • Creating a file so that we can see the space usage
dd if=/dev/zero of=500mb.file bs=1024 count=502400

  • And now we can see changes
df -h

  • To unmount the raid partition
umount /mnt/raid0
  • check for partitions, it'll be missing from the list
df -h

  • Stop the raid 0 partition
mdadm --stop /dev/md0