How to repair swap partition? - Setup

This is a discussion on How to repair swap partition? - Setup ; 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 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: How to repair swap partition?

  1. How to repair swap partition?

    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

    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)




  2. Re: How to repair swap partition?

    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
    >
    > 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

  3. Re: How to repair swap partition?

    "Don Phillipson" 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


    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.


    >--
    >Don Phillipson
    >Carlsbad Springs
    >(Ottawa, Canada)





  4. Re: How to repair swap partition?

    On Apr 13, 5:12 pm, "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


    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



  5. Re: How to repair swap partition?

    On 2007-04-13, 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:


    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 (john@os2.dhs.org)

+ Reply to Thread