Add Extra Swap Space To Your Linux Box with a USB drive [Linux Hacks]
By on December 21st, 2009

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 :

  1. Insert USB disk and allow KDE/Gnome to auto-mount the device.
  2. Open a Terminal and run ./swapboost.sh -n to create a new swap addition.
  3. 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:

  1. In the Terminal, run ./swapboost.sh -d to delete added swap and safely unmount your USB disk.
  2. Your swap should now have been reduced by the amount of space previously added. swapon -s will now show only your default swap space.

Note: This script is still in alpha stage, so use it on your own risk.

Tags: ,
Author: Anurag Upadhaya

Anurag Upadhaya has written and can be contacted at anurag@techie-buzz.com.

Leave a Reply

Name (required)

Website (optional)

 
    Warning: call_user_func() expects parameter 1 to be a valid callback, function 'advanced_comment' not found or invalid function name in /home/keith/techie-buzz.com/htdocs/wp-includes/comment-template.php on line 1694
 
Copyright 2006-2012 Techie Buzz. All Rights Reserved. Our content may not be reproduced on other websites. Content Delivery by MaxCDN