JP Vossen on 4 Jan 2011 22:49:32 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Software mirror (RAID1)


I'm going off on a tangent to Rich's RAID5 question. I don't have a better answer for him, and he's already covered my objections to abusing RAID5. :-)

Instead, I'm going to argue for use of RAID1 (mirroring) in general, for home and small-mid corporate use on a shoe-string budget. This does not apply to large data centers, large well-funded corporations, or performance critical applications. But for anyone with a "server" at home, and for those in small jack-of-all-trades IT departments, it's valid.


NOTE: RAID is **not** a backup!!! RAID & backups are different things and using RAID does not allow you not to back up! (For great info on backup see _Backup & Recovery_ by Preston, and his http://backupcentral.com/ site.)


RAID1 Pros:
	* Simple
	* Very robust
	* Fits in 1u pizza-box servers
	* Fewer drives = less electricity & cooling
	* Facilitates other uses (cloning, back-out, drive upgrades)
RAID1 Cons:
	* Arguably costs more than other solutions
	* Arguably slower than other solutions
	* Can't get as large as other solutions


~~~~~~~~~~~~~~~~~~~~~~~

* Simple
RAID1 is a copy; same data on 2 drives, so when (not if) one drive fails, hopefully the other will keep working, at least long enough so save the current data.

In theory, you should use drives from different manufacturers or at least different lots, though in practice that's not always easy or practical.


* Very robust
By that I mean that you do not need to depend on a hardware card, but even if you do use hardware, since the data is just a copy, either working drive is as good as the other. With a failed RAID5 card, you are toast until/unless you can find the exact same card and plug your drives into it. That isn't a problem if using software RAID5, but since any RAID5 spreads the data across the drives in stripes, it's much harder to recover if needed. 1 drive out of RAID1 is just--a drive. Standard recovery tools can handle it.


* Fits in 1u pizza-box servers
Most of my servers are 1u pizza-box servers that fix 2--count 'em--2 drives. Not 3 or more, 2. 'Nough said.


* Fewer drives = less electricity & cooling
Probably pretty obvious.


* Other uses (cloning, back-out, hard drive upgrades)
a) Cloning: Yank a mirror drive, install someplace else and you have a clone. Yes, there are many other ways to do that. Choice is a good thing. You can also do this to spread out purchases and to try and get different lot numbers for drives. Order drives over a period of months, and swap around, migrating older drives to older/less critical systems.

b) Back-out: Last week I downed my 2nd drive, upgraded Mythbuntu from 8.04 to 10.04 and let it go for a few days. If I'd had to revert the upgrade, I'd just wipe the 1st drive, boot the 2nd drive, and re-sync. FYI, it took 29 hours to re-sync the 40% used 2TB disks when I decided the upgrade had worked. But the server was up and running during it all, except for the reboots to swap physical hardware.

c) Ditto hard drive upgrades to bigger drives.
	1) Down the secondary drive
	2) Install the new bigger drive
	3) Re-sync to tweaked larger volume (can take a while!)
	4) Swap out the other old drive for the new big one
	5) Re-sync (can take a while!)
	6) Re-grub, and cleanup

Almost all of the action happens while the server is up and running, the only down-time is the reboots for the hardware swaps. Over my Thanksgiving and Xmas PTO breaks I did a 6 server hard drive cascade using this method, so I have extensive docs and some scripts to do this if anyone is interested. (Added mirror to 1 machine without, swapped newer/bigger drives into some machines and cascaded the old drives into others, down the line.)



* Arguably costs more than other solutions
In RAID5 you have N-1 capacity, but in RAID1 you have N/2 capacity. Yup, them's the breaks. But hard drives are so cheap, I don't care (YMMV).


* Arguably slower than other solutions
I'm not sure this matters when using a software implementation, especially compared to a software RAID5. But people will argue that other schemes are faster for this or that. Probably, but for the use-cases I outlined, this is more than Good Enough.


* Can't get as large as other solutions
True in the simple case since you are limited in size to the larges single drive you can find. You can get around that using LVM and probably other ways if needed, though that will drastically reduce the "other uses" capabilities.

I see 3TB drives on PriceWatch, and they aren't going to get any smaller, so I'm not that worried about it for the use-cases I outlined.



~~~~~~~~~~~~~~~~~~~~~~~
Rich said:
> Expanding a RAID1 is not practical, but expanding a RAID5 is trivial.

Depending on how you define it, expanding RAID1 is easy, but a bit time consuming. As noted above, you can expand onto bigger hard drives pretty easily without any reinstalls. No, not the same as or quite as easy as expanding a RAID5, but not impractical either.

How cool is that? The only time you need to reinstall Debian or Ubuntu is when you switch from 32 to 64 bit, if you haven't already. :-) Otherwise, moving to larger hard drives--while you are up and running--is now easy if you're using RAID1. If you have hot-swap support you don't even need to reboot (I still do,, since I'm not 100% sure about it).


Later,
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|      http://bashcookbook.com/
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug