Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 60223  / 2 Years ago, sat, september 10, 2022, 4:47:13

In windows it is possible to use usb flash drive as a virtual ram. I wonder if it is possible to do so in ubuntu? If it is, how could one do it?



[Edit]: I mean Ready boost equivallent for ubuntu. I know that it is not a perfect replacement for ram and it is not advisable for longterm use.



Is creating swap file in a usb flash drive similar to it? Will it demonstrate performance gains over a swap file in a Hard Disk Drive?


More From » usb

 Answers
0

The answer Sean suggests is one way of accomplishing this, another would be to just create a swapfile on the stick, that way you can also use your stick for other files. Like so:




  • find out where the stick is mounted. Look in nautilus or issue mount in the terminal


  • create an empty file of dd if=/dev/zero of=/media/YOURSTICK/swap bs=4096 count=131072. This creates a 512 MB file (512 * 1024^2 / 4096 = 131072)


  • create the swap and enable it sudo mkswap /media/YOURSTICK/swap && swapon -p 1000 /media/YOURSTICK/swap




The swap on your USB stick won't be faster than one residing on your HDD. Also it will kill the stick on the long term, writing does that to USB sticks.



To increase the usable amount of ram check out zram.


[#39694] Monday, September 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cocal

Total Points: 236
Total Questions: 111
Total Answers: 123

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
cocal questions
Tue, Oct 12, 21, 20:46, 3 Years ago
Sat, Oct 8, 22, 04:23, 2 Years ago
Wed, Sep 14, 22, 22:38, 2 Years ago
Sun, Dec 18, 22, 02:24, 1 Year ago
Wed, Jun 29, 22, 17:31, 2 Years ago
;