If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about.

I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install.

To do this, I need to install the nVidia drivers first (sigh).

To do this, I need changes to persist a reboot.

To do this, I need to really install Ubuntu on a USB key.

How do you do that?


What I tried

  1. I tried to make a USB key from Testdrive, then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself.

  2. I tried, from my installed copy of Ubuntu:

    sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso
    

    ...but the installer didn't detect the disk properly.

share|improve this question
    
Have you tried burning a LiveCD and installing Ubuntu onto the USB from that? That seems to me like the easiest solution. – Frxstrem Dec 11 '10 at 19:22
1  
@Frxstrem I'm trying to do that via KVM without having to burn a nightly image on a CD. It sounds like a waste... – badp Dec 11 '10 at 19:28
1  
Just wondering if it is possible to partition the USB key in to two partitions then use test drive then install on to the other partition just a suggestion. – Allan Dec 11 '10 at 20:00
    
I've been looking into this, here's more info: ubuntuforums.org/showthread.php?t=1636650 and wiki.ubuntu.com/Unity/InstallUSBKey – Jorge Castro Dec 11 '10 at 21:18
    
You may be interested in checking and adding your notes to superuser.com/q/681/263 – nik Dec 18 '10 at 17:59

17 Answers 17

up vote 112 down vote accepted

Ubuntu/Linux solution

1. Obtain latest image

You should do this with testdrive Install testdrive.

TestDrive

Note. If your key is smaller than 4.4 GB (for Ubuntu 11.04), you must get the alternate installer. The Desktop installer refuses to continue if there is less than 4.4 GB of free disk space.

2. Format the USB disk.

This is important if you already have anything looking like a Linux install on your disk, or the installer will not want to touch that disk, for some reason. I failed earlier because I didn't perform this step, so skip at your own risk! You need a key that is at least 3GB in size.

You can do so from System → Administration → Disk Utility. Choose the destination USB key, unmount all partitions and select Format Drive.

Disk Utility

You need to make sure you select "Don't Partition" before it lets you format the disk.

Format drive window.

3. Start a virtual machine on the USB key

I made sure (with file) that my USB key was in /dev/sdb, then ran:

sudo qemu-system-x86_64 /dev/sdb -cdrom ~/.cache/testdrive/iso/ubuntu_natty-desktop-i386.iso

...to install the i386 ISO of Natty desktop -- the file name will vary if you download a different ISO.

Details for your virtualization solution of choice will vary, but you want to use the device file of your USB key as the VM's hard drive.

Append -boot order=dto the kvm command to make it boot from the image in case it tries to boot from the 'hard disk' and fails because it cannot find an operating system there.

4. Install normally.

At this point you are working on a virtual machine that sees your USB key as the only connected hard drive. From inside the "QEMU" window, install as you would normally do.

A few notes:

  • Partitioning. Avoid using the automatic partitioning system, as it will create a swap partition on your USB key. That's no good, as swapping becomes super slow (seconds-long system freezes slow) and quickly kills your drive's life. Simply allocate a single partition for /. If you're using the alternate installer, make sure you set the noatime flag to further reduce the amount of writes to the disk.

  • Updates. Skip the option to automatically download and install updates. It is not guaranteed that the repositories will be in a consistent state by the time you run the installer. Personally, I'd rather manage the upgrades manually with a tool such as aptitude (which does no longer ship with Ubuntu by default).

  • Alpha-quality software. Things are a little wonky -- it is alpha quality software, after all. I had dpkg exiting with error code 1 without being able to review the error - no packages were broken as a result, however. I tried to shutdown the virtual machine cleanly after the setup, but it hung. On a reboot, however, the system booted fine.

5. Reboot and boot into your copy of Ubuntu

You may need to fiddle with your BIOS settings to make this work.


A nice (or annoying, based on your use case) thing about Ubuntu on a USB is that next time it'll refresh GRUB, it'll also detect and add to the list the kernels and operative systems on the HDD. This should let you boot straight into your HDD from your USB key's GRUB.

share|improve this answer
10  
Wow. Thanks for the very detailed list of instructions for doing this. – Nathan Osman Dec 12 '10 at 0:03
1  
Awesome, thanks for the explanation. To add, I find that adding some RAM to kvm with -m 2GB helps speed up the boot process. – hasen Jan 18 '11 at 12:06
1  
@BryanHead When memory runs out, the oom-killer (if enabled) will pick the "worst offender" and kill it. The alternative is a kernel panic (which afaik is the only last resort measure under Windows.) – badp Nov 12 '12 at 17:42
4  
This is a very detailed answer, but unfortunately it does not work with Ubuntu 14.04. For some reason qemu fails and the installation process aborts. – Luís de Sousa Aug 28 '14 at 19:15
1  
If I install it to a flash drive or USB hard drive, the answer says it will also install GRUB. If I disconnect the flash drive where I installed Ubuntu, will I have issues booting into Windows? – strider Dec 11 '16 at 21:21

