Bliss OS (Pinebook) 20170919 [Oct 13] | Bliss OS (PINE A64(+)) 20170919 [Oct 13] | Linux Images (ROCK64) 0.5.10-118 [Oct 2] | Android Images (ROCK64) 0.3.4-86 [Oct 2] | Android 6.0.1 (PINE A64-LTS / SOPINE) 20170726 [Sep 29] | Android 7.1 (Pinebook) 0.3.10-66 [Sep 19] | Android 7.1 (PINE A64(+)) 0.3.10-66 [Sep 19] | Android 7.1 (SOPINE) 0.3.10-66 [Sep 19] | PINE64 Installer v2.0.0-beta.3 [Sep 12]

Getting Started | Visit the WIKI | IRC Logs | Forum Rules/Policy


Guide - Raid Array (Raid 0)
#1
Information 
Preface


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. 



Prerequisites


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: 



Code:
sudo apt update && sudo apt upgrade


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

Code:
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. 

WARNING: BE VERY CAREFUL WITH THE FOLLOWING STEPS AND DOUBLE CHECK, USING THE WRONG NAMES COULD LEAD TO DATA LOSS

Code:
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: 

Code:
sudo mkfs.ext4 -F /dev/md0

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

Code:
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: 
Code:
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]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Information Guide - Setting up a NFS Share Ptheven 0 101 09-26-2017, 04:44 AM
Last Post: Ptheven
  Beginners Guide: Migrating to SSD rontant 1 436 09-17-2017, 07:01 PM
Last Post: rontant
  Guide - Setting up a SMB(Windows) file server Ptheven 0 330 08-21-2017, 08:54 AM
Last Post: Ptheven
Information Beginners Guide: Locating your board, connecting to it. Ptheven 5 823 08-21-2017, 04:12 AM
Last Post: Ptheven
Information Beginners Guide: Adding USB Storage, Linux Formatting and Permissions Ptheven 3 493 08-16-2017, 01:19 AM
Last Post: Ptheven

Forum Jump:


Users browsing this thread: 1 Guest(s)