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

Graceful Start-up and Shutdown:
Someone well-versed in one of the Linux auto-mounting systems would be able to write scripts to support auto-magic mounting of the raid array whenever the devices were plugged in. I am not that person. Instead, we'll just start it up with our own scripts.

Make a directory to mount the array under (I'm putting mine at /mnt/raid). Now open up and add the following line:

/mnt/raid ext3 defaults,noatime,noauto,user 0 0

Remember to replace /mnt/raid with whatever directory you want to use to access the raid.

That line does a couple things. It sets up the noatime option on the partition. This is important because otherwise every read would cause a write. Not something we want for a device with limited writes! It also says to not mount it at boot time. It would fail because the raid isn't set up yet. And lastly it lets a normal user without superuser access mount the file system.

Now we can make our scripts:
startUSBRaid
#!/bin/sh
mdadm --auto-detect
mount
/dev/md10

stopUSBRaid
#!/bin/sh
umount
/dev/md10
mdadm --stop /dev/dm10

Now make both executable with:
chmod +x *USBRaid

That's it. You should now be able to start and stop the raid with these scripts. If you like, you can set them to run when you log in and log out or even when the PC boots up.

Life Expectancy:
One other thing to keep in mind is life expectancy of flash storage devices. They can be read any number of times, but have limited writes. Because of this I do not recommend using flash on often changing data. The write speed of flash devices makes it less desirable to do so anyway. Flash devices will shine on small files that must be randomly accessed and don't change often.

It should also be noted that mounting without the noatime option is probably not a good idea. As noted above, without the noatime option, file metadata will be updated each time the file is read. Having atime on would significantly reduce the life of the drives and will slow them down too.

Pros:
There are a couple of benefits of using memory sticks as opposed to hard drives.

Power usage
Memory sticks take very little power compared to hard drives. A disk-less PC would save some power.

dB Level
Memory sticks are silent. Hard Drives are the second noisiest component on the PC (behind fans). If you're dB conscious, memory sticks are the way to go.

Component wear
Hard drives are turning whether they are being used or not. Memory sticks have wear only when they are being written to. Memory sticks on a read only file system will outlast the usefulness of the PC.

Seek time
Memory sticks have a constant and fairly small seek time compared with hard drives. This makes them much faster than hard drives.

Cons:
Limited Writes
Memory sticks can only be written so many times before they start reporting errors. And, unlike hard drives, errors are not detected as errors. That means raid 1 or raid 5 are required to detect errors in the data.

Slow Writes
Although read speeds are respectable, write speeds are very slow with memory sticks.

Cost
The price of memory sticks are going down, but they are still very expensive when compared to hard drives. For now, they are best on small partitions with lots of small files.

Dec 2, 2007
byronholldorf2{at}yahoo{dot}com



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