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

Re: swap not enabled if raid devices not in sync when booting



On Sun, Jan 14, 2001 at 06:14:01PM -0500, Michael Stone wrote:
> On Mon, Jan 15, 2001 at 09:59:49AM +1100, Brian May wrote:
> > >>>>> "Michael" == Michael Stone <mstone@debian.org> writes:
> >     Michael> It is unsafe to use swap on a resyncing raid
> >     Michael> partition. Both swap partitions and swap files will be
> >     Michael> corrupted if active during a resync.  The course taken
> >     Michael> curently is the safest and easiest: if raid is resyncing,
> >     Michael> simply do not activate swap. It should be possible to
> > 
> > Even if this *is* the case, it is still broken behaviour (IMHO), as
> > the swap space is never enabled even when the RAID partitions have
> > finished syncing.
> 
> As I said before, I'm sure that patches would be welcome. Memory
> corruption and kernel panic are big problems. What you're complaining
> about is a comparatively small problem.

So what about changing the last invocation of swapon into
something like:

#
# Execute swapon command again, in case we want to swap to
# a file on a now mounted filesystem.
#
( while grep -qs resync /proc/mdstat
  do
    # Wait for RAID partitions to finish their rsync cycle
    sleep 60
  done
  swapon -a 2> /dev/null ) &

I also did CC: the maintainer of sysvinit for comments on this
patch.

    Ingo
-- 
16                      Hard coded constant for amount of room allowed for
                        cache align and faster forwarding (tunable)

-- seen in /usr/src/linux-2.2.14/net/TUNABLE



Reply to: