VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: swap priority -1  (Read 2140 times)

FuturDreamz

  • Member
  • *
  • Posts: 15
swap priority -1
« on: May 30, 2008, 08:46:11 pm »

hello.
basically I missed setting /dev/hda2 as swap upon installation, trying to do it now.
I tried, following instructions online:
mkswap /dev/hda2
swapon /dev/hda2
and adding to /etc/fstab:
/dev/hdb2               swap                    swap    defaults        0 0
rebooted, and swap is not used. at all.
swapon -s reveals that the priority is set to -1, tried using swapon to fix, no dice.
help?

bigpaws

  • Vectorian
  • ****
  • Posts: 1871
Re: swap priority -1
« Reply #1 on: May 30, 2008, 09:01:47 pm »

According to this you have a problem:

swapon /dev/hda2

/dev/hdb2               swap                    swap    defaults        0 0

Fix that and you should be good to go.

Bigpaws
Logged

FuturDreamz

  • Member
  • *
  • Posts: 15
Re: swap priority -1
« Reply #2 on: May 30, 2008, 09:10:27 pm »

"no such file or directory"

bigpaws

  • Vectorian
  • ****
  • Posts: 1871
Re: swap priority -1
« Reply #3 on: May 30, 2008, 09:17:17 pm »

You have the wrong directory listed in fstab

Bigpaws
Logged

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4130
Re: swap priority -1
« Reply #4 on: May 31, 2008, 05:06:56 am »

As Bigpaws indicated, if the command swapon /dev/hda2 works, your fstab line must also point to hda2, not hdb2
Logged

FuturDreamz

  • Member
  • *
  • Posts: 15
Re: swap priority -1
« Reply #5 on: May 31, 2008, 07:43:00 am »

when I have it set to hda2, it is seen in swapon -s, but it is not used, and the priority is set to a negative, and some research indicates that a negative prioity= error.

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4130
Re: swap priority -1
« Reply #6 on: May 31, 2008, 08:03:51 am »

According to this, a negative number is assigned by the kernel:
http://lists.debian.org/debian-user/2002/09/msg01075.html

Looking at my own system, "swapon -s" shows a -1 priority. "Used" shows 0, but that is normal. Only when I push my system hard and for a long time, do I ever use swap. Hint: run "htop" in a terminal to watch CPU/swap usage.
Logged

FuturDreamz

  • Member
  • *
  • Posts: 15
Re: swap priority -1
« Reply #7 on: May 31, 2008, 08:10:15 am »

so if I half the ram swap will be used?

Dweeberkitty

  • Packager
  • Vectorian
  • ****
  • Posts: 836
    • Multimedia Bonus Disc
Re: swap priority -1
« Reply #8 on: May 31, 2008, 08:12:30 am »

so if I half the ram swap will be used?

Probably but I wouldn't recommend it. Swap is much slower than RAM.
Logged
Registered Linux User #443399
Desktop: Intel Pentium D 3.33Ghz, 320GB hard drive, 2 gigs DDR2 533mhz RAM, NVIDIA Geforce 7800 GS, X2GEN 22" widescreen monitor;
Laptop: Dell Mini 9, Intel Atom 1.6Ghz, 1GB ram
Multimedia Bonus Disc website: http://www.vectorlinuxsolutions.com/

FuturDreamz

  • Member
  • *
  • Posts: 15
Re: swap priority -1
« Reply #9 on: May 31, 2008, 08:23:16 am »

I'll be switching it back now, just wanted to confirm swap working, which it is.

thanks.

seems to run perfectly fine with only 128mb tho.