Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
does anyone know why the write speed of usb flash would be so slow? I'm running ubuntu off my flash drive but it is running really slow. I've tested the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User hatebreed's Avatar
    Join Date
    May 2010
    Posts
    335

    running ubuntu from usb flash is slow


    does anyone know why the write speed of usb flash would be so slow? I'm running ubuntu off my flash drive but it is running really slow. I've tested the read speed which was about 33 meg a sec. but the write speed is only about 7 meg a sec. when running ubuntu it is very slow, not tolerable at all. I've read on some sites that there is a way to fix this but i'm not finding any good tutorials on making the write speed quicker. any thoughts?

  2. #2
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    hi,
    what file system is been used in usb flash?

    Regards

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,158
    The speed of a flash drive has a lot to do with what chips were used and how the controller is configured. I've been reading specs on available USB flash drives, and what you are seeing isn't unexpected. In fact, your read speed is considerably above average, and your write speed is pretty normal. In any case, using a USB flash drive (I assume you meant a thumb drive and not a solid-state disc in normal disc form factors) to run Linux should be done only in emergencies or for forensic and system recovery purposes. That's what I use them for.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Linux User hatebreed's Avatar
    Join Date
    May 2010
    Posts
    335
    i'm using ext4 right now but i've read about some sort of issue with doing so, something about alignment issues. is there a way to correct this so I don't have to use fat 32 or something like that?

  5. #5
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    I wouldn't use a journaling filesystem on flash, considering flash has limited number of writes.

  6. #6
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    Hello,
    I'm agree with Segfault.
    You should use fat or ext2.

    Regards

  7. #7
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    FAT is not a good option because it does not support POSIX permissions. EXT2 will do, there are new filesystems like LogFS and NILFS developed for SSD, maybe they are good for flash, too.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,158
    Agreed. When I run Linux natively on a flash drive, or use a flash drive for Linux-only storage, I use ext2. It is recoverable, reasonably efficient, and FAR more reliable than a FAT file system.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Linux User hatebreed's Avatar
    Join Date
    May 2010
    Posts
    335
    any issues with the write speed like i'm seeing with ext4? it is writing at about 7 meg a sec but it also pauses for about 20 secs at a time while writing, so it's not actually 7 meg probably more like 3 or 4.

  10. #10
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,158
    On flash devices you absolutely do NOT want to run a journaling file system such as ext3, ext4, reiser, etc. These devices have some "funny" features to help increase their perceived speed to normal users. Many have some amount of faster cells, and more slower ones (from the data write perspective) in order to keep cost down yet for limited use (write once mostly) will appear fine to your average consumer. Their wear balancing code/circuitry will minimize rewrites to the same cells (remap them automatically) in order to increase lifespan of the device. For applications that have a lot of rewrites, then you need a more expensive device, such as a class 10 for SD cards vs. consumer class 2 (most common) or 4. Running a Linux OS directly on a thumb drive really needs a high performance (costly) device. Even so, if you use a journaling file system and also don't set the device to be mounted async, then two things happen. One is that those journals keep getting remapped (time consuming), another is that each sector is being writting thru to the drive as it is modified (more remapping and writing), and finally the device wear rate is increased as multiple writes to the same sector (common) will not be cached to be written only once as needed.

    So, do this to maximize your thumb drive speed:

    1. Get the fastest drive you can afford (so-called 150x or better).
    2. Change to a non-journaled file system. Ext2 is good.
    3. Edit /etc/fstab to enable async I/O.
    4. Disable swapping - don't make a swap partition or file.

    When you do this, make sure that you sync the drives before you shut down the system. Yes, it should be done automatically, but as the saying goes, better safe than sorry. Linux does a lot of disc caching and with the async flag on if you haven't sync'd the drive before removing it you will lose data and get a corrupted file system. The umount command should also sync the file system, but I have seen that it does not under all circumstances. BTW, Linux normally mounts thumb drives with the sync option in order to minimize damage if the drive is removed before unmounting it. This can be changed by remounting the device manually.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Page 1 of 2 1 2 LastLast

Posting Permissions

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