Installing Ubuntu to a removable USB drive with Virtual Box

In order to install Ubuntu to a portable external USB drive (either disk or stick) we may also use Virtual Box to install from a virtual environment. For USB 2.0 support the closed source but free PUEL-version of Virtual Box is needed.

Create a virtual machine for the installation live environment:

We create a virtual machine for a Linux/Ubuntu environment (32- or 64-bit, depending on the installation medium):

enter image description here

As we want to install to an USB drive we do not create a virtual harddisk (VDI) for this machine by unticking the box in the following window:

enter image description here

We then need to assign system memory (e.g. 1024 MB), graphics memory (e.g. 128MB), and adjust CPU settings according to our host hardware. Also we may want to create a bridged network in order to be able to download files during the installation.

Mount the installation CD to the virtual machine:

In the Storage menu from Virtual Box Manager we select the .iso image of our installation CD to mount as CD drive. Make sure the boot order of the virtual machine is set to boot from CD.

enter image description here

Mount the USB drive to the installation environment

After we started the virtual machine (USB support needs to have been set up first) to boot the installation CD we need to mount the USB drive either by clicking on the small icon in the bottom panel or by choosing from Devices -> USB Devices menu of Virtual Box Manager.

enter image description here This is when the USB drive needs to have been mounted before we proceed

Partition and format the USB drive

After having chosen Something else the graphical partition manager GParted will guide us through the partitioning process:

enter image description here

We need at least a partition with a mount point root (/). In the example above an additional /home partition was created. By unticking Format we keep the data that may already be there. A /swap partition may not be needed for an USB-stick or a portable drive.

  • At this point take extra care that the boot loader Grub indeed will be installed to the USB drive (/sda) and not to anywhere else

By selecting Install Now we start the installation to our USB drive. Consider that this installation may take a bit longer than we are used to.

After the installation has finished we may unmount our drive eith the brand new operating system and boot from any other machine to customized it to our needs.

  • Do not forget to enable booting from USB in this computer's BIOS.
share|improve this answer
    
Do this apply to Mac's? – Braiam Jan 10 '14 at 2:39
    
I "successfully" created a bootable USB following this guide, but at boot I get the following message error: file '/boot/grub/i386-pc/normal.mod' not found. And then I get the grub rescue prompt. Any ideas on what might have gone wrong? – Luís de Sousa Aug 29 '14 at 13:21
    
@LuísdeSousa: Somehow Grub can't find it's files. It may have accidentally installed in EFI mode, or your USB drive get's another drive association on boot. See this answer for some insights. – Takkat Aug 29 '14 at 13:31
1  
On a second try things went well, I guess the installer is itself prone to mess ups. In any case, this is possibly the easiest process to create a boot-able and persistent Ubuntu USB. And also possibly the safest, since at install time no HDD are available, only the mounted USB drive. – Luís de Sousa Aug 29 '14 at 17:19
    
Although you are well, I think i should add for others that you need to also be careful to install grub on the root of the usb. In this example it is sda\ it will want to install on the hard drive mblk0. This was explained and you will move it to the usb drive...but do not choose sda1\ which may be tempting. As the instructions say "sda\ and not anywhere else" – Bhikkhu Subhuti Mar 7 '16 at 14:12

If you are talking about an actual install, as in a full Ubuntu install rather than just a Live USB type then what you can do is use an external hard drive that plugs in via USB and install to that via the following method.

Please Note: The following steps were tested using Ubuntu Version 9.10, but has not been tested with the later versions. Use at your own risk & discretion.

What You Will Need

  1. A Computer with Internet access.
  2. A LiveCD or LiveUSB with Ubuntu.
  3. An external Hard Drive with USB capability.

What To Do

  1. Open up your computer and remove the Hard Drive.
  2. Plug in your external USB Hard Drive via the USB cable.
  3. Stick in your LiveUSB or LiveCD and then boot up your PC.
  4. Open up the boot menu, and choose to boot from the LiveCD/LiveUSB.
  5. During the installation process you should your external hard drive listed, install Ubuntu to that.
  6. Finish the installation process, turn off your PC, and put your other hard drive back into your computer.
  7. Reboot your computer, go to the boot menu and select your external hard drive and attempt to boot from it. If it does congratulations, you now have an external hard drive with a full fledged Operating System on it.
  8. Enjoy your external hard drive running Ubuntu/Linux! Please do let me know if this helps you! If not let me know about that too. :)

