In order to run programs that consume large amounts of memory (in my case rsync and >300000 files) I needed to add additional swap space on my Unslug system. I didn't like to idea to play around with the partitions on my hard drive so I just added swap space in form of a swap file. To create a swap file in folder /mnt
The previous commands would create a 256MB big swap file.
After the second step your swap space should be increased by 256MB. You can check this by typing
Since you probably do not want to execute the swapon command every time the slug starts up you can create your own startup script. Create a new startup file (e.g. S100addswap) in /opt/etc/init.d with the following content:
You then need to make the script executable.
For Unslung firmware users the prefered method is to create an Unslung Script using a Unix style text editor such as vi and save this script to the /unslung folder with name rc.local, a similar method to that mentioned above.
Then make the script executable.
More permanent swap should probably be in its own partition. Use coreutil's fdisk to set a partitions ID to Linux swap. Then use: