View Full Version : swap file question

02-07-2005, 09:58 AM
how do I install a swap file If I installed knoppix on a single hard drive??? I did not make a linux swap drive, and dont have any other partitions, I just have the one that has knoppix is installed on.

the knoppix swap file config. program doesnt seem to support this? any have an idea??

Harry Kuhman
02-07-2005, 10:22 AM
This was moved, as it so obviously belongs in the hdd install forum.

tom p
02-07-2005, 06:31 PM

you can always use a file as swap area; this works as following:
- first open a root shell (from the KNOPPIX menu or otherwise)
- decide where to put the swap file; /var/run/swapfile might be a good place,
but YMMV
- decide how much space the swap file should take (eg 128M)
- create the swap file:
dd if=/dev/zero of=/var/run/swapfile bs=1024k count=128
- create the swap signature:
mkswap /var/run/swapfile
- add the swap file to /etc/fstab as a line containing:
/var/run/swapfile none swap defaults 0 0
- activate the swap file:
swapon -a

If no errors occured, you now should have 128M swap. Check with "top"
or by issueing "cat /proc/swaps"