But if you're just wanting a Live USB then you can use the Universal USB Installer for that or the Ubuntu USB Startup Disk Creator...

share|improve this answer

I did it using the following method :

  • insert liveCd and plug USB key.

  • select install ubuntu.

  • chose advanced when selecting drive partition.

  • chose your USB key partition as target.

  • CAUTION : chose your USB partition for the grub loader.

After installation process, boot on your USB key not your hard drive

share|improve this answer
    
Ubuntu 10.10 hangs for me before the installation is complete. IMHO Ubuntu has some very big bugs related to USB installation. – iugamarian Dec 11 '10 at 21:51
    
I made it with 10.04 & 10.10. Is your livecd ok ? – teo96 Dec 11 '10 at 21:57
4  
I have made live-usb flash drives in the past using the usb-disk-creator tool. Then booted it and done a 'full normal install' from that flash drive #1 to a second flash drive. Same as one would do to a real hard drive. Never really had an issue other then needing to keep an eye on where grub gets installed to. – dr_willis May 9 '11 at 1:46
2  
I second what Bubblegum said. Ive done normal installs to flash drives as if they were hard drives for the last several releases with no real issues, other then making VERY sure that grub is installing to the flash drive and not the hard drive. – dr_willis May 9 '11 at 1:53

1) Universal USB Installer:

Universal USB Installer is a Live Linux USB Creator that allows you to choose from a selection of Linux Distributions to put on your USB Flash Drive. The Universal USB Installer is easy to use. Simply choose a Live Linux Distribution, the ISO file, your Flash Drive and, Click Install. Other features include; Persistence (if available), and the ability to fat32 format the flash drive (recommended) to ensure a clean install. Upon completion, you should have a ready to run bootable USB Flash Drive with your select Linux version installed.

2) UNetbootin:

UNetbootin allows you to create bootable Live USB drives for Ubuntu, Fedora, and other Linux distributions without burning a CD. It runs on Windows, Linux, and Mac OS X. You can either let UNetbootin download one of the many distributions supported out-of-the-box for you, or supply your own Linux ISO file if you've already downloaded one or your preferred distribution isn't on the list.

3) LinuxLive USB Creator:

LiLi creates portable, bootable and virtualized USB stick running Linux. Are you sick of having to reboot your PC to try Linux ? No need with LiLi. It has a built-in virtualization feature that lets you run your Linux in Windows just out of the box.

All three programs above allow you to install any Linux operating system to a flash drive, but the persistence feature (allows you to save any changes made to a LiveOS installation permanent to be used even after reboot) is only available for Ubuntu and its many other flavors.

share|improve this answer
2  
Great post! I think he was asking more about having a full installation though. If not then your post hits his question dead on :P – zkriesse Jul 11 '11 at 22:20
    
Are those methods CLI? What are the installation commands for those programs? – Ciro Santilli 华涌低端人口 六四事件 法轮功 Sep 11 '15 at 6:58
    
Neither Universal USB Installer nor LinuxLive USB Creator run on Ubuntu. – Luís de Sousa Jan 4 '16 at 19:12

The only way I have been able to do it, is

  • to burn the CD iso,
  • disconnect my hard drive (physically remove cable(s)) and
  • install to the USB.

Not very elegant, but it works.

share|improve this answer
15  
That's... pretty radical. – badp Dec 11 '10 at 20:02
    
Did you try to use the alternate cd (not the desktop cd) ? I've seen alternate work better for many things when installing. – iugamarian Dec 11 '10 at 21:42
6  
You don't need to unplug your hard disk. You just need to be careful with partitions and use the advanced partitioner. Be sure to use the correct drive and set the bootloader to be installed on /dev/sdb or whatever block device your flash drive is(Don't use one of its partitions, or it won't boot). Then, you can boot by using your BIOS to use the flash drive MBR(Assuming your BIOS dues support that) – hexafraction Jun 11 '12 at 12:00

You can, yes.

This process assumes you are installing from a live cd. While a live usb should work fine as well, the cd option is theoretically the safest, as there is no chance of overwriting the cd during the partitioning.

I recommend you start off by disabling your internal HDD in your BIOS first, as this makes sure there is no chance of accidentally overwriting your internal partitions. Also, the partitioning step of the Ubuntu setup will be much easier, since it will only detect the USB drive. With other words, it's best to make the USB drive the only storage device present on the machine during the installation.

