Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.12 KB

how-to-create-software-raid0-with-mdadm.md

File metadata and controls

53 lines (36 loc) · 1.12 KB

How to create software RAID 0 with mdadm

  1. Install the mdadm package:
$ sudo apt-get install mdadm
  1. Create a RAID 0 array (/dev/md0) using the mdadm --create command:
$ sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=4 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1
  1. Check the created RAID 0 array:
$ cat /proc/mdstat 
Personalities : [raid0] 
md0 : active raid0 nvme3n1[3] nvme2n1[2] nvme1n1[1] nvme0n1[0]
      2000429056 blocks super 1.2 512k chunks
      
unused devices: <none>
  1. Create a partition on the array:
$ sudo fdisk /dev/md0
  1. Create a filesystem on the array:
$ sudo mkfs.ext4 /dev/md0p1
  1. Mount the array:
$ sudo mount /dev/md0p1 test_data
  1. Save the array layout to make sure that the array is reassembled automatically at boot:
$ sudo mdadm --detail --scan | sudo tee -a /etc/mdamd/mdadm.conf
$ sudo update-initramfs -u

Reference