Re: Using USB flash as swap space.



Andrew Farris wrote:
On Mon, 2009-08-03 at 12:02 -0700, Ray Parrish wrote:

Hello,

I recently read an article that states that using a USB flash drive as
swap space can help speed up a low memory system since the flash drive
is faster than a hard drive.

Could someone walk me through the list of commands needed to mount a
flash drive, and specify it as a swap space in Hardy?



1. Install gparted (sudo apt-get install gparted). It will make
partitioning easier

2. Plug the flash drive in (probably someplace out of the way, since
it's going to become a permanent feature...and make sure its a USB 2.0
port, to get the full potential out of it)

3. Fire up gparted, select your flash drive from the dropdown in the top
right corner, right-click on the partition(s) listed in the bottom box,
and delete them all

4. right-click the newly empty space and say "Format To > linux-swap"

5. ...?

6. Profit! Or...swap-space...whatever.


I would also like to know how to get it set up in fstab so it will
always work.



Next, you need to find out the UUID of your new device... find out by
right-clicking on your new flash-drive swap partition(in gparted), go to
"Information", and copy the UUID listed there.

In order to get it to auto-work on boot, add the following line to
your /etc/fstab:

UUID= none swap sw 0 0

where you paste the UUID you got earlier after the "=" in that line.
Then save, and next time you reboot with the flash drive in, it should
use it as swap. To use the new swap space immediately use:
swapon /dev/<your device ID> i.e. swapon /dev/sdg1 (if your flash
drive was sdg1)

this page may be also be of some interest for further reading:
https://help.ubuntu.com/community/SwapFaq

best of luck!

Thank you very much for the instructions and the fine level of detail. I
will give it a try when ever I get my hands on one of those flash drives.

Later, Ray Parrish

--
The Furure of Technology
http://www.rayslinks.com/The%20Future%20of%20Technology.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things including my poetry.
http://www.writingsoftheschizophrenic.com



--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: Using USB flash as swap space.
    ... swap space can help speed up a low memory system since the flash drive ... I have searched my browser history, ... Flash drives have no latency. ...
    (Ubuntu)
  • Re: Using USB flash as swap space.
    ... swap space can help speed up a low memory system since the flash drive ... I have searched my browser history, ... looked up information on the flash drives afterwards on mine, ... Writings of "The" Schizophrenic, what it's like to be a schizo, and other ...
    (Ubuntu)