Next, boot up the live cd and initiate the installation as usual. Make sure you choose "use whole disk" if you disabled all other storage devices, otherwise you will have to do manual partitioning. In the last case, create an ext4 partition on the USB stick (make a partition table if there isn't one) and, if necessary, a SWAP partition if you intend to run heavy applications. Set the mount point to /. don't touch the other storage devices and their partitions!

When the setup asks for the bootloader location, choose the device name of your USB drive. This can be /dev/sda, /dev/sdb, so on, but don't choose a partition (e.g. /dev/sda1).

Wait for the installation to complete, then reboot. Make sure your machine boots from the USB drive. This can be made sure either from the boot menu (usually esc or a function key) or from the bios, where the boot sequence can be altered.

If everything went okay, Ubuntu should boot from the USB drive. If GRUB shows up, choose the first option.

Lastly, run the following command from your freshly installed Ubuntu desktop:

sudo chmod -x /etc/grub.d/30_os-prober

This makes sure that update-grub does not detect any other OSes that may be present on the system, as they do not matter for your Ubuntu USB drive installation. Also, when you boot up your USB drive from a strange computer, the OSes on its internal drive will be included into GRUB when a kernel/grub update occurs. This is unwanted.

Also, make sure to turn back on your internal storage devices from your BIOS.

share|improve this answer
    
This looks promising, thanks. I'll be trying this out. One slight remark, you put the swap partition on the USB stick. Is this still a problem these days? I remember that not too long ago people were saying that flash storage lifetime is severely reduced when running a swap partition / page file on it (because of the number of read/writes). – efdee Aug 8 '12 at 14:25
    
Using your tips, I installed Ubuntu on my USB stick, but it won't boot. However, when I use the USB stick as harddisk in VirtualBox, it comes up all right. Any idea what could be the problem ? – efdee Aug 8 '12 at 18:54
    
Apparently I can boot from it, just not from the USB3 connector. It works fine when I plug the stick into a USB2 connector. I'm assuming my BIOS has native support for USB2 but not USB3 and hence, Linux (or grub, I don't know?) needs an additional USB3 driver. – efdee Aug 8 '12 at 19:33
    
I like the sudo chmod -x /etc/grub.d/30_os-prober for the reasons you mentioned. – Elder Geek Feb 10 '15 at 14:54

The process of doing a full installation of Ubuntu to a USB flash drive is identical to installing Ubuntu on a hard drive except for the installing the GRUB bootloader. All of the steps to follow in the Ubuntu installer are identical except for installing the GRUB bootloader. Installing the GRUB bootloader on the USB flash drive will replace the existing GRUB bootloader on the hard drive which you don't want to do, unless you disconnect the cables to your hard drive(s) first before you start the Ubuntu installer to do a full installation of Ubuntu on a USB flash drive. So disconnect the hard drives first, then you can install Ubuntu on a USB flash drive.

It's also possible to do a full installation of Ubuntu on a USB flash drive without disconnecting the cables to the hard drives first by following the steps in the accepted answer to this question by Takkat.

Prepare a 16GB flash drive with 3 partitions: 250MB EFI System Partition (ESP), 250MB-1GB BIOS boot partition and a root partition. This way the flash drive will work on both BIOS and UEFI systems. GPT is probably the most reliable disk partitioning format for this.

The formats of the three partitions are as follows:

  • EFI System Partition - FAT32
  • BIOS boot partition - ext4 (can also be ext2 or ext3)
  • root partition - ext4 (can also be ext2 or ext3)

After installing Ubuntu on the 16GB drive, boot to it and install an EFI-mode boot loader/manager like rEFInd in the ESP partition as EFI/BOOT/bootx64.efi

To install rEFInd from the PPA of Rod Smith, the developer of rEFInd, open the terminal and run the following commands:

sudo add-apt-repository ppa:rodsmith/refind  
sudo apt-get update
sudo apt-get install refind

Additional information about a full installation of Ubuntu on a USB flash drive.

  • I recommend that the USB flash drive be at least 16GB.
  • A USB 3.0 flash drive is a lot faster than a USB 2.0 flash drive.
  • A swap partition will cause necessary read/writes to the USB flash drive, which will slow down the operating system and shorten the life of the USB drive. So select the manual partitioning option in the Ubuntu installer and create only a single / partition (root partition) without a swap partition.
  • The advantage of using a USB flash drive lies in its portability, not in its performance. The performance of a full install of Ubuntu on a 16GB USB flash drive is nothing like what you would get from running Ubuntu in a virtual machine application such as VirtualBox.
