Ubuntu – Using 12.04 installation as a persistent pen drive

live-usbpersistence

Disclaimer: I aim to build a self contained pen drive with our application inside for running it in as many machines as possible. Portability. So no matter about updates. Maybe I'm looking at the wrong linux distribution to do this… Please let me know if you think so. I've tried many knoppix and ubuntu flavors (and still am trying many others) but they don't come with enough drivers for Unity3D (nothing to do with Ubuntu's Unity) to work – even lubuntu won't work! I'm betting it's lack of openGL 2.0 support.

Creating a custom live persistent pen drive is a real pain and I'm trying for 1 day without any success. Sure, being able to do it would probably be ideal and occupy the minimum space.

Using the installation image on a pen drive, however, is good enough and is really easy to create. We can even do it from any OS, using UNetBootin, LiLi USB Creator or some other methods. Straight forward.

Some recommend installing it on a pen drive. But that requires way too much space! Almost 3gb, I can only use this if it's 1gb at most. And, I believe, it won't behave as good as something meant to be installed on a usb disk, because of memory management and, again, drivers. The MinimalCD installation doesn't even recognize a wireless network / device on the first computer I've tried.

So, there are only a few negative points on using the installation image that I can think of.

Question here, is how to remove those drawbacks (in order of importance):

  • Having to press "Try Ubuntu". That's the big one. Couldn't find how.
  • Unable to remove "Install Ubuntu 12.04 LTS" app (minor importance).
  • Unable to load everything on memory and keep on running without the pen drive (like this).
  • Setting the ISO to use maximum amount of space for the OS will leave pen drive with zero space left and any file saved within it from ubuntu is inaccessible from the outside (when plugging in the pen drive and not booting from it).

The last 2 items are obviously not that important.

Am I missing something? Can those points be fixed?

Best Answer

As far as I know, what you want can't be done with a persistent Live USB.

A full install in an 16GB USB drive (8GB may work, but I have not tested it.) will solve most of the four issues you mention.

I have a 16GB USB with full install and am yet to face any memory management issues. Most computers these days have 4GB or more RAM. So, swap file/partition is not as important. You can do a full install and set swappiness to 0, and limit updates to "Important Security Updates only" to avoid unnecessary writing to the USB.

  1. No "Try Ubuntu" in a full install. Bonus, password protection.
  2. Unplugging the pen drive when Ubuntu is running from it, either in persistent, or in full mode will be a bad idea. I have no solution for this.
  3. A full install will not have the "Install Ubuntu" on the desktop.
  4. If you use a 16GB pen drive, you can create a 1 or 2 GB FAT32 partition in the beginning for "normal" use. The rest can be ext4 partition with / mount point. The first partition will be accessible both when booted from the pen drive as well as when just plugged in.

    It may even be possible to put some folders like "Music" in the FAT32 partition and sym link it to your home folder. I have not tested it. If it works, you have a bigger FAT32 partition and a smaller ext4 / partition.

Minimal install

One option for full install may be to use the server iso or the minimal iso and add the desktop and whatever else you need on top of it. I don't know if it will reduce the size of install to less than 1GB, but it is worth a try. See how to install Unity on top of a server install.

Warning:

There are some WiFi chips that only work with proprietary drivers. A full install USB stick with only opensource drivers will not have WiFi connections when plugged into and booted from such a computer. There may be similar issues with some graphics cards as well. Installing various proprietary drivers into a full USB installation for all possible combinations of hardware may have unexpected results. A full USB install will not be as portable as a Live USB stick.

Hope this helps