VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: readyboost/extra memory with usb stick?  (Read 5495 times)

carsten888

  • Member
  • *
  • Posts: 9
    • joomla extensions
readyboost/extra memory with usb stick?
« on: May 24, 2012, 10:52:16 pm »

I got vectorlinux on an old laptop and want to extend the workingmemory with a spare usb stick.

Is that possible? How to go about that?
Logged

Daniel

  • Packager
  • Vectorian
  • ****
  • Posts: 704
    • TuxToys - Packages for VectorLinux 6.0
Re: readyboost/extra memory with usb stick?
« Reply #1 on: May 25, 2012, 05:43:49 am »

For the following commands, you must be root. Replace "sdXY" with whatever your usb stick is. Something like "sdb1" for the second SCSI device, 1st partition.

Plug in the usb stick, then unmount it with:

umount /dev/sdXY


Format the usb stick as swap with:

mkswap /dev/sdXY


Then activate the swap partition with:

swapon /dev/sdXY
Logged
The following sentence is true. The previous sentence is false.

VL 6.0 SOHO KDE-Classic on 2.3 Ghz Dual-core AMD with 3 Gigs of RAM

carsten888

  • Member
  • *
  • Posts: 9
    • joomla extensions
Re: readyboost/extra memory with usb stick?
« Reply #2 on: May 25, 2012, 09:15:31 am »

Ahum. I'm a PHP programmer just starting out with Linux, so bear with me.

I don't know what SCSI-code was generated for the usb device. So I did dmesg and dmesg | grep –i "usb" but did not see a path like dev/sdXX (like I read here:http://nixcraft.com/centos-rhel-fedora/12211-how-use-usb-pen-drive-linux-os.html#post17484).

When I put a usb stick in, it does not show a new window, so I'm not sure it is seeing the whole usb device at all. I tried several sticks, nothing.

Bye the way, what does 'mount' mean? Is that something you do once to add into the filetree a folder connecting to the usb. Or is this something you got to do each time when I plugin a usb stick?

Logged

carsten888

  • Member
  • *
  • Posts: 9
    • joomla extensions
Re: readyboost/extra memory with usb stick?
« Reply #3 on: May 25, 2012, 10:06:38 am »

after a reboot it saw the usb stick.

I now know vectorlinux got automount. great.

OK. I managed to do the swap-thing. Does this mean I can just leave this usb device in the pc and it will use that for memory each next boot, or do I have to enable this each time I want to use it? (sorry for total newby questions).

Logged

Daniel

  • Packager
  • Vectorian
  • ****
  • Posts: 704
    • TuxToys - Packages for VectorLinux 6.0
Re: readyboost/extra memory with usb stick?
« Reply #4 on: May 25, 2012, 10:45:45 am »

To find the sdXY part, with the usb stick unplugged, run:

ls /dev | grep sd

This will look through /dev for all sd* devices. Then plug the usb stick in, wait a few seconds, run that command again, and compare the output to see what's new (your usb stick).


"mount" opens a storage medium into a folder for viewing/manipulating the content. Unless specified in /etc/fstab, mounts will have to be done manually (unless an automounter is used).

So also, yes, you'll have to swapon the usb stick every time you reboot unless you just leave it plugged in and automate the swapon by adding the appropriate swapon command to /etc/rc.d/rc.local. This will run the command on boot.
Logged
The following sentence is true. The previous sentence is false.

VL 6.0 SOHO KDE-Classic on 2.3 Ghz Dual-core AMD with 3 Gigs of RAM

carsten888

  • Member
  • *
  • Posts: 9
    • joomla extensions
Re: readyboost/extra memory with usb stick?
« Reply #5 on: May 25, 2012, 10:42:50 pm »

thank you very much!  :)
Logged

carsten888

  • Member
  • *
  • Posts: 9
    • joomla extensions
Re: readyboost/extra memory with usb stick?
« Reply #6 on: July 06, 2012, 10:21:45 am »

I set up the permanent swap. (thanks again).

Some days ago  this little laptop started acting real slow.

I did a test with
Quote
# grep MemToTal /proc/meminfo
and Swaptotal
which shows I have
mem 114
swap 1173

the 114 seems a bit low.
how to add the extra mem to the mem 114?
« Last Edit: July 06, 2012, 11:09:05 am by carsten888 »
Logged

Daniel

  • Packager
  • Vectorian
  • ****
  • Posts: 704
    • TuxToys - Packages for VectorLinux 6.0
Re: readyboost/extra memory with usb stick?
« Reply #7 on: July 06, 2012, 10:41:20 am »

Could the usb stick have died? Did you check running processes with htop or something to see if there's a program hogging the cpu/memory?

The swap gets used when the regular (RAM) memory gets low. So short of physically upgrading your RAM, you can't "add the extra mem" (swap?) to the "mem 114" total.
Logged
The following sentence is true. The previous sentence is false.

VL 6.0 SOHO KDE-Classic on 2.3 Ghz Dual-core AMD with 3 Gigs of RAM

carsten888

  • Member
  • *
  • Posts: 9
    • joomla extensions
Re: readyboost/extra memory with usb stick?
« Reply #8 on: July 06, 2012, 11:25:32 am »

thank you for explaining that. Will do some more testing.
Logged

pierce.jason

  • Packager
  • Vectorite
  • ****
  • Posts: 250
Re: readyboost/extra memory with usb stick?
« Reply #9 on: July 09, 2012, 06:48:17 pm »

"readyboost" is a flawed theory. I guess as a last resort it has its merits though.

You would be much better off using part of your hard drive for swap if you can. It will be substantially quicker. The reason ram is preferred over swap is because hard drives are so much slower. A usb memory stick will be even slower than a hard drive.

In addition to the detrimental aspect of speed, using a usb memory stick as swap can be very harsh on the memory stick. Usb memory sticks implement a type of storage that has a limited write life, meaning you can only write to the device XYZ amount of times before it is "dead".

The first thing I would recommend to you, is find out what files on your hard drive you can safely delete to make room for on-drive swap space. If you need to, it would be better to re-locate some of your files to the usb memory stick so that you can use on-drive space for swap.

Secondly, and I realize this might not be an option depending on your situation. Look into budget-friendly upgrades for that laptop. On many older laptops you can do some searching and find people almost giving away ram. Upgrading the hard drive could be a little bit more difficult depending on how old the laptop is. Some older laptops used propitiatory drive forms or carriers that made it difficult to upgrade. That is pretty much standardized recently though.

Third suggestion, is to be mindful of what applications you are using. This is probably the most difficult of the 3 suggestions. In Vector, we get several different choices for most "type" of application. Finding the right application for each "type" for your situation can be time consuming and can take a considerable amount of learning curve. For example you could choose for a file manager Dolphin, Thunar, PCManFM, Rox, MC, or a bash prompt. The file managers I have listed are in approximate order of using the most ram (Dolphin) to using the least ram (bash prompt). You will find similar situations with web browsers, desktop productivity software, and even media players.

I hope this helps give you some ideas Carsten!


P.S. I too come from the PHP/web dev world. I got heavily into linux while trying to optimize my web servers to run PHP apps more smoothly. I don't do much in PHP anymore, but the few PHP things I have or develop on run on a server that has 52MB of userspace ram. Playing in resource-minimization and optimization is a great way to learn more about linux!
Logged
pierce.jason
Email: $(echo -e "moc\x2eliamg\x40nosaj.ecreip" | rev)