share|improve this answer
    
how do I make it compatible with BIOS mode? – Red Dirt Dec 27 '16 at 21:26
    
Whatever you're trying to do with "make it compatible with BIOS mode" on your hardware with EFI, GPT or rEFInd you can probably find how to do it in the answers of Rod Smith who is also the developer of rEFInd. Before making any major changes, you should try once to boot the original USB device on a different machine to eliminate the possibility that there is a boot problem caused by the eccentricities of a single computer's hardware. – karel Dec 27 '16 at 21:56
    
FYI: I've personally never had a problem installing the grub bootloader on a flash drive and leaving the MBR on the hard disk intact. – Elder Geek Jan 4 '17 at 22:42

Things have changed since 2011, Nvidia drivers are no longer required for Unity and unlimited persistence using casper-rw/home-rw partitions is possible, (but not with recent Ubuntu syslinux type boots, (SDC, Unetbootin, Roofis, Universal, etc)).

Mkusb is an installer that will fill all of the op's requirements, (if Nvidia drivers were only needed for Unity).

The user is given a choice of setup options and can select the percentage of space used for the persistent partitions, mkusb will then make remaining disk space available to Linux or Windows as storage. https://help.ubuntu.com/community/mkusb .

If the user does require Nvidia drivers a Full install is required as these drivers load before before persistence during boot

share|improve this answer

mkusb

Tested on Ubuntu 16.10 host, 16.04 USB, Lenovo Thinkpad T430.

Previously mentioned at: https://askubuntu.com/a/848561/52975 but here are more details.

Only available from PPA currently:

sudo add-apt-repository universe
sudo add-apt-repository ppa:mkusb/ppa
sudo apt-get update
sudo apt-get install mkusb
dus

and I tried the GUI version. More details at: How to make a persistent live Ubuntu USB with more than 4GB

I couldn't install NVIDIA drivers successfully however, bug report: https://bugs.launchpad.net/mkusb/+bug/1672184

qemu

Tested on Ubuntu 14.04.

Download the Ubuntu ISO.

Find your USB with:

sudo lsblk
sudo fdisk -l

Say it is /dev/sdX. Most often it will be /dev/sdb: sda is the main hard disk, and sdb the first USB. Now:

sudo apt-get install qemu
# Remove any existing boot sector, that causes installation problems.
sudo dd if=/dev/zero of=/dev/sdX count=16
sudo qemu-system-x86_64 -boot d -enable-kvm -hda /dev/sdX -m 512 \
    -cdrom ./Downloads/ubuntu-14.04.2-desktop-amd64.iso

From inside the emulator, do a normal Ubuntu install that erases the old disk.

Installation took a bit longer than on a hard disk, but worked.

I tested with:

  • plug the USB on a computer and boot from it
  • create a file on my home directory
  • reboot

The created file was still there.

share|improve this answer
    
@JustinMT: can we discuss this a bit before merging the edit? I'm not an expert, but are you sure that it doesn't work on UEFI systems? Why? What would work instead? – Ciro Santilli 华涌低端人口 六四事件 法轮功 Jan 17 '16 at 8:54

For Ubuntu 12.04 through 16.10 (all currently supported versions and flavors) the documented requirements vary but regardless an 8GB flash media should be sufficient to the task. A 16 GB version doesn't cost much more and can provide some "running room". The process itself couldn't be simpler.

1) Obtain a current ISO in the flavor of your choice

2) Check the hash to insure it's valid

3) Create a bootable media with the ISO (flash or optical disk)

There are a number of ways of doing this, my preferred method is to either

A) Flash drive method

Use dc3dd to simply duplicate the ISO to a target installer flash drive via the command line with the command sudo dc3dd if=yourisoname.iso of=medianame where yourisoname.iso is the name of the iso you downloaded and checked the hash for previously and medianame is the device name of your flash media. (as in /dev/sdb for example) you can easily determine the device name by checking the output of sudo fdisk -l

or

B) Optical Disk method

Burn the image to optical disk with your preferred OD image writing software. I'm rather partial to K3b but any optical disk burning software that supports the "Burn image" option should be suitable.

4) Continue to install normally as in:

Boot the installer and select the target flash drive as the target (I use manual partitioning AKA something else so that I can avoid creating a swap partition to reduce writes to the flash media that may cause early demise)

If any part of this process is unclear to you please drop me a comment and I will attempt to clarify. Note that if you are using a flash drive to install from, you'll need a second flash drive for your target installation.

