Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It's fairly common knowledge that swap space on a hard drive is much slower than RAM. Has anyone here tried using a USB 2.0 flash drive for their swap space instead of a hard drive partition?
If I've read everything right, it sounds like using a USB memory stick (plugged in permanently) would be faster than a swap partition on a typical 7200 RPM disk.
One thing that occurs to me in thinking about this is that if you compare bus speeds, a SATA hard drive looks a lot faster (1.5-3.0 Gbit/sec vs. 480 Mbit/sec for USB). Neither of those accounts for the read/write speed of the actual media though. I know the read/write rates on an HD platter are a lot slower than SATA bus speeds, but don't know how flash compares.
Would a USB 2.0 flash drive actually have a faster throughput to & from the media? If it works, then it seems like a good idea - especially considering how cheap they've gotten.
There must be something wrong with the idea though, or I'd probably have heard more about it...
USB 2.0 flash drives are typically very slow, maybe a third as fast as an average hard drive for reading; even slower for writing. Neither of them come anywhere close to the interface limits.
Also, flash memory has a limited lifetime in write cycles. This probably means it's not a good idea for a swap partition, but if the swap partition is rarely used then maybe it's okay.
I could only see using a "disposable" sd card on an eeepc. You shouldn't configure an eeepc with a swap partition for the same reason, but configuring an external sd card you don't mind destroying is an alternative. Flash memory is very slow for writing. One advantage they do have over hard drives is you don't have a spinup time if they shut down to save power. Writing two files at once will also cause a performance hit on sd flash drives.
I had a manager stuck with Vista (I know, not Linux related) but they wouldn't pay the option to upgrade his Memory from 1GB installed to 2GB or more. The memory was so awful, he ended up using a 2GB USB Flash for swap, didn't have any issues and it actually sped up his machine. And this was Vista for crying out loud..
Cramming Vista on a machine with 1GB of memory slowed the machine down so much that the flash memory seemed like an improvement.
You really need a 64 bit machine with 4GB of memory if you don't want a performance hit with Vista. Then Vista runs fine.
Cramming Vista on a machine with 1GB of memory slowed the machine down so much that the flash memory seemed like an improvement.
You really need a 64 bit machine with 4GB of memory if you don't want a performance hit with Vista. Then Vista runs fine.
I know, I just figured sharing this info to stand up for the USB flash drive who can't create an account to stand up for himself..
Personally if the OP has a machine with 2GB or more memory installed and it's a desktop, do away with swap if you want or just create on the actual disk, it'll probably rarely get used anyways and if you do need to use it, that's just an indication that you should install more memory in the first place.
Hey everyone, thanks for the info on flash drives. The tips on Vista were good too - especially since the machine I was thinking about using it on was my Winderz box.
Also, flash memory has a limited lifetime in write cycles. This probably means it's not a good idea for a swap partition, but if the swap partition is rarely used then maybe it's okay.
I doubt if there's such thing that doesn't have "limited lifetime" Some flash memory devices indeed seem to die rather quickly, but others tend to live longer - and some manufacturers/resellers give a 10 year guarantee (one guy offered a lifetime guarantee last time I was at a camera shop) for their flash memory cards. That's long; if you used such memory for swap, lifetime wouldn't be a problem because either it lasted at least 10 years (and you probably switched your hardware in the meantime anyway) or it didn't and you got a replacement for the 10-year warranty. But taking into consideration the speed and on the other hand the price of harddisks today there's not much point in buying flash memory for swap. Instead you could easily buy (if you found) a 10GB harddisk for pocket money, or the smallest harddisk you could find and use the extra space for storage -- long-time/not-usually-in-use-storage for example.
I was astounded when I heard Microsoft folks advertise that you can buy a "Vista compatible" (hah, what a term) USB key and "extend" your Vista-machine's memory onto it. They actually made it sound like you could now "get more RAM" literally for coins.
Quote:
Originally Posted by jschiwal
You really need a 64 bit machine with 4GB of memory if you don't want a performance hit with Vista. Then Vista runs fine.
I have a 64-bit machine that runs a 32-bit Vista (they don't sell preinstalled 64-bit Vistas here, and I wouldn't buy one if I wasn't more or less forced with the hardware in question) with 4GB of RAM (but only ~3GB visible on Vista..) and it does run fine - except for the "are you sure you really wanted to personally let this application X do what you just selected" stop messages And an elder friend of mine has a laptop with a lot less horsepower (and 2GB RAM) and it runs Vista smoothly too - though anything heavy on top of it might not do so well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.