Today I will show you how to build a Raspberry Pi3 RAID NAS server using USB flash drives, the Linux native RAID application mdadm, and SAMBA so the drive will show up as a normal network folder on Windows PC’s. It’s a pretty easy tutorial and shows you how to create a Linux RAID array which is a good skill to have.
You can use Raspberry Pi’s from version 2 onwards, so 2B, 2B+ and RPi 3’s are fine, but I recommend the latest Raspberry Pi 3. You’ll also need a good quality microUSB power pack suitable for the Raspberry Pi you’re using, if in doubt, just buy a combo pack that comes with case, power pack and other goodies.
- Where to purchase a Raspberry Pi 3
- Search eBay.com for “Raspberry Pi 3 Starter Kit”
- RS Components (massive inventory, world wide online stores)
- Farnell/Element14 (massive inventory, world wide online stores)
USB Flash Drives
We will be using USB2.0 flash drives for our RAID array because RPi’s (all versions) only support USB2.0, so there’s no use spending up big on USB3.0 drives (unless you want to). The drives should all be the same size and preferably the same manufacturer for a good RAID array however, if you have an odd one out, just make sure it’s the same size or larger than the smallest drive.
In terms of drive size, your budget will be the determining factor, so just get what you can afford. Remember that with RAID-0 you get the total amount of all drives put together, so 2x 64GB drives will give you 128GB. RAID-1 will halve your total capacity, so 2x 64GB drives will give you 64GB, and RAID-5/6 will give you roughly 2/3 of total capacity, so 3x 64GB drives will give you 128GB of storage. RAID-10 will halve you total capacity, so 4x 64GB drives will give you 128GB storage (more about RAID levels further below).
- Where to purchase USB drives
- Search eBay.com for “USB Flash Drive”
- NewEgg USB Flash Drives (available for most countries)
- Scorptec USB Flash Drives (Australia)
- Scan USB Flash Drives (U.K/Europe)
The number of drives you have with determine what RAID level you will be able to create. I suggest 3 (or more) drives which is the minimum required for a RAID-4/5 array that offers a good balance between redundancy and speed. If you only have 2 drives, I suggest using RAID-0, and even though there is no redundancy, RAID-0 rarely fails on solid state media. I have had my workstation running on SATA-3 SSD RAID-0 for years and it never skips a beat, but If you’re storing important files, definitely go with RAID-1.
If you’re confident in your Linux skills you can create a RAID-10 array with 4 drives, which is 2 sets of RAID-1, then each set is used to form a RAID-0 array giving you the benefit of speed and redundancy (I will show you how to create all types of Linux RAID arrays).
|Number of Drives||RAID Level Availability|
Once you’ve chosen a desired RAID level you’re happy with, let’s move onto Install/Update Rasbpian 9.x “Stretch” and mdadm.