Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

1) What specifically internally makes my "liveCD with persistence" install on my USB stick run faster than my full install on my USB stick?

2) What would I have to change in my full install system to make it a "liveCD with persistence" system?

share|improve this question
    
live CDs are faster? –  RolandiXor Apr 6 '11 at 17:52
    
I had a liveCD with persistence on my USB stick and everything ran amazing fast. Because I made it with Fat32 I could only get it 4gigs big and I soon ran out of space. So I put a full install on it and now I get windows freezing often and I notice a serious difference in functionality. –  Joshua Robison Apr 6 '11 at 18:04
    
@JoshuaRobison: flash memory is always faster than a hard drive. –  RolandiXor Apr 6 '11 at 18:09
    
but my full install is on my flash usb memory stick. I did both installs on the same stick. The result is that the full install of ubuntu is significantly slower than the live cd version. –  Joshua Robison Apr 6 '11 at 18:23
    
@JoshuaRobison: because flash driver are not meant to be read and written in the manner that a full install would require. A live CD is modified in a way that allows it to run from the flash storage without that problem. –  RolandiXor Apr 6 '11 at 18:29

2 Answers 2

up vote 3 down vote accepted

When you run linux off a usb dirve, your overall overall speed is often limited not by your cpu, but by your disks I/O. How quickly the data can transfer on and off your USB. Becos the data transfer rate over a USB 2.0 is limited, you see. So, in that context, a liveCD version has several advantages over a full install on a USB.

Firstly, a liveCD stores its data in compressed loop files, typically using squashfs. And becos the data is compressed, it can be transferred off the USB more quickly. Whereas with a full install, the data is uncompressed.

Secondly, benchmarks for data transfer off a USB show that large files transfer much faster than a lot of small files. With the LiveCD format, the data is stored in one or more large cloop files, which is ideal. But with the full install version, there are many smaller files. And that can result in a slower data transfer rate.

Thirdly, a liveCD linux uses a union filesystem like AUFS. It is a virtual file system, sometimes known as a stackable filesystem. It is designed such that write cycles to the USB are minimized, certainly much less that for the full install version on a USB. This helps becos a) data writes to a USB take x2 longer than reads, and b) excessive writing to your usb will wear it out sooner.

share|improve this answer
    
I wish there was a way to get some of those cloop/squashfs/aufs etc working on my full install on my usb stick. The performance jump was amazing before I did the full install on the stick. Which makes me wonder why they don't make the full install just automatically take advantage of all those performance boosts. Since a liveCD install on an internal HD would perform way better than a full install on an internal HD anyway. –  Joshua Robison Apr 22 '11 at 5:43

As Roland said, the speed improvement you got is likely to be the difference between a disk (relatively high latency, seek times etc) and solid state memory.

Installing a LiveCD version on your internal drive will work, but should not be thought of as a speed improvement. It may be slightly slower, as there are some workarounds involved with using a read-only filesystem.

Actually, some bits may work faster as they will be running from a ramdisk.

Possible solutions:

  • Bigger USB stick with a LiveCD, so you can fit the whole thing on

  • Solid state drives in your machine - will be considerably faster than hard drives

UPDATE:

Subsequent to your updates, your question makes more sense now. It looks like what you mean is you want to take the existing install you have on your hard drive and convert it to a LiveCD for your USB stick. If that is the case, go to this Ubuntuforums post which describes the process. The differences are (from the Ubuntuforums post):

  1. The CD or DVD is read only media. Linux needs to have write access to certain parts of the system to be able to operate properly (like "/dev" "/proc" "/var" "/tmp"). There are a lot of approaches to address this problem. All of which utilize the system RAM.

  2. With the harddrive installation the location of the root filesystem is fixed. So it is passed to the kernel at boot time using the root=/dev/... parameter. With a live CD/DVD, the location of the root device is not fixed as the user might have multiple cdrom drives, these drives can be ide, scsi ... etc.

  3. To fit on a CD, the filesystem is usually compressed using squashfs. So we need to autodetect the filesystem type. We also need to have the proper modules for mounting it.

share|improve this answer
    
Thanks rory. But I think I mentioned that I put a full install on my usb stick. So the problem is not related to internal drive in my case. I want to keep my full install while applying the livecd read-only optimized tweaks to my usb full install. –  Joshua Robison Apr 7 '11 at 6:05
    
@Joshua - I have updated my answer. You don't tweak the full install you currently have on your USB stick...you can create one from your hard drive install for use on a USB stick. –  Rory Alsop Apr 7 '11 at 7:46
    
thanks for all your help. I appreciate it. –  Joshua Robison Apr 7 '11 at 12:40
    
@JoshuaRobison: I'll do my usual job and be candid :) - it can't work like you are hoping for it to, unfortunately :P –  RolandiXor Apr 7 '11 at 18:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.