header image
Home arrow LUG How Tos arrow How To RAID USB Mass Storage Devices
How To RAID USB Mass Storage Devices Print
Dec 09, 2007 at 04:29 PM
Article Index
How To RAID USB Mass Storage Devices
Page 2
Page 3
Page 4

What sticks can I use?
Sticks of any brand or storage space can be used together. However, using usb sticks that are all the same size and all the same speed will make it significantly easier to create an optimal array. Different sized sticks can be used, bit it makes a significantly more complex layout. The same goes for speed. Your slowest stick will limit the speed of your array. RAID can be set up to account for this, but that goes beyond what I will talk about here.

Physical size One thing to mention is the physical size of the sticks. Most usb slots are fitted close together and you may have problems plugging all the sticks in. Make sure the sticks are small enough physically to fit in the usb slots.

You may wish to plug the sticks into a usb hub and make a high-speed external storage device. Again, check the spacing on the hub to make sure the sticks will fit properly. If all else fails, you could void the warranty of the sticks and try remove the plastic casing. I don't recommend this, but if you're reading this article, you're already a tinkerer.

Partitioning:
NOTE: If your usb sticks aren't new, make sure you don't have any data on them!

Plug in the usb sticks you will be using. Each usb stick plugged in will add a couple entries in /dev. First, the (possibly) familiar /dev/sdx (where x will probably be b,c,d,e,f, etc). This is by far the most commonly used file for access to disks. But, we won't be using them for a couple reasons. First, your hard drive uses them. Typing the wrong name could easily wipe your PC without asking; and second, these are automatically assigned and won't get assigned the same way each time. We need something more consistent.

Instead of /dev/sdx we will use the entries in /dev/disk/by-id. In this directory you will see a bunch of entries starting with usb. These represent the usb drives and provide the same interface as the devices in /dev/sdx, but they will be the same each time the stick is plugged in and are also a bit more descriptive. You'll also notice some end in part1 (maybe 2 as well). These would be /dev/sdx1.

Run fdisk for each usb device (the whole device, not the partitions that end in -part1) as follows:

fdisk /dev/disk/by-id/usb-0930_USB_Flash_Memory_0400AB614E19A4C-0\:0

Obviously the device name will be different for each device.
Then use these commands:
d      (deletes the partition that's already there)
n      (new partition) p (primary)
1      (partition #1)
        {Enter} (start at beginning of device)
        {Enter} (stop at end of device)
t      (set partition type)
fd     (Linux raid autodetect)
w     (write changes to device and exit)

Again, repeat the above for each device. Now we are ready to combine the usb devices into raid.

Note that we technically don't need a partition table on the sticks. We can raid together the whole device as a partition. Only when doing more complex arrangements is partitioning necessary. I do so simply because doing it isn't going to hurt anything.


EC_LUG -Eau Claire Linux users group is an informal group of Linux and open source software enthusiasts.

We meet each Thursday at 7 p.m. at  420 Cafe, 420 Washington Ave. Eau Claire, Wisconsin.

Linux 101:
What's All The Fuss? video...

Mac vs. PC: How Would Linux Fit?
video1...

video2...
video3...

Linux User GroupsLug Link Logo