From LedHed's Wiki
Jump to: navigation, search

Disable Swap

See: Linux General: Disable/Enable Swap

Doing the above will only turn off Swap until you reboot. To make this permanent do the following:

NOTE: Make a back up of all files before changing them!!!

1) Disable the swap partition in /etc/fstab

cp /etc/fstab /etc/fstab.bak
#/dev/harddisk2      swap   swap   defaults 0 0

2) Disable the 'swapon' command in /etc/rc.d/rc.sysinit

cp /etc/rc.d/rc.sysinit /etc/rc.d/rc.sysinit.bak
# echo “Turning on swap”
# /sbin/swapon –a

After doing this the 'Advances Status Page' will be broken, to fix it do this:

cp /home/httpd/cgi-bin/advstatus.cgi /home/httpd/cgi-bin/advstatus.cgi.bak

Replace this line:

{$mperc = int((($mused/$mtotal)*100));}

With these lines:

if ($mtotal > 0 )
    {$mperc = int((($mused/$mtotal)*100));}
else
    {$mperc = 0;}

Reference: http://community.smoothwall.org/forum/viewtopic.php?t=16604&postdays=0&postorder=asc&highlight=swapoff&start=0