swapfile on ext2


Forum: DSL Tips and Tricks
Topic: swapfile on ext2
started by: stunix*com

Posted by stunix*com on Aug. 01 2008,19:04
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!

Posted by lucky13 on Aug. 01 2008,22:39
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.

Posted by stunix*com on Aug. 01 2008,23:15
take it or leave it!
Posted by curaga on Aug. 02 2008,08:36
Let's take it, it's a good hint if you can't set up a swap partition for some reason.
Posted by chaostic on Aug. 02 2008,10:33
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.
Posted by roberts on Aug. 02 2008,13:36
It is already in DSL.

swapfile.lua

A simple GUI to make an ext2 swapfile.

Posted by stunix*com on Aug. 02 2008,20:18
found it.  
thank you Robert, you still give me a daily surprise as to what you have slipped in to 50mb.

Posted by jpeters on Aug. 02 2008,22:04
NIce idea, and it will work on any distro...
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.