Swap fixups, concerning Read-error on swap device

Mike Lord wrote 2007-08-29

> Read-error on swap-device (8:0:99814256)

Looks like a bad sector in the swap partition.
You can probably repair it by using this sequence of commands:

swapoff /dev/sdX <--- replace sdX with actual swap partition dev name sync cat /dev/zero > /dev/sdX
mkswap /dev/sdX
swapon /dev/sdX

If it recurs after doing that, then it’s time for a new drive.

MS3FGX in linuxquestions says “You can use the -c option of mkswap to check for bad blocks”:

sudo swapoff -a
sudo mkswap -c /dev/hdaX
sudo swapon -a

About pauljohn

Paul E. Johnson is a Professor of Political Science at the University of Kansas. He is an avid Linux User, an adequate system administrator and C programmer, and humility is one of his greatest strengths.
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply