Author Topic: USB install much slower than LiveUSB with persistence?  (Read 1014 times)

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3801
USB install much slower than LiveUSB with persistence?
« on: June 28, 2011, 12:21:48 AM »
I installed the brand new LXDE iso to a USB thumb drive. I have 1.5 gb left on a 4.0 drive. Previously, I had used PCLinuxOS LiveUSB Installer to install three different test isos and they seemed to run significantly faster than a livecd. But after installing to the flash drive it is very slow. Although, I've been here a long time, this is the first time using a flash drive this way. Also, I 'cat /proc/swaps' shows that my swap on the hard drive is in use.

Galen

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: USB install much slower than LiveUSB with persistence?
« Reply #1 on: July 05, 2011, 09:33:10 AM »
I would suspect that the fact that the installed system performs writes (which are inherently, significantly slower on flash media than reads), which the LiveUSB does not, will significantly impact performance.

I've setup an EeePC 701 to run from a 16GB SD card, and I did many things such as minimize logging (in my case, I disabled swap altogether, because there is no HDD to compensate, as you've done), adjusted mount options to include "noatime", to reduce writing updated access times to files...there are others I can't think of off the top of my head...I'd have to check.

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3801
Re: USB install much slower than LiveUSB with persistence?
« Reply #2 on: July 05, 2011, 11:53:32 AM »
Thanks for the reply. When I get a chance, I'll try it.

Galen

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10696
  • MLUs Forever!
Re: USB install much slower than LiveUSB with persistence?
« Reply #3 on: July 05, 2011, 12:03:26 PM »
Maybe the best would be   relatime   rather than   noatime.

Either way, a full install to flash memory is likely to wear out the flash stick prematurely, which is why it is discouraged by most.

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: USB install much slower than LiveUSB with persistence?
« Reply #4 on: July 05, 2011, 12:14:02 PM »
relatime...hmmm.

Quote
To summarize, relatime is a good compromise between  atime (most expensive) and noatime (least expensive).

From here.

Also in that same article is mention of data-writeback:
Quote
But yeah, “noatime,data=writeback” will quite likely be *quite* noticeable (with different effects for different loads), but almost nobody actually runs that way.


IIRC, that's another option I used, in addition to removing the journal (for ext4)...I can't connect to the EeePC at the moment, so I can't confirm everything I did, yet.

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: USB install much slower than LiveUSB with persistence?
« Reply #5 on: July 05, 2011, 01:02:43 PM »
OK.  I did some checking (feel free to use alternatives as they are presented).

The additional mount options I'm using are:
noatime,nodiratime,data=writeback

I removed the journal from my ext4 filesystem (because I failed to provide the provide options when creating it) with:
tune2fs -O ^has_journal /path/to/device/partition

I put /tmp in RAM by setting "Clean /tmp at each boot" in:
pcc> Boot> Set up boot system> Advanced> select the checkbox beside "Clean /tmp at each boot"

...and I made sure the user's tmp directories were symlinks to /tmp.

These were just things I did to minimize writing to the flash device to improve performance and prolong the longevity of the device (hopefully).

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: USB install much slower than LiveUSB with persistence?
« Reply #6 on: July 05, 2011, 01:13:21 PM »
OK.  I did some checking (feel free to use alternatives as they are presented).

The additional mount options I'm using are:
noatime,nodiratime,data=writeback

I removed the journal from my ext4 filesystem (because I failed to provide the provide options when creating it) with:
tune2fs -O ^has_journal /path/to/device/partition

I put /tmp in RAM by setting "Clean /tmp at each boot" in:
pcc> Boot> Set up boot system> Advanced> select the checkbox beside "Clean /tmp at each boot"

...and I made sure the user's tmp directories were symlinks to /tmp.

These were just things I did to minimize writing to the flash device to improve performance and prolong the longevity of the device (hopefully).

Hi pags,

please, let me add a note:

if you remove journal, you don't need the option data=writeback because that option affect only journal writes.

if you leave there the journal, may be interesting to retain the option data=writeback, and to add the option commit=60, where 60 is the maximum number of seconds between journal commits (default is 5 secs).

data= and commit= options apply to ext3 and ext4 filesystems, not to ext2.

AS

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3801
Re: USB install much slower than LiveUSB with persistence?
« Reply #7 on: July 05, 2011, 01:16:39 PM »
Thank you for all of the feedback. What does this statement mean?

I removed the journal from my ext4 filesystem (because I failed to provide the provide options when creating it) with:
tune2fs -O ^has_journal /path/to/device/partition

Galen

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: USB install much slower than LiveUSB with persistence?
« Reply #8 on: July 05, 2011, 01:31:22 PM »
Thank you for all of the feedback. What does this statement mean?

I removed the journal from my ext4 filesystem (because I failed to provide the provide options when creating it) with:
tune2fs -O ^has_journal /path/to/device/partition

Galen

When running mke2fs, there are options available to disable the creation of the journal.  If you're willing to run an ext4 fs without a journal (potentially an issue if the filesystem needs to be checked, as it would have to check the entire thing, like an ext2 filesystem), you can reduce the number of writes (because there is no journal to write to).  Potentially good for flash device, potentially bad if there is a bad shutdown, etc.

Oh...I see I made a typo (an extra "provide").  Sorry.  It should read:
Quote
because I failed to provide the provide options when creating it
:-[

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3801
Re: USB install much slower than LiveUSB with persistence?
« Reply #9 on: July 05, 2011, 01:36:23 PM »
Got it. Thanks.

Galen