Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to repair swap partition?

1,367 views
Skip to first unread message

Don Phillipson

unread,
Apr 13, 2007, 5:12:52 PM4/13/07
to
New(ish) Xandros (Debian) distro for new user.
Problems may be related to swap file. Performance
Monitor reports on bottom right mode line
"No swap space available."

1. Swap file created by Xandros SETUP routines is
Device Boot Start End Blocks Id System
/dev/hdb1 1 756 773120 82 Linux swap / Solaris

2. Command man -k fsck generates:

dosfsck (8) - check and repair MS-DOS file systems
e2fsck (8) - check a Linux ext2/ext3 file system
fsck (8) - check and repair a Linux file system
fsck.ext2 (8) - check a Linux ext2/ext3 file system
fsck.ext3 (8) - check a Linux ext2/ext3 file system
fsck.jfs (8) - initiate replay of the JFS transaction log, and check
and repair a JFS formatted device

3. Command fsck /hdb1 generates

fsck 1.37 (21-Mar-2005)
e2fsck 1.37 (21-Mar-2005)
fsck.ext2: No such file or directory while trying to open /hdb1

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

4. This is not helpful because it says what to do if the
partition is _not_ a swap partition. What should I be doing?

--
Don Phillipson
Carlsbad Springs
(Ottawa, Canada)

Baho Utot

unread,
Apr 13, 2007, 6:31:34 PM4/13/07
to
Don Phillipson wrote:

> New(ish) Xandros (Debian) distro for new user.
> Problems may be related to swap file. Performance
> Monitor reports on bottom right mode line
> "No swap space available."
>
> 1. Swap file created by Xandros SETUP routines is
> Device Boot Start End Blocks Id System
> /dev/hdb1 1 756 773120 82 Linux swap /
> Solaris
>
> 2. Command man -k fsck generates:
>
> dosfsck (8) - check and repair MS-DOS file systems
> e2fsck (8) - check a Linux ext2/ext3 file system
> fsck (8) - check and repair a Linux file system
> fsck.ext2 (8) - check a Linux ext2/ext3 file system
> fsck.ext3 (8) - check a Linux ext2/ext3 file system
> fsck.jfs (8) - initiate replay of the JFS transaction log, and
> check
> and repair a JFS formatted device
>
> 3. Command fsck /hdb1 generates

As it should you really wanted fsck /dev/hdb1.

fsck won't work on swap partitions.

>
> fsck 1.37 (21-Mar-2005)
> e2fsck 1.37 (21-Mar-2005)
> fsck.ext2: No such file or directory while trying to open /hdb1
>
> The superblock could not be read or does not describe a correct ext2
> filesystem. If the device is valid and it really contains an ext2
> filesystem (and not swap or ufs or something else), then the superblock
> is corrupt, and you might try running e2fsck with an alternate superblock:
> e2fsck -b 8193 <device>
>
> 4. This is not helpful because it says what to do if the
> partition is _not_ a swap partition. What should I be doing?
>

OK....

At a terminal run the command free
example:

bash-3.1$ free
total used free shared buffers cached
Mem: 514160 508560 5600 0 27380 278092
-/+ buffers/cache: 203088 311072
Swap: 1052248 0 1052248
bash-3.1$

See the line Swap? it shows 1G of swap on my desktop system.

If it reports that you have 0 total swap then the swap doesn't exist or is
not "active" So....

Try with root permissions running swapon example: swapon /dev/hdb1

If that fails then......

And you are _SURE_ that you want /dev/hdb1 as swap then......

You will need to be carefull to get the right partition so you don't erase
your data by mistake. I used your data from above which is a slave hard
drive on the "first IDE channel".

You remake the swap by:
mkswap /dev/hdb1

followed by:
swapon /dev/hdb1 to activate it.

To "activate" the swap on start up you should have a line like this in
your /etc/fstab

/dev/hdb1 swap swap defaults 0 0

--
Dancin in the ruins tonight
Tayo'y Mga Pinoy

Unruh

unread,
Apr 13, 2007, 9:07:07 PM4/13/07
to
"Don Phillipson" <d.phillips...@ncf.ca> writes:

>New(ish) Xandros (Debian) distro for new user.
>Problems may be related to swap file. Performance

Wwhat problem?

