Linux RAID 0 on USB Flash Drives
*Doubling Speed and Storage with Off-the-Shelf USBs*
Introduction: The Quest for USB RAID
I was able to create a Linux RAID 0 Array with two (2) SanDisk 32gb Ultra USB 3.0 Flash Drives. I opted for RAID 0 - Striping as it would give me one logical 64gb Drive with theoretically 'double' the speed.
Due to the Linux Test Machine having only USB 2.0 ports, the theoretical maximum it could achieve is limited by USB 2.0 max speed of 480mbits/sec (roughly 60mb/sec).
Building the RAID 0 Array
Initial test of a Single USB Flash Drive showed a 30mb/sec Read Speed.
To begin, I installed mdadm, which was conveniently located in the Ubuntu Software Center. I reviewed other users' guides, and none worked exactly as described. However, after reviewing each one, I was able to piece together the necessary terminal commands and steps to take.
- →sudo -s — Enter Superuser mode
- →Enter Admin Password — Provide administrative credentials
- →mdadm -Cv /dev/md0 -l0 -n2 /dev/sdc /dev/sdd — Create the RAID 0 array
- →mke2fs /dev/md0 — Format the new RAID array with ext2 filesystem
- →mount /dev/md0 /mnt/samsung — Mount the array to a designated directory
I also had to mess around in disks to get things to work. Afterward, I renamed the Lost+Found folder to 'USB Files' as that was the only folder that allowed me to edit data on the new RAID Array.
Performance Benchmarks
The RAID 0 array did improve speeds by 50% on READ, achieving 46mb/sec. This might be the most I can expect on USB 2.0 ports. On a USB 3.0 machine, I anticipate a more significant boost; I was experiencing about 75mb/sec READ on a Windows PC with USB 3.0 ports, and it might enjoy 150mb/sec+ if that were a Linux machine!
I tried the Disks Utility - Benchmark and it gave me these results:
| Configuration | Observed Read Speed | Observed Write Speed | Avg Access Time |
|---|---|---|---|
| Single USB Flash Drive | 30 MB/s | N/A | N/A |
| RAID 0 Array (Actual) | 46 MB/s | N/A | N/A |
| RAID 0 Array (Benchmark) | 70 MB/s | 20 MB/s | N/A |
| Laptop HDD (Benchmark) | 47 MB/s | N/A | N/A |
| Single USB Drive (Benchmark) | ~30 MB/s | ~6 MB/s | Better than RAID |
Another possibility of why I'm not observing 70mb/sec READ speeds is maybe the laptop's HDD is the bottleneck? The WD 250gb HDD is giving me about 47mb/sec which is what I was observing in the data transfer from the RAID USBs. The RAID improved the READ speed, however...interestingly the Avg Access Time is better on the single USB Flash Drive vs. the RAID.
Conclusion: Practicality and Future Thoughts
The plus-side, I now have a logical 64gb USB Flash Drive and don't feel 'as bad' in buying two (2) 32gb drives...when I should have gotten another bad-ass 64gb CZ80 Extreme. To make it even better...this running RAID 0 makes it technically faster than the a single CZ80 could have ever been in a USB 2.0 port. And perhaps make it on par in READ speed at least on a USB 3.0 port.
The other downside...the USB Flash Drives must work as a pair and on a Linux Environment that can recognize them. Maybe that's okay as I'll only use these in the Lab.







Comments
Post a Comment