After searching here, I found no direct answer to:
Is it practical to put swap on a USB Flash drive? I do not yet know if the teeny-tiny flash drive (Fit CZ33 ) I wish to use runs at high-speed (480 Mbps), full-speed (12 Mbps), or low-speed (1.5 Mbps), but am checking w/ SanDisk.
My intent is to reduce writes on the SSD for drive longevity; if the external flashdrive fails, I throw it away and get another.
Why? Because I just changed my ThinkPad R60 9459AT8 over to a Samsung SSD after maxing out the RAM at 3GB, set up trim after repartitioning with 20% free, removed swap, set swappiness to 0 and otherwise tuned up Xubuntu 13.10 for SSD. However, since it's not practical for me to add a mechanical HDD, I'd like to move the swap over to a Flashdrive which will always stay in the left side USB2 socket, for I'dather wear out a $12 flashdrive instead of a $180 SSD.
Why? Sometimes, I lose my WiFi connection until I reboot, plus rarely see slowdown, and I'd like to see if having swap again would help. I do watch a system monitor always in a panel and never exceed 30% free memory use, but would like to have swap without putting in on the SSD.
Yea, or nay?
And, does the size of the flashdrive make any difference: 8GB, 16GB or 32GB?
Flash drives are slower. My SSD is older and half the speed of newer systems and my system is all SATA2 and USB2.
Or my flash drive is only 10% as fast for reading as my slow SSD. And writes are notoriously slow on flash drives.
You can set swappiness to use RAM first.
Add this:
https://help.ubuntu.com/community/SwapFaq#What_is_swappiness_and_how_do_I_change_it.3F
There is the swapspace or dynamic swap manager. Looks like not maintained, but still in repository of 12.04.
http://pqxx.org/development/swapspace/
Smaller USB drive seek times are much faster as compared to an HDD, if you had one. The downside is that regular and sequential read/writes to the USB drive decrease the life of the drive itself. It is not as good as having proper RAM but at least it is far better than having Swap on the HDD.
To do so, delete all files uon the USB flash drive, so plug it in and unmount it by-
to watch the disk label as we have used here sdb1 (yours might be different). Yse the following and make sure which one is your USB flash drive with the consideration of size, and sdb1 is just used here for exampling and explaining -
Now create swap on your USB flash drive by-
turn it on with
to check it works
which will show both your swap on your booting drive and the USB Flash Drive as well.