On 2/3/06, Ed Wilts <ewilts at ewilts.org> wrote:
>
> On Fri, Feb 03, 2006 at 07:21:33AM -0600, Steve Swantz wrote:
> > On 2/2/06, Josh Trutwin <josh at trutwins.homeip.net> wrote:
> > >
> > > Any thoughts on this issue?  I had assumed that putting swap in the
> > > RAID and having one partition (say /dev/md2) as the swap partition was
> > > the way to go but some netizens argue that this is a performance
> > > problem and that if one drive goes bad it'll still boot ok even though
> > > one of the swap partitions is dead.
> > >
> >
> > I'm more interested in the machine staying up (as opposed to just
> booting
> > up) if one of the swap drives dies, so I put swap on a RAID 1 partition.
> My
> > server is lightly loaded, and I may not be able to get to it fix it for
> > several days at a time, so staying up is most important to me than
> absolute
> > maximum swap performance.
>
> There are two issues to worry about here, and I believe you may be
> getting incorrect information here.


I'm not sure if you're referring to me or to Josh.

First, if you swap on a non-mirrored volume and that volume fails,
> you'll likely crash.


Yes. That's why I have swap on a RAID 1 device.

Creating swap files on non-mirrored drives will
> allow you to boot but not keep you up in the event of a drive failure.


Yes. That's why I have swap on a RAID 1 device.

Secondly, it's important to note that swap and normal file system
> operations aren't the same thing.  If you need to swap and the software
> mirror goes away, you may not recover anyway.  What I've been told is
> that swapping is done at a layer that will not survive a drive failure.
> Doing some googling, though, I see that this was an issue in 2002 and it
> might actually be stable now.


I'm not familiar with that. I  did have a test/spare box with  / on /dev/md0
and swap on /dev/md1 stay up after a having a problem last month. I got a
'degraded array' warning on md0, and a few days later, a 'degraded array'
warning on md1 and the machine stayed up. (The same drive was the problem on
both md devices.) I don't know enough to say whether swap on RAID1 is robust
or if I got lucky. That machine has very little load and 1GB of memory -
it's hard to imagine it using swap much.

When I rebooted it, swap (md1) came up mirrored (to my surprise) but / (md0)
came up as one drive missing. Just to see if it would work, I did a hot add,
it synced, and all was back to normal.

And yes, I am watching the sales for a new drive..

Personally, I wouldn't worry about any potential performance problems
> when swapping.  Swapping sucks anyway.  Buy memory :-).  There's no
> point in having excellent performance if your system is flat down with a
> busted swap drive.


Amen.

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20060203/d17ca2dd/attachment-0001.htm