Is RAID1 possible on an USB stick?

Posted by: admin  :  Category: FreeBSD, HA

Last week we had a discussion at the office wether it would possible to span a RAID across USB sticks.
That question came up as a joke while I was working on some RAID system for evaluation purposes.
Well, my friend doubted it when I replied that it would definitely work out with a FreeBSD software RAID using gmirror (geom vinum as a matter of fact works, too).

Proof?

Here it is, a ‘dmesg’ from my Sony Vaio PCG-C1MGP bootet off two gmirrored 256 MB USB sticks:

Copyright (c) 1992-2007 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 6.2-RELEASE #0: Fri jan 12 10:40:27 UTC 2007
root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Transmeta(tm) Crusoe(tm) Processor TM5800 (727.84-MHz 586-class CPU)
  Origin = "GenuineTmx86" Id = 0x543  Stepping = 3
  Features=0x80893f
real memory  = 251658240 (240 MB)
avail memory = 232452096 (221 MB)
kbd1 at kbdmux9
ath_hal: 0.9.17.2 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
acpi0:  on motherboard
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000
acpi_ec0:  port 0x62,0x66 on acpi0
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x8008-0x800b on acpi0
acpi_lid0:  on acpi0
acpu_button0:
 on acpi0
[ output omitted ]
umass0: Sony USB Memory Stick Slot, rev 1.10/1.83 addr2
umass1: vendor 0x4146 USB Mass Storage Device, rev 2.00/1.00, addr 2
umass2: vendor 0x4146 USB Mass Storage Device, rev 2.00/1.00, addr 3
[ output omitted ]
da0 at umass-sim1 bus 1 target 0 lun 0
da0: <-pretec 256 MB 1.10> Removable Direct Access SCSO device
da0: 1.000MB/s transfers
da0: 242 MB (4964000 512 byte sectors: 64H 32S/T 242C)
da1 at umass-sim1 bus 2 target 0 lun 0
da1: <-pretec 256 MB 1.10> Removable Direct Access SCSO device
da1: 1.000MB/s transfers
da1: 242 MB (4964000 512 byte sectors: 64H 32S/T 242C)
GEOM_MIRROR: Device gm0 created (id=1986392903).
GEOM_MIRROR: Device gm0: provider da0 detected.
GEOM_MIRROR: Device gm0: provider da1 detected.
GEOM_MIRROR: Device gm0: provider da0 activated.
GEOM_MIRROR: Device gm0: provider da1 activated.
GEOM_MIRROR: Device gm0: provider mirror/gm0 launched.
Trying to mount root from ufs:/dev/mirror/gm0s1a

Of course it’s not incredibly fast, but it works afterall, that was the whole point about it 🙂
Where could it be used? Possibly projects like FreeNASNAS4free (What’s a NAS anway? Check out https://www.cloudwards.net/what-is-nas/), which support USB installs, could benefit from doing RAID1 on the sticks while also storing sensitive configuration data on them.
I could also imagine to take backups this way, e.g. keep one working copy on the active stick on the computer, while swapping in spare sticks which then automatically rebuild the mirror.

I suppose this also works with linux ‘md’ software raid, and netbsd’s RAIDframe, though I’ve not tested it.

What about Windows? Definitely not with stock functionality. However as there’s also a way to patch in software RAID1 functionality into Windows 2000/XP Professional, one never knows … 😉

One Response to “Is RAID1 possible on an USB stick?”

  1. Really Required Says:

    Why wouldn’t it work anyway? gmirror works on any mass device that has a /dev entry.