Swap
Jump to navigation
Jump to search
see the Support FAQ for more on setting up an SD card or other device as swap.
Swap on SD is currently is broken. The XO currently force-unmounts the SD card at suspend, which loses the swap file and breaks all applications that touched the swap, most notoriously X11.
Swap on the internal memory doesn't work either, it causes system freezes. Swap doesn't even like attaching to a jffs2 file, but can be forced by using a loopback device. The internal flash chip is only rated for 3000 writes/cell (Remember when flash could take 100,000 writes? Now we're giving that up for density). JFFS2 will try to spread that across the whole chip, even then swap write patterns are likely bad for it. Try the following at your own risk.
su dd if=/dev/zero of=/var/swap count=128000 /sbin/mkswap /var/swap
#!/bin/sh if [ `cat /proc/swaps | wc -l` == 1 ] ;then loopdev=`su -c "/sbin/losetup -f"` su -c "/sbin/losetup $loopdev /var/swap" su -c "/sbin/swapon $loopdev" fi