[CLUE-Tech] RAID 1 on Linux

Carl Schelin co_bofh at yahoo.com
Wed Oct 20 19:52:44 MDT 2004


[Heavy snippage]

--- Nate Duehr <nate at natetech.com> wrote:

> 
> On Oct 19, 2004, at 7:41 PM, Carl Schelin wrote:
> 
> > Ok, question on RAIDing an existing linux system.
> >
> > A little background first. I'm mainly a Solaris
> guy.
> > I've installed RAIDs on Sun boxes many times. The
> > procedure is simple. Create the raid using the
> > existing slices and add the new slices to the new
> > raid. They syncronize and it's working.
> 
> Yeah, I was mainly a non-Solaris guy until the last
> couple of years, 
> and I must say, software RAID on Solaris is pretty
> simple to deal with.

Amen!

> 
> > Does anyone have a pointer to a document that
> debunks
> > this? Can I in fact, add a second disk and make
> the
> > system RAID 1 or do I have to back it off and
> > reinstall?
> 
> I finally figured out most of this from an article
> in Sysadmin magazine 
> about it.  Unfortunately I don't think this
> particular article is 
> available online anywhere.

Well there's the problem. After reading a couple of
issues I felt it was useless even as toilet paper, due
to the clay content :-/  I wouldn't have considered
looking there.

> 
> Carl, one of the other folks is right in their
> hunch.  You can create a 
> RAID1 with a failed member directly.



> 
> So you create a new "RAID'ed" filesystem on the new
> disk that is 
> configured with your original partition on the good
> disk as a failed 
> member, mount the "RAID" (in quotes because it's
> really only the new 
> disk at this point), copy the files over, and then
> edit fstab to use 
> the RAID for that filesystem and either remount or
> reboot (depending on 
> what filesystem you're talking about here), then
> "repair" the RAID by 
> hot-adding the original partition back in.

What I did was copy the files in the non-root
partitions over to the "RAID" first and then modify
the fstab to mount them. I was going to at least get
the non-root partitions mounted and working just to
see if it could be done. That was when I fscked up hdc
so bad that even a reinstall failed (ran out of space
in /dev/ram's /tmp directory due to the number of
errors).

My intention was to hotadd the disks as you mention
after getting /dev/md[678] mounted and functioning.

> 
> When you first boot/remount, the system uses the
> "RAID" and it comes up 
> in degraded mode.  You stop and check everything
> carefully at this 
> point and after you're darn sure all your data is
> there (you of COURSE 
> made backups before starting all this right? 
> GRIN...)

In this case no backups were necessary. New
installation. I did get it working but for future work
I'd like to be able to do it with a minimum of fuss,
so this is more of knowledge gathering than trying to
fix an existing problem.

> The article in Sysadmin also showed how to layer LVM
> on top of the 
> RAID's -- I didn't really feel the need to go that
> far, but it was a 
> nifty idea, so you could resize everything on the
> fly, but at the cost 
> of huge overhead.

Being horrible with names, I'm sure I've seen you on
the co-sage list. Are you the same guy who came in
with Wendy at the recent meeting (just trying to lock
the name in with the face)?

In any case, LVM was mentioned to me before but I
wasn't looking to manage partitions in that manner, at
least not yet.

> 
> Here's the rub though -- software RAID1 on 2.4
> kernels from hard 
> testing I read on some of the Debian mailing lists
> from folks like 
> Russel Coker who wrote bonnie++, shows that there's
> NO intelligence 
> about read performance in a Linux Kernel software
> RAID-1.  It *always* 
> reads from a single disk, and writes to both.

I'd like more info on this. In particular, was the
testing on a specific account? In other words, could
it be session related so that the system uses a
particular disk for a process/session but it does
switch up. Not the best solution, just wondering.

>  It
> gives you 
> zero-performance-gain for reads, which a lot of
> Solaris admins would 
> expect to see from their much more mature software
> RAID software. 

I'm not sure I expected it to be mature. I do expect
it to follow the definition of RAID though. It's
possible that I'm reading someone's opinion of how
cool it works on Solaris rather than how it's supposed
to work. In any case, I'm not too concerned about
performance. More with having a decent chance of not
losing data in the event of a disk failure.

> 
> Personally I found the performance hit on one of my
> busier machines not 
> to be worth it, and I switched back from software
> RAID-1 to rsync'ing 
> to the second drive periodically and to another
> machine across the 
> network.

At the moment, my intention is to have the web content
on a different machine and pushed out to this one. The
only thing that'd be lost would be any stored e-mail.
The configuration is written as I create it and will
be duped over to the old linux box (the one in use
now).

> 
> My experience with disk failures and Linux
> software-RAID was not good 
> either --  I sat and watched a drive fail in my
> RAID-1 server one 
> night, kernel messages clearly showed it throwing
> hardware errors, yet 
> software RAID never tagged it as "bad" in any way,
> and during the next 
> system reboot (bad idea on my part), software RAID
> somehow decided the 
> disk with the ERRORS was the good disk and started
> syncing the bad data 
> to the good disk.  (Definitely my fault, I forgot to
> tag the drive bad 
> myself.)  Thank goodness for backups.  I'm
> definitely NOT impressed 
> with the Linux kernel RAID-1.

Could you have a process monitoring the status of the
RAID (like mdadm monitor mode) and flag it as failed?
In this case, it's getting to be less and less likely
I'd recommend RAID 1 on linux to anyone. If I was
going with RAID 5 or higher, I'd certainly go with
SCSI.

> 
> Hope this helps.
> 

It helps a great deal. Not necessarily with the
configuration. It sounds like I was doing that but
dicked it up somehow. Thanks for confirming I was
doing it correctly though and especially thanks for
the additional info on the other issues you've had
with RAID 1.

> --
> Nate Duehr, nate at natetech.com

Carl


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com



More information about the clue-tech mailing list