4

Rather than to install dual-OS on my laptop, I would like to install Ubuntu on my flashdrive (USB flash memory, or whatever you call it). So, whenever I want to run my Ubuntu, I will just plug my flashdrive to the USB port and run it from there by change the boot sequence in BIOS.

Is it possible?

DK Bose
  • 42,548
  • 23
  • 127
  • 221
AirCraft Lover
  • 175
  • 1
  • 1
  • 8
  • Yes. You write the ISO to one media, and install on another (eg. install to second usb). I haven't done it recently, but I did on some machines need to tweek the system so I could boot it on multiple machines, but this was probably machine/bios specific. (once installed you no longer need the installer/ISO thumb-drive) – guiverc Feb 20 '19 at 02:33
  • As long as my understanding, ISO is installer, right? What I am asking is it fully install on flashdrive, not a life CD. Life CD i have it now Ubuntu 11.10. It is not full feature. Is it still ask to be installed – AirCraft Lover Feb 20 '19 at 02:50
  • Ubuntu 11.10 or the 2011.October (Ubuntu releases are yy.mm in format) is well past EOL (15 months) so I'd recommend a supported version. You download the ISO (a file) which is written to a thumb-drive (installer which is run in 'live' mode usually) which is booted & used to install to a hdd/sdd/system (or another thumb-drive in this case). Yes one of either could be cd/dvd/cdrw/dvdrw but thumb-drives are more common today. What I suggested was just to install to another thumb-drive (treating it as if it's your hdd/sdd), then when you reboot you can remove first thumb-drive/cd/dvd/.. – guiverc Feb 20 '19 at 02:58
  • Yes, it is Ubuntu released in October 2011. It was my last Ubuntu I used. Since that time I stopped using Ubuntu, after previously I used Ubuntu 7.04 (2007.04). Before that, I used RedHat. – AirCraft Lover Feb 20 '19 at 03:19
  • The following link has a slightly different perspective and will add some details not yet found in C.S.Cameron's good answer: Introduction and Instructions – sudodus Feb 20 '19 at 14:15

2 Answers2

4

Full Install to USB

11.10 is too old, Latest LTS, (Long Term Service), release is 18.04.

Full installs are more stable and secure than persistent installs, but not as quick to make. They are better at utilizing disk space as no fixed size casper-rw file or partition is required. They are not very good for use of installing Ubuntu.

Following is a step by step how to install 18.04 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)
  • 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 Keyboard layout
  • Select "Continue".
  • Select installation type and "Download updates while installing Ubuntu" and Select "Install third-party software ...", (optional).
  • Select "Continue".
  • At "Installation type" select "Something else". (Full disk encryption is now 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"

(Non Optional Root Partition)

  • 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".
  • Insert your name, computer name, username, password and select if you want to log in automatically or require a password.cscameron
  • 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.

C.S.Cameron
  • 19,519
  • First, I will not use the 11.10 as it is to old. I was telling abiut live-CD rather than to say I will install it. – AirCraft Lover Feb 20 '19 at 04:57
  • I will make a bootable installer (on USB flash drive or on CD/DVD). I will take out my laptop hardrive. Then I will boot the laptop from the live-CD/Flashdrive. Then I will install. Is like that? – AirCraft Lover Feb 20 '19 at 04:59
  • That always works for me. I will check back here to see if you have any questions. There is another method if you have BIOS/UEFI problems. – C.S.Cameron Feb 20 '19 at 06:30
  • +1 for a very detailed answer. I would not bother with the swap partition for Ubuntu 18.04 in a USB. Three reasons: First, Ubuntu now uses a swap file by default. Second, hibernating a system into a USB drive and then unplugging it (by mistake) may have unexpected effects. Third, hibernation won't work if the same USB is used in a different computer with more RAM than the original computer. – user68186 Feb 20 '19 at 14:35
1

Here's another way: Use Virtualbox to install Ubuntu. You only need one USB drive, and don't have to worry about screwing up your current installation of Windows. Edit: With this method, you're ony using Virtualbox to install Ubuntu. You don't use it to run Ubuntu at all. Once it's installed, Virtualbox is no longer needed.

Plug in your USB and open up the Disk Management utility. Take note of the drive number that your USB drive shows up as. Open up cmd and run:

VBoxManage internalcommands createrawvmdk -filename "C:\Users\<user_name>\VirtualBox VMs\<VM_folder_name>\<file_name>.vmdk" -rawdisk \\.\PhysicalDrive#

This will create a file that points to the physical drive you've entered (in this case, your USB drive). Now, just start Virtualbox as an administrator and create a new VM as usual, but, when you're prompted to create a drive—select the option that allows you to choose an already-existing drive, and point Virtualbox to the .vmdk file you've just made.

Note: I've used this on Linux quite a few times. In fact, I used it to install Windows on the 2nd harddrive in my computer without a USB. I've never used Windows to install another thing; the commands are slightly different, but I assume things like, when one needs to use sudo in Linux, running the command (e.g. - Virtualbox) as an administrator is sufficiently equivalent.

Sources:

  • What is that mean need VirtualBox to install Ubuntu? I used to use VirtualBox (so did VMWare), it is used to install virtual OS inside any other OS. But the problem with VirtualBox so does VMWare is that it use the same memory to the main OS. VirtualBox and the OS running on it is considered as one application. – AirCraft Lover Feb 20 '19 at 05:38
  • @AirCraftLover Virtualbox uses the same memory as you OS, but so will your USB. The memory you use doesn't belong to a specific OS, it's you hardware (which anything, including the OS on your USB, can use). – AmagicalFishy Feb 20 '19 at 05:44
  • I meant, using VB is significantly slowing the main OS. Or, I have to limit the memory resource to be used by the VB. By doing so, the virtual OS running inside the VB will be limited. – AirCraft Lover Feb 20 '19 at 06:11
  • @AirCraftLover Sorry, I think you're misunderstanding what the purpose of Virtualbox is here. You only use it to install Ubuntu. Once Ubuntu is installed, you don't use Virtualbox anymore—you just boot from the USB like regular. Virtualbox is not needed after you install Ubuntu. – AmagicalFishy Feb 20 '19 at 12:54
  • I see. Seems is different than what I used to use. – AirCraft Lover Feb 20 '19 at 14:18
  • @AirCraftLover I believe you're missing the key step. Usually you're correct, but when you use the VBoxManage command I outlined, you change how things are installed. They're not installed on a virtual drive which requires your host OS's resources—they're installed independently on the flash drive. – AmagicalFishy Feb 20 '19 at 19:40
  • Give me sometimes to understand. I have 8 years didn't touch VB and Linux..So I have to learn lot more. – AirCraft Lover Feb 20 '19 at 21:22
  • @AirCraftLover Hey, no worries, man. If you have any questions, just ask. :) If you have an extra USB, give it a try (I find the easiest way to learn these types of things is to try them out yourself) – AmagicalFishy Feb 21 '19 at 17:17