No swap with kernel 2.6.4

Submitted by Anonymous
on April 27, 2004 - 1:02am

Hi,

I have compiled kernel 2.6.4. Just today I realized from the output of the free memory that I don't have swap space anymore:
t@Colossus:~$ free -m
total used free shared buffers cached
Mem: 502 409 93 0 44 229
-/+ buffers/cache: 136 366
Swap: 0 0 0

But I have the swap entry in fstab:
gt@Colossus:~$ cat /etc/fstab
/dev/hda4 swap swap defaults 0 0
/dev/hda2 / reiserfs defaults 1 1
/dev/hda1 /boot xfs defaults 1 2
/dev/fd0 /mnt/floppy auto noauto,user,exec,rw 0 0
/dev/hdb1 /Stuff ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
/dev/sda4 /mnt/zip250 auto noauto,user,exec 0 0
/dev/hdc /mnt/cdrom auto ro,noauto,user,exec 0 0
/dev/hdd /mnt/cdrom1 auto ro,noauto,user,exec 0 0

What is up ?
Colossus

Swapon

xfade
on
April 27, 2004 - 1:46am

Try swapon /dev/hda4.

BTW No need for posting the same question every 30 mins orso ;)

Did I post the same question

Anonymous
on
April 27, 2004 - 6:56am

Did I post the same question every 30 min ?? What are you referring to ?

If that doesn't work, check t

Craig Ringer (not verified)
on
April 30, 2006 - 10:11am

If that doesn't work, check that the device is actually in the swap on-disk format and has the right partition ID (though the latter doesn't really matter much) with `file -s /dev/hda4' and `fdisk -l /dev/hda' respectively. If the swap signature is not present as reported by `file', make REALLY REALLY REALLY sure you want to destroy anything that might be on /dev/hda4 then run `mkswap /dev/hda4' and `swapon -a'.

Swap

midian
on
April 27, 2004 - 1:52am

I wonder if you have swap compiled in? Please check. And try the swapon thing too.

FYI: Removed the other copies of this topic.
--
Regards,
Markus

root@Colossus:~# swapon /dev/

Anonymous
on
April 27, 2004 - 6:58am

root@Colossus:~# swapon /dev/hda4
swapon: /dev/hda4: Function not implemented
root@Colossus:~#

I forgot to include the swap option ! Could you please tell me where is in the .config file ?? Thanks for replying.

Colossus

Answer

sLiCeR\ (not verified)
on
July 21, 2005 - 3:57am

start "make menuconfig"

go to general options and enable "paging of anonymous memory (swap)"

good luck

Hrm

Azifer (not verified)
on
April 27, 2006 - 5:21am

I'm having the same issue, however I made sure that my kernel had the paging of anonymous memory enabled via grep...

#grep SWAP /usr/src/linux/.config
CONFIG_SWAP=y

But when I try to swapon it still says:

#swapon /dev/hda4
swapon: /dev/hda4: Function not implemented

Don't know what is the issue.

No swap with kernel 2.6.4

Anonymous (not verified)
on
April 28, 2006 - 7:15pm

try
# ls /sbin/swapon

if you have the swapon program it will output something such as

# ls /sbin/swapon
/sbin/swapon

if not:
# ls /sbin/swapon
ls: /sbin/swapon: No such file or directory

Ins't this the best way to shut swap off?

Anonymous* (not verified)
on
April 27, 2006 - 4:36pm

Hey, for all the people that just want to shut swap off, wouldn't it work out better if the kernel was recompiled with swap shut off? Well, does the kernel truly work well with swap not implemented in the kernel? But if so, this would be the way to go swapless. Just buy enough RAM to cover the size swap used to be, and run faster.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.