DSL Tips and Tricks :: swapfile on ext2



trying to use up all the old equipment left in the garage i find myself in the position where i have a frugal dsl running on a motherboard with 128mb ram and hda1 is a 1gb ide drive which is fine till i start running lots of things and run out of memory and freeze.  however because the frugal is ext2 and the mkswapfile only works with dos filesystem i find myself having to do it the old way.  this must be a common scenario??

Code Sample

#as root
#to create a 130mb file
dd if=/dev/zero of=/mnt/hda1/knoppix.swp bs=1024 count=132207

#protect it from everyone but root
chmod 600 /mnt/hda1/knoppix.swp

# format the file to be used as swap
mkswap /mnt/hda1/knoppix.swp

# add swap file it to the usable ram
swapon /mnt/hda1/knoppix.swp



use "free" to check it.

dsl should detect it at boot, if not there is a cheat code to scan for it.

happy daze!

Quote
this must be a common scenario??

Not really, except maybe for those who don't read documentation which advises setting up a swap when you designate partitions for DSL:
ftp://ftp.oss.cc.gatech.edu/pub....wto.pdf
http://www.damnsmalllinux.org/f/topic-3-26-8732-0.html
http://damnsmalllinux.org/wiki/index.php/Installing_to_the_Hard_Disk
Etc.

take it or leave it!
Let's take it, it's a good hint if you can't set up a swap partition for some reason.
Like for example, as creating a temporary swap file on a computer you arn't supposed to (or don't want to) repartition (And for whatever reason, there is no accessible dos swap file.
Next Page...
original here.