Guide - Raid Array (Raid 0)

In this guide, I will be showing how to create a raid array, using the raid 0 configuration. This allows you to have maximize storage available, however it comes at the risk of data loss in case of hardware failure. 

[Image: DifficultBitterAndeancondor-size_restricted.gif]

It also has the benefit of having really pretty "blinkenlights" effect when the USB drives are being accessed. 


ROCK64 board running Debian or Ubuntu, connected to the local network

Access to terminal, either locally or via SSH

At least 2 Flash drives (or hard drives)

Recommended: USB Hub, for ease of access. 


Make sure your software and repositories are up to date: 

sudo apt update && sudo apt upgrade

Next, we install the mdadm package, used to monitor and implement software raid in linux: 

sudo apt install mdadm

After installing it, we can get our flashdrives and plug them directly into the ROCK64 board, or onto a USB hub and plug that into the board. 

The USB drives that I used were previously erased by me, and thus, don't have any partitions. We can confirm that they've been detected by the system by issuing the "lsblk" command, showing the attached blocked devices. In my case, they are sdb, sdc, and sdd: 

[Image: fJUNTyv.png]

Since we can see the 3 (in my case) flash drives recognized by the system, we can now proceed and start to create a new raid array. 


sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=3 /dev/sd{b,c,d}

"--level=0" denotes the raid level, or the type of raid. "--raid-devices" flag states the number of devices. The last argument "/dev/sd{b,c,d}" is simply an easier way of saying "/dev/sdb /dev/sdc /dev/sdd" without having to type it all out (called Brace Expansion). 

[Image: LAWNB9K.png]

After the Array is created, you can invoke the "lsblk" command, to see the status of the USB drives. Notice that all three drives (sdb,sdc,sdd) are part of the partition (md0) and that the partition size is larger than the size of the physical disk: 

[Image: RejMu5C.png]

Now, we can simply create a partition on the raid array, and mount it to a suitable location. 
I created an ext4 partition on my Raid array: 

sudo mkfs.ext4 -F /dev/md0

Then, I created a mountpoint for my new Ext4 partition, and mounted it: 

sudo mkdir -p /mnt/md0

sudo mount /dev/md0 /mnt/md0

I also used this as an opportunity to check my RAID was succesfully created by checking the /proc/mdstat file (though, it was my mistake, I should have done this step right after creating the array. 

[Image: LPIHkQk.png?1]
Now that the RAID device is mounted, we can use the chown command to assume ownership of it so that we can write to it: 
sudo chown -R rock64: /mnt/md0/

Again, this might vary depending on your username and mount location. 
Thats all there is to it! We're done! You should be able to access that device under your mountpoint. We can confirm that the RAID array is mounted using either "lsblk" or "df -h": 
[Image: 5NRL2F7.png]
[Image: nM0D8aD.png]

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginners Guide: Migrating to SSD rontant 18 41,086 01-19-2022, 09:30 AM
Last Post: Ellesar Dragon
Information Beginners Guide: Adding USB Storage, Linux Formatting and Permissions Ptheven 4 12,539 03-06-2021, 01:49 PM
Last Post: helpmerock
  Step by step guide PXE diskless configuration. burglar_ot 13 36,532 11-01-2020, 11:26 PM
Last Post: michael.gruner
Thumbs Up A guide for how I made RetroPie, RetroArch, and EmulationStation Work on the Rock64 Mrfixit2001 4 16,414 12-17-2018, 03:52 AM
Last Post: va88
  Guide - XRDP - Debian Stretch / Ubuntu Xenial / OMV S3phi40T 3 14,197 05-05-2018, 06:08 AM
Last Post: S3phi40T
Information Guide - Setting up a NFS Share Ptheven 0 5,593 09-26-2017, 04:44 AM
Last Post: Ptheven
  Guide - Setting up a SMB(Windows) file server Ptheven 0 12,750 08-21-2017, 08:54 AM
Last Post: Ptheven
Information Beginners Guide: Locating your board, connecting to it. Ptheven 5 16,259 08-21-2017, 04:12 AM
Last Post: Ptheven

Forum Jump:

Users browsing this thread: 1 Guest(s)