You must have heard about a feature called “Readyboost” in Windows Vista and Windows 7, which lets you add a flash drive or USB thumb drive as an extra drive for disk cache. By using this feature system performance is significantly increased, as the newly added flash drive increases the virtual memory of your computer.
In a similar way, you can use a USB flash drive to add extra swap space to your Linux OS. Increasing the swap space means increasing the system performance. Christer Edwards has written a shell script, which allows you to add a USB drive as an extra swap space in Linux. You can download the shell script file from here : http://bit.ly/6V87XK
The steps required to use the extra space on the USB drive as swap space are :
- Insert USB disk and allow KDE/Gnome to auto-mount the device.
- Open a Terminal and run
./swapboost.sh -nto create a new swap addition.
- After executing these steps the swap space would have been increased, by the amount of free space on the USB drive. You can check the available swap space for your Linux OS with
swapon -s .
When you no longer want to use the USB drive as an extra swap space, you can do the following:
- In the Terminal, run
./swapboost.sh -dto delete added swap and safely unmount your USB disk.
- Your swap should now have been reduced by the amount of space previously added.
swapon -swill now show only your default swap space.
Note: This script is still in alpha stage, so use it on your own risk.