Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: How2: use USB key as swap for low mem laptop ^

  1. #11
    Join Date
    Jan 2008
    Beans
    7,749

    Re: How2: use USB key as swap for low mem laptop ^

    If it's an old Pentium 2 with 128mb of ram and a 4gb hard drive, well, let's just say you have to be really selective what software you use! I think you made a good choice with Debian Etch. Personally I am currently using SliTaz on my old 500mhz Pentium 3 with 384mb of ram. I have used Ubuntu and Xubuntu on this laptop before, but found them very slow. It's all about having the right tool for the job...

    Believe me, if you could double the performance of your computer using a $10 flash drive, we'd know about it by now.

  2. #12
    Join Date
    Feb 2007
    Location
    In the pub !!!
    Beans
    1,462
    Distro
    Ubuntu Development Release

    Re: How2: use USB key as swap for low mem laptop ^

    is there a utility for testing the speed of a drive - as mem cards / drives differ in performance

  3. #13
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How2: use USB key as swap for low mem laptop ^

    bonnie++ is the benchmarking program I have tried in Ubuntu for testing read/write speeds to file systems in various drives.

    Flash memory is quick to read, but is generally slow to write to.

    The speed and quality of flash memory varies a great deal between models, both within a manufacturer's range of products, and also between manufacturers.

    Some flash memory available today is adversized as 'ReadyBoost' compatible, implying that it is okay to use as a swap area.

    Flash memory is known to have a limited number or rewrites per block, but almost all modern flash memory has 'wear leveling' software which means the operating system writes to a fake hard disk but the real flash memory blocks are shuffled and rotated quietly in the background by the flash memory's controller software so we're really writing to different blocks each time to spread the wear.

    The endurance of flash memory varies a great deal between models and brands, and flash memory has improved a lot in recent times in both speed and endurance.
    You need to find out the manufacturer's specifications and claims, (and warranty), for the exact make and model of flash memory you have or are thinking of buying.

    ReiserFS has the ability to write small files up to fifteen times faster than ext2, and for large files it's the same speed. Depending on the flash memory controller you have, you may not notice much difference if you use ReiserFS, but in some flash meory sticks there is quite a big speed advantage from using ReiserFS.
    Last edited by Herman; October 13th, 2008 at 07:53 PM.
    Ubuntu user since 2004 (Warty Warthog)

  4. #14
    Join Date
    Jan 2008
    Beans
    7,749

    Re: How2: use USB key as swap for low mem laptop ^

    Quote Originally Posted by Herman View Post
    Some flash memory available today is adversized as 'ReadyBoost' compatible, implying that it is okay to use as a swap area.
    Hi Herman, this is an interesting fact, thanks! Will I get a performance boost from a ReadyBoost stick on an old computer with USB 1.0, and do I need any special software?

  5. #15
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How2: use USB key as swap for low mem laptop ^

    Will I get a performance boost from a ReadyBoost stick on an old computer with USB 1.0, and do I need any special software?
    You would not need any specail software to try it, just edit your /etc/fstab in Ubuntu to make it use the swap area in the USB instead of the swap area in the hard drive to try it out.

    I will need to look up the speed for USB 1 and USB 2 to see how much difference there is.
    EDIT: USB 2.0, Hi Speed USB FAQ

    I think that tribaal will be right though, generally you will probably be better off having the swap area in your hard disk, but it will be interesting to explore this question a little more. Flash memory can be very quick to read, so it might actually be better. Who cares if it's slow to write to, I think the read speed would be the most important for swap area.
    I'm not sure, we should some tests and find out.
    Last edited by Herman; October 13th, 2008 at 08:38 PM.
    Ubuntu user since 2004 (Warty Warthog)

  6. #16
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How2: use USB key as swap for low mem laptop ^

    Another (simpler) way to benchmark the performance of your flash memory stick is to use the 'dd' command to make a backup copy of the entire disk.
    Code:
    sudo dd if=/dev/sdb of=/home/herman/usb.backup bs=4096 conv=notrunc,noerror
    Where: '/dev/sdb' is your flash device, (use GParted or 'sudo fdisk -lu' to find out).
    You will see that the dd command will show you the speed the operation was performaed at. That might not necessarily be an indication of the flash memory's speed though, but an indication of the speed of the slowest link in the process. (possibly the USB1 interface, or the speed of your hard disk or something).
    Code:
    974927+1 records in
    974927+1 records out
    3993304576 bytes (4.0 GB) copied, 391.608 s, 10.2 MB/s
    At the same time, you will be making a backup of your USB, so you can erase it in order to use bonnie++, (if you want to).

    To restore your flash memory again after you're finished,
    Code:
    sudo dd if=/home/herman/usb.backupe of=/dev/sdb bs=4096 conv=notrunc,noerror
    I won't have time right now to explain how to use bonnie++, but I'll be back later.
    Ubuntu user since 2004 (Warty Warthog)

  7. #17
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How2: use USB key as swap for low mem laptop ^

    The best way to find out if having the swap area in a USB device is better or worse would probably be simply to try it in a slow old computer, I can't think of any better test for that.
    I have an old computer here to. I'll try it myself sometime soon and see what happens and report back here.
    Ubuntu user since 2004 (Warty Warthog)

  8. #18
    Join Date
    Feb 2007
    Location
    In the pub !!!
    Beans
    1,462
    Distro
    Ubuntu Development Release

    Re: How2: use USB key as swap for low mem laptop ^

    I think it will all come down to the quality and rating of the flash drive, as I say I am on an old, old laptop my flash drive is at least eight years newer, so it is not as though it is up against a modern hard drive.

  9. #19
    Join Date
    Dec 2005
    Location
    Montreal, canada
    Beans
    376
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: How2: use USB key as swap for low mem laptop ^

    But since the tests I did proved that my USB swap was not used at all, how do I successfully set up my xubuntu to use the swap on my USB ?

    No one answered !
    Desktop: I5-2500 on a Z77 MB, 16Gb memory, GTX-570
    Windows-7 (trying to add Ubuntu 12.04 LTS)

  10. #20
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How2: use USB key as swap for low mem laptop ^

    You would not need any special software to try it, just edit your /etc/fstab in Ubuntu to make it use the swap area in the USB instead of the swap area in the hard drive to try it out.
    Yes I did, or I thought I had. maybe I wasn't verbose enough.
    I'm sorry, that was my fault, I was being lazy and assuming you'd already know how to do that. It is quite an interesting question actually.

    You should be able to create a swap area in your USB drive with Gnome Partition Editor.
    If you don't already have Gnome Partition Editor installed, you can install it with, 'sudo apt-get install gparted'
    Code:
    sudo apt-get install gparted
    Here's a link about how to edit your /etc/fstab file, Edit /etc/fstab Method for Mounting.

    So, you run 'sudo blkid' or 'ls /dev/disk/by-uuid/ -alh' to find out what your swap area's UUID number is.
    Code:
    sudo blkid
    Code:
    ls /dev/disk/by-uuid/ -alh
    Either of those two commands should give you a list of partitions with file systems and their UUID numbers.
    Now you copy that output to clipboard, (just hilight and click 'copy').

    Better make a backup of the file for safety's sake before editing,
    Code:
    sudo cp /etc/fstab /etc/fstab.backup
    Next, open your /etc/fstab file with gedit text editor,
    Code:
    sudo gedit /etc/fstab
    For convenience, you can temporarily paste the contents of your clipboard to an un-used area at the bottom of the file.

    Now you edit the file with a new line for your new swap area something like this,
    Code:
    # /dev/sdb5
    UUID=a08d44f6-d681-4901-a7cc-345fc9fa9eb6 none            swap    sw              0       0
    Where: 'a08d44f6-d681-4901-a7cc-345fc9fa9eb6' is the actual UUID number for your particular USB disk's swap area.

    If you see a swap are already registered in your /etc/fstab file for a swap area in your hard disk and you do not want to use it for the time being, just 'comment it out' for now.
    We 'comment out' (make the operating system ignore information in a file or program), by placing a 'comment' mark before the line, in this case it's a 'hash' mark #.
    Like this,
    Code:
    # /dev/sda5
    # UUID=cf4f7390-4243-43b6-abef-30ad6f906b4a none            swap    sw              0       0
    That's how to do it, that should work.

    Whether or not it's a good idea or will improve performance are yet to be explained.

    Regards, Herman
    Last edited by Herman; October 15th, 2008 at 08:33 PM.
    Ubuntu user since 2004 (Warty Warthog)

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •