Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
swapoff fails [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
HeXiLeD
Veteran
Veteran


Joined: 20 Aug 2005
Posts: 1083
Location: Online

PostPosted: Fri Aug 25, 2006 6:20 pm    Post subject: swapoff fails [SOLVED] Reply with quote

For some weird reason.. i cant seem to swapoff

fstab
Code:
/dev/sda2               none            swap            sw                      0 0


Code:
# swapoff /dev/sda2
swapoff: /dev/sda2: Cannot allocate memory

# swapoff -V /dev/sda2
swapoff: mount-2.12r

# swapoff -V /dev/sda2
swapoff: mount-2.12r

sync ; mkswap /dev/sda2
Setting up swapspace version 1, size = 1998737 kB
no label, UUID=35ebbf2e-be66-48a3-adc0-2e42b5ab5d3a

# swapon /dev/sda2
swapon: /dev/sda2: Device or resource busy

# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       1951888 1365836 -1




_________________
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244


Last edited by HeXiLeD on Fri Aug 25, 2006 11:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 9346

PostPosted: Fri Aug 25, 2006 9:22 pm    Post subject: Reply with quote

What does free report?
Back to top
View user's profile Send private message
HeXiLeD
Veteran
Veteran


Joined: 20 Aug 2005
Posts: 1083
Location: Online

PostPosted: Fri Aug 25, 2006 11:20 pm    Post subject: Reply with quote

I found out why swapoff fails; and its because the amount of swap file being used is bigger than what can fit in the my RAM

In other words, when we do swapoff; all that is stored in the swap will be moved to the amount of free RAM available.
If the free RAM available is less than the swap being used, the system cant turn off the swap because it needs to 'dump' it to the RAM

In other words if you have 512 of ram and you only have 100mb of that ram available and your swap is using 300mb, you cant swapoff because the 300mb of the swap wount be able to fit in the free 100mb of the RAM.

To test this i killed most applications that i wasnt using at the time and tried to lower the amount of RAM and SWAP being used at the moment.

Once the i was able to free enough RAM i was able to swapoff it no issues.

This problem is solved.
_________________
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum