[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 Monday 15 January 2001 15:41, Ingo Saitz wrote:
> > >     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 ) &

This could result in the swapon phase taking 2-3 hours on some machines and 
being as unusable as the pre-raidtools2 code!

I attended a presentation at linux.conf.au on RAID.  There I was informed 
that the old code was buggy and had problems when resyncing with swap and 
with journalled file systems.  The new version in 2.4.0 is supposed to fix 
this.  Maybe a check of the `uname -r | cut -c1-3` to see if it's "2.2" would 
be useful to determine if this is necessary.

Anyway IMHO the proper solution to broken 2.2 kernels would be to make the 
"swapon" program write an appropriate message to the screen and to syslog and 
to then daemonise itself and perform the operation when the resync is 

http://www.coker.com.au/bonnie++/     Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/       Postal SMTP/POP benchmark
http://www.coker.com.au/projects.html Projects I am working on
http://www.coker.com.au/~russell/     My home page

Reply to: