Results 1 to 10 of 13
Hello, I'm running Slackware 12. Kernel 2.6.26-SMP (Which has saved me a lot of setup headaches) on an HP Pavilian dv9000. Intel DualCore 2GB RAM. I recently was playing around ...
- 07-27-2008 #1
Swap isn't working, what gives?
Hello, I'm running Slackware 12. Kernel 2.6.26-SMP (Which has saved me a lot of setup headaches) on an HP Pavilian dv9000. Intel DualCore 2GB RAM. I recently was playing around with Karamba and noticed that no swap was being used. I ran 'free -m' and this is my output:
total used free shared buffers cached
Mem: 2025 577 1447 0 19 295
-/+ buffers/cache: 262 1762
Swap: 0 0 0
I cat'd /etc/fstab and it reads:
/dev/sda1 swap swap defaults 0 0
/dev/sdb1 / ext3 defaults 1 1
/dev/sda3 /home defaults 1 2
/dev/sda2 /boot defaults 1 2
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
#/dev/sdc1 /mnt/usbdisk vfat users,rw,noauto,unhide 0 0
I fdisk'd '/dev/sda1 and it hit 'p' and it says:
root@darkstar:/home/wahcordian# fdisk /dev/sda1
Command (m for help): p
Disk /dev/sda1: 4211 MB, 4211311104 bytes
255 heads, 63 sectors/track, 511 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1p1 1 511 4104576 82 Linux swap
Command (m for help):
So my question is... what gives? Why no swap usage? I opened a butt-load of konquerer's at the same time to see if I just wasn't putting a large enough load on it to need the swap, but I ended up using my ram and no swap space. Also, is it correct to allocate twice the swap space as available ram? ie. I have 2 GB of RAM so 4 GB of swap is a good idea?
Thanks in advance for any answers or a kick in the right direction!
Cheers!
-Wahcordian
Oh yes and I just tried 'swapon -a' and it reads:
root@darkstar:/home/wahcordian# swapon -a
swapon: /dev/sda1: Invalid argument
Cheers
- 07-27-2008 #2
oh oh oh and I just tried dmesg after I swapon -a and it reads: "Swap area shorter than signature indicates"
Thats probably pretty important... I guess I should google that!
- 07-27-2008 #3
If there's no swap the machine will put a swap file on your disk. Technically, this is not a 'man overboard' type of situation.
Some people even claim that with that much RAM you don't need any swap. Certainly, the old rule of thumb (swap = 2xRAM) doesn't really apply. It's up to you though. I probably would use a gig of swap.
That said, having errors isn't very good. What was the output of this:
Code:fdisk -l # the l is a lower case L dmesg | grep -i swap dmesg | grep -i other_errors
Hmmm, yeah. That does seem important.
Originally Posted by wahcordian Can't tell an OS by it's GUI
- 07-28-2008 #4
Thanks for the response. The googling wasn't as helpful as I'd hoped. Here's the output for the commands:
root@darkstar:/home/wahcordian# fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 1 512 4112608+ 82 Linux swap
/dev/sda2 * 513 514 16065 83 Linux
/dev/sda3 515 14593 113089567+ 83 Linux
Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 9729 78148161 83 Linux
root@darkstar:/home/wahcordian# dmesg | grep -i swap
Adding 4112600k swap on /dev/sda1. Priority:-1 extents:1 across:4112600k
the las dmesg grep didn't return anything.
- 07-28-2008 #5For all I can see here, everything looks fine. Does it work now??
Originally Posted by wahcordian 
No that was not meant literally
Originally Posted by wahcordian 
Whenever I find myself in trouble, and I don't know where to start looking, I just fire a range of searches at the logs.
Something like:
Because if there is something wrong with the machine, it's bound to complain about it somewhere, somehow. And error messages give something to work with. (Also, it's a good checkup on the overall condition of your install)Code:dmesg|grep -i error dmesg|grep -iv default|grep -i fault dmesg|grep -iv debug|grep -i bug dmesg|grep -i not dmesg|grep -i swap dmesg|grep -i partition dmesg|grep -i problem dmesg|grep -i unable dmesg|grep -i whatever you can think off
Does that come up with anything?Can't tell an OS by it's GUI
- 07-28-2008 #6
i wouldn't worry about it, you'll be pretty hard pressed to use up 2 gb of ram
if your system isn't using the swap, then it doesn't need to
linux memory management is different from windows, it caches files in memory for performance, those cached files will be replaced by actual memory allocation by applications, if that memory runs out then swap comes into play, my guess is you just aren't filling it up the memory and therefore are not in need of swap
- 07-28-2008 #7Same here. No worries. And as said, having no swap doesn't cripple the system. It's just cleaner. But if it was my system, I wouldn't like it to have configs that lead to errors.
Originally Posted by coopstah13 Can't tell an OS by it's GUI
- 07-29-2008 #8
Well, I haven't really seen my ram jump above around a gig as of late. So no swap usage thus far. I'll keep an eye on it. I know it's not a big deal, but part of usin' Linux is getting things working and understanding why they work or don't work. When I run swapon -a now it doesn't return errors. Including after a reboot, so thats a good sign

grepped a few dmesg's
root@darkstar:/home/wahcordian/tmp# dmesg | grep sda1
sda: sda1 sda2 sda3
Adding 4112600k swap on /dev/sda1. Priority:-1 extents:1 across:4112600k
root@darkstar:/home/wahcordian/tmp# dmesg | grep swap
Adding 4112600k swap on /dev/sda1. Priority:-1 extents:1 across:4112600k
all greps for 'error' 'Error' and 'ERROR' turned up with nothing
- 08-01-2008 #9
Well I've been running Amarok, Open Office, Mozilla, and a few other Apps. Ram does jump up to close to 2GB, I understand that it's mostly caching, but I'm still concerned that not having swap functioning is a misconfiguration issue. Is there anything else you can recommend?
- 08-01-2008 #10
haha nevermind, it must be working because I'm using 2 of 4016mb of swap according to 'free -m'


Reply With Quote