EDIT: Another option would be to perform a Netboot Installation from the Internet I have not attempted this personally but include it as an option here in an attempt to cover all the options.

If you are careful there isn't much risk of overwriting the MBR of an existing drive in your system. After booting the live system you can run sudo fdisk -l from the CLI or Disks from the GUI and determine which drive is your valid usb target.

Once installation is complete you should be able to boot from your flash drive on any system with similar architecture simply by selecting your flash drive as the boot device in the BIOS.

share|improve this answer
    
Is there a way to do it with only one USB stick (I have no optical drive). I'm also a little concerned about the MBR - how can I ensure I can still boot the computer I use to install onto the USB? – Tim Jan 4 '17 at 16:02
    
@Tim I like to think all things are possible. The reason I wouldn't recommend that course of action is that if something goes wrong You'll have tio repeat the first 3 steps all over again. Having said that that approach is completely untested and not recommended, it occurs to me that you could get one shot at getting it right by booting with the toram kernel parameter. – Elder Geek Jan 4 '17 at 16:08
    
@Tim regarding the MBR concern, the installer will setup GRUB on the device you choose. To insure that you don't modify the MBR of the computer you use to install on the flash drive, simply ensure that you choose the USB flash drive as the target. sudo fdisk -l in a live session will give you a list and you should be able to determine from the output what your target should be (provided of course that you've attached the drive you wish to install to first) – Elder Geek Jan 4 '17 at 21:09
    
I did something similar with a persistent live Lubuntu system created with mkusb into its own pendrive. I 're-purposed' the usbdata partition for the installed system (with gparted) and ran the ubiquity installer. And the final system could boot both into the installed system and the persistent live system. But I think that installing from a compressed image file is much more straightforward, and the portability should be good enough for most computers that can run 64-bit PCs. – sudodus Jan 4 '17 at 22:24
    
I saw that. I honestly couldn't get the 8GB img I downloaded to work. Had good luck with the 4GB one though. – Elder Geek Jan 4 '17 at 22:38

It has been described here and in many other places how to install Ubuntu into a USB drive like you install it into an internal drive. It is straight-forward to do it with the standard installer (Ubiquity), if you can disconnect or unplug the internal drive. It works in either UEFI mode or in BIOS mode, the same mode as was booted when installed.

Installed system that boots from UEFI and BIOS mode

But if you want a USB drive with an installed system, that boots in both UEFI and BIOS mode, it is more difficult. I made such systems and prepared compressed image files, that can be installed in linux with mkusb directly, or in Windows in a two step procedure, extraction and cloning (and fixing the GPT). mkusb does it all, including fixing the GPT.

The mkusb Launchpad project is here.

The systems created from these compressed image files are quite portable between computers, not quite as portable as a persistent live system, but more flexible, when you want to update and upgrade the system (kernels, drivers etc).

See the following links and links from them,

help.ubuntu.com/community/Installation/UEFI-and-BIOS

Installed systems with guidus and gparted

You find compressed image files at this link,

phillw.net/isos/linux-tools/uefi-n-bios

Look for the newest files with updated versions of the installed program packages.

If there is a temporary problem to download these compressed image files, you can try the following torrent files,

dd_text_16.04-UEFI-n-BIOS_2017-01-15_intel-4-pendrive-7.8GB.img.xz.torrent

dd_dus-lxde_16.04-UEFI-n-BIOS_2016-12-12_intel-4-pendrive-7.8GB.img.xz.torrent

uploaded at UEFI-and-BIOS/torrent where you also find a short description. [Left]click on the torrent link, get to the attachment page, and there you right-click on the link and select 'save link as' to get the torrent file.

user: guru
password: changeme

dd_text_16.04-UEFI-n-BIOS_2017-01-15:

enter image description here

dd_dus-lxde_16.04-UEFI-n-BIOS_2016-12-12:

enter image description here

share|improve this answer
    
@Elder Geek, Do you mean that I should upload a torrent file to the mkusb PPA? Maybe there is a better place than to mix it into the mkusb software. Or is it information for other people? – sudodus Jan 4 '17 at 22:43
    
Just trying to make it convenient for them to find the project. Nothing more. ;-) – Elder Geek Jan 4 '17 at 22:44

BIOS METHOD

