System crashing when swap hits 25%
pyevet at aapt.net.au
Mon Mar 10 23:50:48 UTC 2008
On Mon, 2008-03-10 at 18:33 -0400, Kevin J. Cummings wrote:
> Todd Denniston wrote:
> > Simon Slater wrote, On 03/10/2008 06:37 PM:
> >> G'day all,
> >> This is an inconvenience that I would like to get to the
> >> bottom of. I
> >> have a PII 233MHz 512 MbRAM running FC6. All is fine until swap reaches
> >> about 25% used then the system hangs. It will run for days with the
> >> swap at 10-15%. My first thought was to run badblocks to see if that
> >> was the problem, since it is an old drive, but couldn't find the swap
> >> device with mount.
> > Been there, done that.
> > WARNING: before using badblocks in full rw mode on swap space,
> > remember two things:
> > 1) some how you would have to convince mkswap to retake what ever
> > label is being used in /etc/fstab, or you would need to use a new
> > label/device name in /etc/fstab.
> > 2) don't be using it for swap while checking it. :)
> > /sbin/swapon -s
> > will display which partitions/files are being used in the system for
> > swap.
> > /sbin/swapoff -a
> > will turn swap off. probably should shut down any programs down that
> > you don't need so that you can get under 512MB, then badblocks (with
> > full read/write test and re-`mkswap -c` on it, or Use non-destructive
> > read-write mode) sounds like a reasonable thing.
> > If you find a single bad block, you should really be looking for new
> > hardware.
> > I have done the thing where you partition around the bad blocks, but
> > it only buys you a little time.
> > If I understand the man-page for mkswap the -c will print the bad
> > block locations, it says nothing of setting up swap to avoid them.
> Here's a thought, create a swap *file*, at least as big as your swap
> partition if you can, but at least as big as necessary to hold what is
> in swap now. Enable it with "swapon pathname".
> *then* turn off your old swap partition. *then* check it for bad blocks
> by re-running mkswap on it with the -c option. Now you will be
> protected in case in case you *can't* swap everything back in.
> >> My questions are: what would cause this system to hang when the swap
> >> file is used?;
> > [from experience I know] Bad blocks in swap cause errors that look
> > _just_ like failing ram. That is, programs just die, system locks up
> > in weird ways.
> >> where is the swap file?;
> > Most times it is a swap partition, `/sbin/swapon -s` or `cat
> > /proc/swaps` will help here.
> >> if in the VG, how do I umount it
> >> to run badblocks?
> > /sbin/swapoff
> >> Here is some output that may be useful.
> >> Thanks.
> > Good luck.
Perhaps I'll go and double check everything is backed up-to-date first.
[simon at Ipex ~]$ cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults
LABEL=/boot /boot ext3 defaults
devpts /dev/pts devpts gid=5,mode=620
tmpfs /dev/shm tmpfs defaults
proc /proc proc defaults
sysfs /sys sysfs defaults
/dev/VolGroup00/LogVol01 swap swap defaults
[simon at Ipex ~]$ /sbin/swapon -s
Filename Type Size Used
/dev/mapper/VolGroup00-LogVol01 partition 1048568 4
So swap has its own LV. I've been putting off toying with LVM. I have
a new dual boot laptop with some unused space, but have been daunted by
what I've read so far. Guess its better to learn on these old drives
than the new one.
I'll post back with how it goes ... or questions if it doesn't.
More information about the users