Manually Adding Swap on an N800

January 11, 2008 – 12:21 am

Although you can add swap through Settings->Control Panel->Memory, I wanted to add a swap file manually. There are a couple of reasons you might want to do this. Perhaps you want more than the maximum of 128Mb offered through the Control Panel or it may be the fact that when you add swap through the Control Panel, it gets placed on your memory card. Hence when you attach your device to a PC, the mmc is umounted so you lose the swap – you can get round this if you’ve created a Linux partition on your card as I described previously.

First create an empty file of the size you want, eg 128Mb, in the location you want using dd:
dd if=/dev/zero of=/extfs/.swap bs=1024 count=131072

Now format the file as swap:

mkswap /extfs/.swap

Now add the swap:

swapon /extfs/.swap

To make your new swapfile persistent across boots, add the following entry as a new line in your /etc/fstab:

/extfs/.swap    none    swap    sw    0    0

Finally add the following line to /etc/init.d/rcS towards the end (but before the exit 0 line):

swapon -a
  1. One Response to “Manually Adding Swap on an N800”

  2. omg.. good work, bro

    By Stacycn on Mar 23, 2008

Post a Comment