Following is a step by step how to install 17.10 on a 16GB flash drive with options for separate Home partition and Windows compatible data partition:

  • Create a live USB or DVD using SDC, UNetbootin, mkusb, etc.
  • Turn off and unplug the computer. (See note at bottom)
  • Remove the cover.
  • Unplug the power cable from the hard drive or unplug the hard drive from the laptop.
  • Plug the computer back in.
  • Insert the flash drive.
  • Insert the Live USB or Live DVD.
  • Start the computer, the USB/DVD should boot.
  • Select language.
  • Select install Ubuntu.
  • Select "Download updates while installing" and Select "Install this third-party software", (optional).
  • Select "Continue".
  • At "Installation type" select "Something else". (Full disk encryption is not working with flash drives).
  • Select "Continue".
  • Confirm target device is correct.
  • Select "New Partition Table".
  • Click Continue on the drop down.

(Optional FAT32 data partition for use on Windows machine)

  • Click "Free space" and "+".
  • Make "Size..." about 2000 MB.
  • Select "Primary".
  • Location = "Beginning of this space".
  • "Use as:" = "FAT32 file system".
  • "Mount point" = "/windows".
  • Select "OK"

  • Click "free space" and then "+".

  • Select "Primary", "Size ..." = 4500 to 6000 MB, "Beginning of this space", Ext4, and Mount point = "/" then OK.

(Optional home partition)

  • Click "free space" and then "+".
  • Select "Primary", "New partition size ..." = 1000 to 6000 MB, Beginning of this space, Ext2, and Mount point = "/home" then OK.

(Optional swap space, allows hibernation)

  • Click "free space" and then "+".
  • Select "Primary", "New partition size ..." = remaining space, (1000 to 2000 megabytes, or same size as RAM), Beginning of this space and "Use as" = "swap area" then OK.

(Important)

  • Confirm "Device for boot loader installation" points to the root of the USB drive. Default should be ok if HDD was unplugged.
  • Click "Install Now".

  • Select your location.

  • Select "Continue".
  • Select Keyboard layout.
  • Select "Continue".
  • Insert your name, computer name, username, password and select if you want to log in automatically or require a password.
  • Selecting "Encrypt my home folder" is a good option if you are worried about loosing your USB drive.
  • Select "Continue".
  • Wait until install is complete.
  • Turn off computer and plug in the HDD.
  • Replace the computer's cover.

Note: You may omit disabling the hard drive if after partitioning you choose to install grub to the root of the USB drive you are installing Ubuntu to, (ie sdb not sdb1). Be cautious, many people have overwritten the HDD MBR as default location for boot loader is sda, any items in the internal drive's grub will be added to the USB's grub. You may do an update-grub later.

share|improve this answer
    
Will it make a difference, if you install in UEFI mode or BIOS mode (alias CSM alias legacy mode)? Please advice about boot modes. – sudodus Dec 6 '17 at 8:35
    
@Sudodus: I generally work in BIOS mode. I am in UEFI mode at present booted from a Lexar 128G Ultra with a GPT table made using the above method on a BIOS boot. Yesterday I made an install of Elementary OS with a msdos partition table while booted BIOS and it has no problem with UEFI. Maybe my computer's UEFI is funky... Anything you want me to test? I used mkusb to make the Live disks. – C.S.Cameron Dec 6 '17 at 9:16
    
Your experience is different from mine. We have different computers (and different UEFI/BIOS systems). And I have worked mainly with 16.04.x LTS, while you mention that you install 17.10. Is it standard Ubuntu 64-bit? -- 1. I will try according to your recipe and report my results ; 2. If possible, can you try in some other computers (borrow from friends etc.) – sudodus Dec 6 '17 at 10:08
    
The Lexar has ubuntu-16.04.3-desktop-amd64 the Sandisk has elementaryos-0.4.1-stable.20170814. Maybe there are some remnants on the disks from past installs I will zero the Sandisk and make a new install of ubuntu-17.10-desktop-amd64, I am jungle side now in Hikkaduwa but a friend has a newish laptop that might have UEFI, will check. Let me know your results, PM at the Forms is OK. – C.S.Cameron Dec 6 '17 at 10:51
    
I was not able to make an installed 17.10 system boot 'in the other boot mode' as easily as you describe. I still have to use the method of help.ubuntu.com/community/Installation/UEFI-and-BIOS – sudodus Dec 6 '17 at 17:16

BIOS/UEFI Full Install

Mkusb makes a great base for many bootable pendrive projects, from grub2 bootable Puppy Linux to multiboot Persistent systems, multiboot Full systems and mixed/hybred Persistent/Full systems.

I used the following method to make a BIOS/UEFI Full install:

Use mkusb to make a Live system on a USB (2GB or larger).

Use mkusb to make a Persistent system on a USB 16GB or larger, using default settings with ~12GB persistence, (remaining NTFS partition is used as Windows accessible data partition).

