Adding memory swap space to the N800



Adding swap space is pretty easy. This will add more, but slower ram; helping you when dealing with large files. In general, linux likes to have twice the amount of swap space as RAM. Since the N800 has 128M memory, I’m adding 256M. We’ll see how this perform in the long run.

Before, no swap in use:

1
2
3
4
5
Nokia-N800-51-3:~# free
              total         used         free       shared      buffers
  Mem:       126828        87248        39580            0         1012
 Swap:            0            0            0
Total:       126828        87248        39580

Performing commands to add swap file and use it on reboots:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Nokia-N800-51-3:~# cd /media/mmc2/
Nokia-N800-51-3:/media/mmc2# dd if=/dev/zero of=./.swap bs=1024 count=262144
262144+0 records in
262144+0 records out
Nokia-N800-51-3:/media/mmc2# mkswap /media/mmc2/.swap
Setting up swapspace version 1, size = 268431361 bytes
Nokia-N800-51-3:/media/mmc2# swapon /media/mmc2/.swap
Nokia-N800-51-3:/media/mmc2# echo "/media/mmc2/.swap    none    swap    sw    0    0" >> /etc/fstab
Nokia-N800-51-3:/media/mmc2# cat /etc/fstab
rootfs  /               rootfs  defaults,errors=remount-ro,noatime      0 0
/dev/mmcblk0p1  /media/mmc1 vfat rw,noauto,nodev,noexec,nosuid,utf8,uid=29999 0 0
/media/mmc2/.swap    none    swap    sw    0    0
Nokia-N800-51-3:/media/mmc2# vi /etc/init.d/rcS

-- add this line before exit 0:   swapon -a

Nokia-N800-51-3:/media/mmc2# reboot

Broadcast message from root (pts/0) (Sat Mar  8 17:20:49 2008):

The system is going down for reboot NOW!

Swap file is now in use:

1
2
3
4
5
Nokia-N800-51-3:~# free
              total         used         free       shared      buffers
  Mem:       126828        98020        28808            0         1044
 Swap:       262136            0       262136
Total:       388964        98020       290944

Also, you can add up to 128k by going into Settings->Memory. But that is a little too easy isn’t it?

  • Pingback: Dave Drager()

  • none

    Thanks for that, got me set up with swap space on my N800.

    However you could explain what the commands actually do for noobs who don’t quite understand the intricacies of Linux.

  • none

    Thanks for that, got me set up with swap space on my N800.

    However you could explain what the commands actually do for noobs who don’t quite understand the intricacies of Linux.