Ubuntu ReadyBoost for Desktops and Laptops!

With these simple directions you'll be able to use a USB pen prive as an additional swap. As a result, the pen drive will be used in the same way Windows Vista does through the ReadyBoost functionality.

1) Plug the pen drive in your usb slot, usually in front of your tower or side/back of your laptop.
2) Ubuntu should auto-mount the device (usually in /media/usbdisk*), umount the device (ie., sudo umount /media/usbdisk);
3) Find your usb device in your terminal by typing sudo df -h; in this example we will use /dev/sda1
4) sudo mkswap /dev/sda1 (assuming /dev/sda1 is the correct device for the connected usb device)
5) sudo swapon -p 32767 /dev/sda1

Ok now you are using the usb device for swap; when your ram is exhausted it will start using your usb device for ram

To verify that everything is working correctly do a;
cat /proc/swaps
This is the output I recieve on my Desktop;
/dev/sda5 partition 1646620 33952 -1

Just a note:
You will not recieve the same performance as ram, it all depends on the speed of your usb disk, you will notice a big difference in running games, development studio's, audio/video editing and memory hogs like firefox/openoffice.

To turn ReadyBoost for Ubuntu off in a terminal type:
sudo swapoff /dev/sda1

Comments (5)

Loading... Logging you in...
  • Logged in as
This is exactly what ReadyBoost does. The reason it gives you added performance is because flash storage is faster for random reads than regular storage. If your RAM is exhausted you will get better performance from USB 2.0 swap space than regular harddrive swap.
I'm wondering why it took my experience from running Vista to figure out that this was possible. For sure I was aware of the swap partition, and how that functions as some sort of additional memory (for Windows users: the pagefile.sys). But to have to search for the word "ReadyBoost" to figure out how to enable a USB device as "extended ram". Ow well, probably just as stupid as posting a comment about how stupid I feel. I'd better say something smart.

The fact that a fast USB device is faster as swap than a HD partition isn't just because it's faster media. For long, it's been adviced not to use your primary HD for the SWAP partition to not give that disk more to do that needed at the same time. Similar to what Photoshop keeps nagging about for the scrap disks. Added to this, using the USB swap space regularly could actually make your harddisk last longer. It just has less to do.
ReadyBoost is not swap space. It's a disk cache. Big difference.
I've been using this and it's working out quite well. Is there any way I can automate it at startup so I don't have to do it at every boot?
HELP! it work nice until i use the swapoff command and now i cant use the device for storage. i get this error: "mount: /dev/sdb1: can't read superblock ."
can someone help? please.

Post a new comment

Comments by

Clicky Web Analytics