>Monitor reports on bottom right mode line
>"No swap space available."

OK, run top. See how much swapyou have and how much is in use.

>1. Swap file created by Xandros SETUP routines is
> Device Boot Start End Blocks Id System
>/dev/hdb1 1 756 773120 82 Linux swap / Solaris

Looks like 300MB of swap. Should be OK. HOw much memory do you have?
Look in /etc/fstab. Is there anything there about swap?

>2. Command man -k fsck generates:

>dosfsck (8) - check and repair MS-DOS file systems
>e2fsck (8) - check a Linux ext2/ext3 file system
>fsck (8) - check and repair a Linux file system
>fsck.ext2 (8) - check a Linux ext2/ext3 file system
>fsck.ext3 (8) - check a Linux ext2/ext3 file system
>fsck.jfs (8) - initiate replay of the JFS transaction log, and check
>and repair a JFS formatted device

>3. Command fsck /hdb1 generates

That is silly. Swap has nothing to repair. It is raw disk memory that the
operting system fills up.


>fsck 1.37 (21-Mar-2005)
>e2fsck 1.37 (21-Mar-2005)
>fsck.ext2: No such file or directory while trying to open /hdb1

>The superblock could not be read or does not describe a correct ext2
>filesystem. If the device is valid and it really contains an ext2
>filesystem (and not swap or ufs or something else), then the superblock
>is corrupt, and you might try running e2fsck with an alternate superblock:
> e2fsck -b 8193 <device>

No you should not do any of those things.


>4. This is not helpful because it says what to do if the
>partition is _not_ a swap partition. What should I be doing?

Find out why your swap is filling up or why you decided not to mount your
swap partition.

Lew Pitcher

unread,
Apr 14, 2007, 9:38:16 AM4/14/07
to
On Apr 13, 5:12 pm, "Don Phillipson" <d.phillipsonSPAMBL...@ncf.ca>
wrote:

> New(ish) Xandros (Debian) distro for new user.
> Problems may be related to swap file. Performance
> Monitor reports on bottom right mode line
> "No swap space available."
>
> 1. Swap file created by Xandros SETUP routines is
> Device Boot Start End Blocks Id System
> /dev/hdb1 1 756 773120 82 Linux swap / Solaris

OK, so you've partitioned out a swap partition. That's good

> 2. Command man -k fsck generates:

[snip]


> 3. Command fsck /hdb1 generates
>
> fsck 1.37 (21-Mar-2005)
> e2fsck 1.37 (21-Mar-2005)
> fsck.ext2: No such file or directory while trying to open /hdb1

Yah. Swap partitions don't have a filesystem (as such) on them.
There's nothing for fsck (of any flavour) to check.

> 4. This is not helpful because it says what to do if the
> partition is _not_ a swap partition. What should I be doing?


Well, first off
mkswap /dev/hdb1
then
swapon /dev/hdb1

You'll want to read the manual pages on mkswap(8) ("man 8 mkswap") and
swapon(8) ("man 8 swapon"). To summarize, mkswap(8) formats the paging
partition ("swap") for use, and swapon(8) tells the system to start
using the partition for paging.

You'll also want to ensure that your /etc/fstab contains a line like


/dev/hdb1 swap swap defaults 0 0

so that the next time you boot up, you won't need to enter the
swapon(8) command.

HTH
--
Lew


John Thompson

unread,
Apr 14, 2007, 8:06:20 PM4/14/07
to
On 2007-04-13, Don Phillipson <d.phillips...@ncf.ca> wrote:

> New(ish) Xandros (Debian) distro for new user.
> Problems may be related to swap file. Performance
> Monitor reports on bottom right mode line
> "No swap space available."
>
> 1. Swap file created by Xandros SETUP routines is
> Device Boot Start End Blocks Id System
> /dev/hdb1 1 756 773120 82 Linux swap / Solaris
>
> 2. Command man -k fsck generates:

You don't want fsck; you want mkswap, specificaly "mkswap -c /dev/hdb1"
When that completes, do "swapon /dev/hdb1" to activate it.

Make sure you have an appropriate line in /etc/fstab to automatically
activate it when you boot: "/dev/hdb1 none swap sw 0 0"

--

John (jo...@os2.dhs.org)

0 new messages