Open GParted and delete sdb4, the ISO9660 partition and expand sdb5 into the recovered space.

Remove HDD before proceeding further, (optional but recommended, highly recommended in UEFI mode).

Boot Installer drive, select Try.

Insert Target drive

Start Install Ubuntu...

Select Something else.

Select sdb5, (on the target drive), and click Change.

Select Use as: ext4, Format and Mount point: /.

Don't touch any other partitions (unless adding a /home partition).

Select sdb5 for boot loader installation.

Complete installation.

Cut grub.cfg from sdb5/boot/grub and paste to sdb3/boot/grub, overwriting the existing grub.cfg file.

Boot the target drive and run sudo update-grub, (optional).

I figure this should work on any computer a mkusb built Persistent drive works on.

Please comment if it does not work for you.

Further discussion on creating drive using this method in UEFI mode starting at: https://ubuntuforums.org/showthread.php?t=2213631&page=17&highlight=usb post 169.

share|improve this answer
    
It works for me, both when doing the installation in BIOS mode and in UEFI mode :-) I did it with no internal drive connected, and there is one more test to be done - installing in UEFI mode with an internal drive connected. – sudodus Dec 8 '17 at 21:37
    
First thing this morning attempted above proceedure from UEFI boot ignoring own advice to disable internal drive... install proceeded with sda as boot loader target. New advice - don't attempt Full install until after first cup of coffee. Borrowed computer has Win10 installed as BIOS boot. After install, returned to BIOS mode and launched Win10, there was no problem. Zeroed flash drive and next attempt to do full install in UEFI mode was successful, the flash drive booted in both BIOS and UEFI. Will include note on deleting sdb4, the ISO9660 partition, before installing, it saves time. – C.S.Cameron Dec 9 '17 at 5:20

I followed the Ubuntu guide on their site.

Cononical recommend this program and I have uses it for every install of Linux to date and the program also writes Grub2 to the installation so all you need to do is select 'boot from USB' in your BIOS and go from there.

Here's the download link too:

To install to a USB

How do I install Ubuntu to a USB key? (without using Startup Disk Creator)

share|improve this answer
    
Thanks. I saw this earlier, but I reckoned it was just for writing a live CD ISO to the USB stick. Where does the actual "installation" happen? Do I still get to pick how the partitions are laid out? From the little text on that page, it really looks like they just burn an image and then reserve some persistent storage space on top of that. – efdee Aug 8 '12 at 12:13
    
No, this just burns the .iso to your USB drive, you then have two options in the boot menu: Install to hard drive or try out Ubuntu and boot from the USB. If you select 'try from usb' option you can install later on and write all the files to the HDD. The installation happens when you boot up. You can install Ubuntu from Windows, but it still requires you to reboot; was that what you wanted? – TheBlueCat Aug 8 '12 at 12:41
    
This still sounds like it is writing a persistent live CD to the USB stick. This is not what I want, I want a full install running off the USB stick. Unless the "Install to hard drive" you mention also installs it to the USB stick, but I assume it doesn't. Ideally I just want to reboot now, boot from a Ubuntu install CD, then run through the installation as usual but install to the USB stick instead of to my laptop's hard disk. – efdee Aug 8 '12 at 13:00
    
Look at this question, I'll update my original answer, if this helped you hit the accept button. askubuntu.com/questions/16988/… – TheBlueCat Aug 8 '12 at 13:32

Another way to start Ubuntu installation is to get to Grub console from Grub2 Boot Menu. It will fire up installation from Ubuntu ISO file on your HD.

Lets say you have your Ubuntu.iso on 3rd partition of your hard drive

Type c to get to Grub command promt and type the following:

loopback loop (hd0,3)/Ubuntu.iso

press "Enter"

linux (loop)/casper/vmlinuz.efi iso-scan/filename=/ubuntu.iso file=/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash

press "Enter"

initrd (loop)/casper/initrd.lz

press "Enter"

boot

press "Enter"

note (hdx,y) - is the partition where your Ubuntu ISO file is

This will fire up normal Ubuntu installation process just like you see it when installing from Ubuntu CD. From there you can choose your USB Flash Drive to install Ubuntu on it.

share|improve this answer

I was able to do this using 2 usb's:

One created as a usb ubuntu installer the normal way (the installer usb) Another as the OS usb.

(I recommend to rm your hdd's first)

1) plug in the installer usb, boot into it's live desktop 2) run the installer, installing to the os usb

Worked a treat!

Now I've got an OS usb I can boot from anything! yay.

share|improve this answer

protected by Community Jun 24 '14 at 7:24

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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