Full Install to USB Drive: Four Options

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Full Install to USB Drive: Four Options

Post by pbear » Tue Feb 05, 2019 3:23 am

I’m a big fan of full install to USB drive. IMHO, it’s the best way for a Windows user to try Mint. Simpler than dual install and has none of the unwind issues. It’s also useful for test boxes and a backup system, which is mainly how I use it. This question comes up often, but there’s no single tutorial, thread or article of which I’m aware which covers the subject, though there are many covering various aspects. What I’ve done in this tutorial is collect insights learned from many sources. None of this is original to me, nor should any of these be described as my methods.

No one strategy is appropriate for everyone. A crucial issue is whether the host machine (the one from which the installation will be done) uses UEFI or BIOS (legacy boot, CRM, etc.). This is crucial because there’s a bug in the Ubuntu installer, also used by Mint, which in UEFI will bollix the internal hard drive’s bootloader even if one specifies the new bootloader should be installed only to the USB drive. Installation in BIOS mode (below) doesn’t have this problem. In all, I know of six ways around the UEFI installer bug. One is to use BIOS mode on a session basis, i.e., the current boot only, for which a BIOS installed USB drive will be fine. Second is to remove the internal hard drive while installing to USB, but that’s not feasible for most folks with laptops. Third is to install as usual, ignoring the bug, then fix the internal bootloader afterwards. I’d rather do a root canal. Described below are the other solutions, which I call Hybrid Install, Unflag/Reflag and rEFInd Method. Of the three, Unflag/Reflag is the simplest and most like a standard UEFI installation. If you're not certain whether your system uses BIOS or UEFI, run one of the tests described in Tips & Options (below).

A second issue is which sort of USB drive to use. I strongly recommend a USB hard drive (SSD or HDD). It will last much longer than a flash drive, give better performance and, of course, have much more space. Besides, they’re cheap now. A flash drive is okay for a test system, but understand it’s going to burn out relatively quickly as they’re not engineered for this sort of thing. How quickly varies, but most reports on the Forum seem to run several months to a year. Also, don’t use a 2.0 flash drive; they’re simply too slow, though curiously a 3.0 drive on a 2.0 port does okay. As for size, I recommend 64 GB; has plenty of room for the system, additional apps and Timeshift snapshots (the system restore utility). You can get by with 32 GB, but don't try to install many apps and monitor space used by Timeshift. Even 16 GB will work if you forego Timeshift, but I don't recommend it.

A third issue is objective. This relates especially to partitioning. As with a standard installation, beginners generally should start with a simple scheme, just a root partition. See ELTP. (In earlier versions, a swap partition also was required, but LM19 by default uses a swap file instead.) With a flash drive, plan to keep data files on the internal drive (which, no doubt, is where they are now). Intermediate and advanced users might want to have a separate home partition, or even separate swap, data and/or Timeshift partitions. IMHO, though, none of those make sense for a flash drive. Yet another option (with a hard drive) is a multi-boot system with several versions of Mint/Linux, all sharing a single data partition.

Bear in mind this looks complicated because there are so many options. Once you pick a strategy, the actual work is scarcely any more than a standard installation. I’m going to assume you’ve already downloaded, verified and burned your ISO to USB or DVD. Note the target USB for full install has to be separate from the one used for the ISO. Also, I assume you have read the Installation Guide. The installer includes a module for setting up and/or modifying partitions, but I always do this before installation using GParted (included in the live ISO).

Note: Per Forum rules, if you have a question or need assistance, don’t post here. Read how to get help, then open a thread in the Installation Forum. Link to this tutorial (so folks will know what you’re trying to do), include an inxi output for your system, and state whether it’s BIOS or UEFI.
Last edited by pbear on Fri Apr 12, 2019 11:54 am, edited 7 times in total.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Tue Feb 05, 2019 3:24 am

BIOS Install

This is the easy procedure, suitable for BIOS computers (generally, those originally sold as Win7 or earlier). Also can be used on more recent computers set up to run in BIOS mode, also known as legacy boot or CRM, or more recent computers which can be set to run in BIOS mode on the fly, i.e., for the current boot only.

Boot live ISO. Turn off screensaver, screen lock and display shutoff. Set up internet connection. If desired, open Firefox, navigate to the Forum and open this tutorial for reference. Attach USB drive to which will be installing.

Simple Installation. This is the default method, what you would get, for example, if you had the installer set up a dual boot system. As mentioned above, it’s the best choice for beginners and (imho) the only sensible choice for a flash drive. Double-click installer icon on desktop. Select language and keyboard; choose whether to install third party software. At screen where choose installation method, select “Erase disk and install.” Notice there’s nowhere to say which disk. It’s okay. Click “Install now” and you get that option on the next screen.* Get this right, obviously. From the dropdown menu, select target USB. If booting the live session from USB, that generally will be sdb and the target USB will be sdc; if booting from DVD, the target USB generally will be sdb. Click “Install Now” again and off we go. Installer will set up a single root partition and install the bootloader to the MBR of the target drive. (For LM18, also will create a swap partition.) When done, click “Continue,” then shutdown and remove the live USB/DVD.

* If you get instead a screen asking you to confirm formatting of sda, STOP! This means you either forgot to attach the USB drive or it’s formatted in such a way that the system doesn’t recognize it. Whatever the problem, fix before proceeding. Plainly, you don’t want to format the internal hard drive.

Advanced Installation. Use this for a more complex setup, e.g., multi-boot or separate root and home partitions. Before initiating install, set up partitions with GParted. Will open with a box displaying partitions of sda, the internal hard drive. USB drives are accessed with a dropdown in the upper-right. From the Menu, select Device: Create Partition Table. For a simple scheme (four partitions or less), msdos type (also known as MBR) is fine. For more complex schemes, rather than muck around with an extended partition, you’re generally better off using gpt (backwards compatible with BIOS), which allows up to 128 primary partitions. For the “how to” on that, see tutorial by austin.texas. Once have set up partitions, close GParted. Double-click "Install" icon on desktop. Initiate install to target USB drive using “Something Else” option. (Let installer unmount partitions when asked.) Select partition planning to use for root, e.g., sdc1 (assuming target is sdc); click Change; Use as: Ext4 system (but don’t tick format box) and select mount point as root (“/”) (annoyingly, you can’t see the mount point option until you’ve selected “use as”). Select and define mount point for other partitions, e.g., sdc2 for /home if that's what you set up in GParted. In lower section of the box, select sdc for grub (important: select the drive, not one of the partitions). Double-check not making any changes to the internal hard drive. Run install (confirm no format, which we did in GParted), selecting other options as preferred (see Installation Guide). Shut down live session and remove the live USB.

For LM18, you need a swap partition; generally should be equal in size to RAM; format linux-swap. LM19 by default uses a swap file, so no need for a partition, but make sure root is large enough to accommodate. I use 30 GB plus swap. The installer swap file is less than 2 GB, so 32 GB for root will be plenty. If planning to enable hibernation, which you do post-installation (see gm10's tutorial), make root = 30 GB + RAM. Note this doesn't come up for simple install, even if planning to set up hibernation, because it’s all one large partition.

Post-Installation. Boot the newly installed system. As with any operating system, there are a bunch of options and settings. Main thing to know straight away is that the screensaver by default locks the system after five minutes (requires password to unlock). You can remove the lock or extend the timeout with the Screensaver configuration app. Also, if you’re booting on a Windows machine, set Mint to use the system clock rather than UTC; otherwise, every time you boot the USB it will reset the system clock, which then has to be set back with Control Panel (well, it’ll sync itself eventually, but annoying in the meantime). Easy to do. Open Terminal and run timedatectl set-local-rtc 1. Done.
Last edited by pbear on Fri Apr 12, 2019 12:30 pm, edited 5 times in total.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Tue Feb 05, 2019 3:27 am

UEFI - Hybrid Install

This method is pretty cool, as it produces a USB drive which will boot in either BIOS or UEFI. It's the method I generally use because I have two laptops, one of each. Indeed, I’ve done it more times than I can count. Definitely works (so long as the computers involved don’t require special drivers). Credit to someone called msavini, who posted this to the Ubuntu Forum, where it was ignored and sank into obscurity.

Overview. It’s a two stage process. First, boot the live session in BIOS mode and install to the USB drive, then reboot and manually install a UEFI bootloader. It’s essential to use BIOS or legacy mode for the installation and first post-installation boot. After that, the USB will boot in either mode. Easiest with a BIOS machine. Otherwise, either use on-the-fly BIOS mode or switch over the whole system then switch back when finished.

Note: The simple “erase and install” method can’t be used here because Hybrid Install uses a special partition scheme. Instead, we must use the Something Else method. I still recommend a root-only system, though, for beginners and flash drives.

Boot live ISO. Turn off screensaver, screen lock and display shutoff. Set up internet connection. If desired, open Firefox, navigate to the Forum and open this tutorial for reference. Attach USB drive to which will be installing.

Partitioning. Open GParted. Will open with a box displaying partitions of sda, the internal hard drive. USB drives are accessed with a dropdown in the upper-right. Generally, if booting from USB, it will be sdb and the target USB will be sdc; if booting from DVD, the target USB generally will be sdb. From the Menu, select Device: Create Partition Table: gpt type (the UEFI format); Apply (note warning). From Menu, select Partition: New. Set up three partitions: #1: 2MiB (unformatted, at very bottom of drop down menu); #2: 200MiB (format fat32); #3: [remaining space] (format ext4). Apply. When complete, right-click #1 and set flag as bios-grub.. Close GParted.

This is a simple partition scheme. If desired, additional partitions may be specified for home, data, etc. For LM18, which requires a swap partition, I put that in position #3 (moving root to #4) so I don’t have to worry about moving it later. FYI, partition #1 is called a BIOS boot partition. It’s standard procedure for using a gpt table in BIOS. See austin.texas’s tutorial (same link as above). Clears space at the head of the drive, which in gpt doesn’t have an MBR, so the installer will have somewhere to put the bootloader.

Installation. Double-click "Install" icon on desktop. Initiate install to target USB drive using “Something Else” option. (Let installer unmount partitions when asked.) Select sdc3 (assuming the target is sdc); click Change; Use as: Ext4 system (but don’t tick format box) and select mount point as root (“/”) (which you can’t see until you’ve selected “use as”). If have set up a home partition, assign that mount point also. Select sdc for grub (important: select the drive, not one of the partitions). Double-check not making any changes to the internal hard drive. Run install (confirm no format, which we did in GParted), selecting other options as preferred (see Installation Guide). Shut down live session and remove the live USB.

UEFI Bootloader. Boot the newly installed system, still using BIOS or legacy boot (in fact, it can't boot in UEFI yet). Turn off screensaver and display shutoff. Set up internet connection. Install GParted (included by default in the live version but not the installed one); open; right-click partition #2 (now probably sdb2) and mark with boot and esp flags; close GParted. Open Firefox, navigate to the Forum and open this tutorial for reference. Open Terminal and run, one line at a time (using copy and paste):

Code: Select all

$ sudo apt-get install grub-efi-amd64-bin
$ sudo mkdir -p /mnt/esp
$ sudo mount /dev/sdb2 /mnt/esp
$ sudo grub-install --efi-directory /mnt/esp --boot-directory /boot --target x86_64-efi --removable /dev/sdb
Installing for x86_64-efi platform.
Installation finished. No error reported.
$ sudo umount /mnt/esp
$ sudo rm -r /mnt/esp 
Note: After entering the first command, you’ll be asked for a password. This is the same as your user password, selected during installation. FYI, the fifth and sixth lines are text Terminal will display if the crucial command (the fourth line) runs correctly.

Troubleshooting. Occasionally, a system won’t boot from a BIOS boot partition. Per rene, one workaround is to set a boot flag on the protective MBR. Run sudo fdisk -t dos /dev/sdb, then p to print (display) the protective MBR, then a to make it active, w to write and q to quit. Note: to see a list of commands in fdisk, hit m. As regards UEFI boot, be aware the USB only will work if secure boot is disabled. This is because we’re using the generic backup bootloader rather than the registered Ubuntu bootloader. If there’s a way to set up a USB drive to use the registered bootloader, I’ve not seen it. Disabling secure boot isn’t a big deal, AFAICT, but does require administrative access to the firmware settings.

Post-Installation. Boot the USB drive again, this time in UEFI. As mentioned for BIOS install (above), you may want to remove the system idle lock or extend the timeout with the Screensaver configuration app. Also, if booting on a Windows machine, run timedatectl set-local-rtc 1 so the USB drive won’t reset the system clock.

Note: Grub will reflect the internal bootloader present at the last update, i.e., that of the machine on which it was running at the time. You can update that with sudo update-grub if you change machines, but I generally don’t bother.
Last edited by pbear on Tue Sep 24, 2019 12:34 pm, edited 4 times in total.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Tue Feb 05, 2019 3:28 am

UEFI - Unflag/Reflag Method

After nearly two years looking at this issue, I recently found a simple solution for the UEFI bug. It's functionally equivalent to removing the internal hard drive, but done with GParted rather than a screwdriver. Posted to askubuntu in July 2018 by a fellow named Tim Richardson. Be aware the USB drive will boot in UEFI only; if you want to be able to boot in BIOS also, use Hybrid Install.

Overview. After booting the live ISO, use GParted to unflag the internal drive's EFI partition. Install to the USB drive, then restore the internal drive boot flags. Sounds a bit like catching a bullet in your teeth, but I've tested on a Win10 machine and it works. The reason, apparently, is that the installer is simplistic, which is why there's a bug in the first place. With the boot and esp flags removed, the installer doesn't recognize the EFI partition and, so, leaves it alone. Instead, it installs the entire bootloader on the USB drive, which is precisely what you want.

If the installer asks whether to force installation in UEFI, cautioning this may create a conflict, answer “yes.” This means the installer has detected the internal drive’s operating system (doesn’t always) and noticed there’s no (active) EFI partition. You may proceed because (a) the new EFI partition will be placed on the target USB drive and (b) you’re going to restore the internal EFI partition’s boot flags at the end, so there’s no conflict.

Boot live ISO. Turn off screensaver, screen lock and display shutoff. Set up internet connection. Attach USB drive to which will be installing. Open GParted. Find EFI partition on sda (the internal drive); right-click and untick boxes for boot and esp (GParted will automatically assign the msftdata flag instead). Close GParted.

Simple installation. Like BIOS Install, the simple “erase and install” option can be used here. The installer will create an EFI boot partition,* then a root partition for the remaining space. (In LM18, it also will create a swap partition.) Double-click installer icon on desktop. Select language and keyboard; choose whether to install third party software. At screen where choose installation method, select “Erase disk and install.” Notice there’s nowhere to say which disk. Click “Install now” and you’ll get that option on the next screen.** Get this right, obviously. From the dropdown menu, select target USB. If booting the live session from USB, that generally will be sdb and the target USB will be sdc; if booting from DVD, the target USB generally will be sdb. Click “Install Now” again and off we go. When done, click “Continue” (don't shutdown) and proceed to Post-Installation (below).

* To be precise, the installer will create the partition and place in it a folder called EFI, which will have two sub-folders, BOOT and ubuntu. As a practical matter, when the USB boots, it will use only the BOOT subfolder and bootx64.efi, which is the backup bootloader. ubuntu is the regular one, but superfluous in a USB install. Notably, the backup bootloader doesn't have to be registered in NVRAM and isn't, which is why this strategy and Hybrid Install don't bollix the internal bootloader.

** If you get instead a screen asking you to confirm formatting of sda, STOP!. This means you either forgot to attach the USB drive or it’s formatted in such a way that the system doesn’t recognize it. Whatever the problem, fix before proceeding. Plainly, you don’t want to format the internal hard drive.


Advanced installation. Use this for a more complex setup, e.g., multi-boot or separate root and home partitions. Before initiating install, set up partitions with GParted. Select target USB; from Menu, select Device: Create Partition Table: gpt type (the UEFI format); Apply (note warning). From Menu, select Partition: New. Create the EFI boot partition; 200MB is plenty, as it’s going to be used only for one OS, this one; format fat32; right-click and set boot and esp flags. (If installing LM18, set up a swap partition next; generally should be equal in size to RAM; format linux-swap.) Create remaining partitions as preferred. Close GParted. Double-click "Install" icon on desktop. Initiate install to target USB drive using “Something Else” option. (Let installer unmount partitions when asked.) Select partition planning to use for root, e.g., sdc2 (assuming target is sdc); click Change; Use as: Ext4 system (but don’t tick format box) and select mount point as root (“/”) (which you can’t see until you’ve selected “use as”). Select and define mount point for other partitions, e.g., sdc3 for /home (if that's what you set up). In lower section of the box, select sdc1 for grub (unlike a BIOS install, select the partition, not the device). Double-check not making any changes to the internal hard drive. Run install (confirm no format, which we did in GParted), selecting other options as preferred (see Installation Guide). When installation completes, click dialogue button for Continue (don't shutdown).

Post-Installation. Still in the live session, open GParted again. Right-click EFI partition of sda, then restore boot and esp flags. Now shut down the live session and remove both USB drives. Boot computer to make sure works correctly. Now boot the new USB drive to test that. If booting on a Windows machine, run timedatectl set-local-rtc 1 so the USB drive won’t reset the system clock. In his tutorial (link above), Tim Richardson modifies the EFI menu to distinguish the USB OS from the internal (he's running Ubuntu on both), but this is optional and I don’t. It's a bigger issue with a multi-boot USB, but the same objective is achieved more easily IMHO by editing lsb-release files (see ELTP).
Last edited by pbear on Wed Apr 10, 2019 11:58 am, edited 5 times in total.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Tue Feb 05, 2019 1:20 pm

UEFI - rEFInd Method

If Unflag/Reflag makes you nervous, this option is foolproof and scarcely any more work. Only downside is that it uses tools and methods unfamiliar to most Linux users, unless you happen to be using rEFInd on your system already. Credit to fabien85, from whom I learned of the method, and rEFInd developer Rod Smith who had the initial inspiration (though he never developed it fully, as far as I can tell).

Overview. In sum, you boot the live session (can be UEFI or BIOS), install to the USB drive without a bootloader (using a special command) and then manually install a boot manager called rEFInd which doesn’t trigger the bug. Notably, rEFInd is installed only to the USB drive, not the internal, so the Windows system isn’t modified in any way. Be aware the USB drive will boot in UEFI only; if you want to be able to boot in BIOS also, use Hybrid Install.

Note: Like Hybrid Install, the simple “erase and install” method can’t be used here because we’ll be using a special partition scheme. Instead, we must use the Something Else method. I still recommend a root-only system, though, for beginners and flash drives.

Boot live ISO. Turn off screensaver, screen lock and display shutoff. Set up internet connection. Open Firefox, navigate to the Forum and open this tutorial for reference (as you’ll see, at the last stage, there’s a bit of complex code to copy and paste). Attach USB drive to which will be installing.

Partitioning. Open GParted. Will open with a box displaying partitions of sda, the internal hard drive. USB drives are accessed with a dropdown in the upper-right. Generally, if booting from USB, it will be sdb and the target USB will be sdc; if booting from DVD, the target USB generally will be sdb. From Menu, select Device: Create Partition Table: gpt type (the UEFI format); Apply (note warning). From Menu, select Partition: New. Set up two partitions: #1: 200MB (format fat32); #2: [remaining space] (format ext4). Apply. When complete, right-click #1; mark with boot and esp flags. Close GParted.

As mentioned, this is a simple partition scheme. If desired, additional partitions may be specified for home, data, etc. For LM18, which requires a swap partition (generally equal in size to RAM and formatted linux-swap), I put that in position #2 (moving root to #3) so I don’t have to worry about moving it later.

Installation. For this method, don’t use the desktop “Install” icon. Instead, open Terminal and type ubiquity -b. This will bring up the installer, but a version which doesn’t install a bootloader. Initiate install to target USB drive using the “Something Else” option. (Let installer unmount partitions when asked.) Select sdc2 (assuming the target is sdc); click Change; Use as: Ext4 system (but don’t tick format box) and select mount point as root (“/”) (which you can’t see until you’ve selected “use as”). If have set up a home partition, assign that mount point also. Unlike a regular install, because of the -b tag, there’s no option to designate a destination for the bootloader. Double-check not making any changes to the internal hard drive. Run install (confirm no format), selecting other options as preferred (see Installation Guide). When install completes, choose continue session.

Install rEFInd. In Firefox, open rEFInd download page and download “binary zip file” (currently, version 0.11.4); close Firefox. Open File Manager, navigate to Download folder and extract (unzip) package; close File Manager. Return to Terminal. Navigate to folder with unzipped files, e.g., cd Downloads/refind-bin-0.11.4/. Install rEFInd to the target USB drive with the following command (use copy and paste): ./refind-install --alldrivers --usedefault /dev/sdc1 (assuming, as mentioned, that sdc is the target); notice the period before /refind-install, without which the command won’t work; also, there’s a space between --usedefault and /dev/sdc1. Shutdown live session and remove live USB.

Post-Installation. Boot the newly installed system. You should get a rEFInd boot menu listing all installed operating systems on the USB drive and the internal drive (including Windows, if you have it). Toggle with arrow keys to select, then Enter to boot. rEFInd will hand you off to Mint (or Windows) and disappear. As mentioned for BIOS install (above), you may want to remove the system idle lock or extend the timeout with the Screensaver configuration app. Also, if booting on a Windows machine, run timedatectl set-local-rtc 1 so the USB drive won’t reset the system clock.

Note: To access backup kernels (installed but not active), press F2, Insert or Tab; use up and down arrow keys to select, then Enter to boot. If you’re familiar with advanced boot options in Grub, this is how you do the same thing in rEFInd.
Last edited by pbear on Sat Sep 28, 2019 11:27 pm, edited 4 times in total.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Thu Mar 21, 2019 1:21 am

Tips & Options

BIOS vs. UEFI? As mentioned, the simplest way to tell which your system uses is to go by its original Windows operating system. Win7 and earlier used BIOS.* (Technically, an early version of UEFI set to legacy mode.) Win8 generally used UEFI and all Win10 systems AFAIK. There are several ways to determine/confirm boot mode. In Windows, the simplest method is to run msinfo32. Press Win+R to open Run. Type msinfo32 into the "Open" field; click OK. A System Information report will appear. BIOS mode is line fourteen.

* I know of one case we've had on the Forum of a Win7 machine using UEFI, an HP sold just before the release of Win8. If you happen to have such a system, you don’t have to worry about the installer bug, as you don’t have an EFI partition. (Do confirm that in GParted, though.) Install per Unflag/Reflag, leaving out the unflag/reflag part, of course. You’ll end up with a USB drive which boots in UEFI only. Or you could force legacy boot of the live session and use Hybrid Install.

To test in Linux, boot the live ISO, open Firefox, navigate to this thread and copy the following command into Terminal:

Code: Select all

[ -d /sys/firmware/efi ] && echo "Currently in UEFI mode" || echo "Currently in Legacy mode"
Alternatively, run ls /sys/firmware (that’s a lower-case “L”; ls = list). If “efi” is listed, you are booted in UEFI mode.

BIOS/UEFI settings. These are discussed in the Installation Guide (linked above), but I will mention for emphasis. On both, it’s almost always necessary to modify boot order so the USB port is used before the internal drive. On UEFI systems, you generally can run the installer without disabling secure boot, but neither Hybrid Install nor Unflag/Reflag will boot under secure boot, as both those options are using the generic backup bootloader. Disabling secure boot isn’t a big deal, but does require administrative access to the firmware settings. If you want Mint to be able to access data files on the internal drive, also disable Fast Startup, a Power Option setting in Control Panel. By the way, it's not essential, but if you'd like to know more about UEFI, How-To Geek has a nice introduction. For a deeper look, see Rod Smith and Happy Assassin.

Take notes. Before starting the actual installation, I recommend highly that you create a word processing or notepad document for taking notes. Keep track of everything you do: every step, every setting you modify, every app you install and every app setting you modify. This document eventually will evolve into an installation script (in the non-technical sense), which everyone should have for whatever operating system they run. Into every life, a certain amount of reinstalling will fall. Don’t be afraid of reinstalls. Be prepared.

Persistence distinguished. To be clear, the procedures described above create a full install system which works the same as one installed the regular way to an internal hard drive. Persistence is something else, useful in some cases but not as complete, stable or updatable. It only became a “thing” because USB storage used to be limited in size and expensive. IMHO, persistence is now mostly obsolete. If that’s what you want, I’d recommend Pendrive’s UUI, sudodus’ mkUSB (about), or MultiSystem (about). Laurent85 has a tutorial using only standard Mint tools plus rEFInd, though it’s a bit advanced. Do not use the widely touted LinuxLive USB Creator; was last updated in Sept 2015, last worked with Mint 17.2, and has since been abandoned by its developer (see 2/3’s down page). I’ve also had trouble with YUMI (Pendrive’s multiboot app), UNetBootin and MultiBootUSB, but YMMV.

Encryption. I’m not a fan of system encryption, though I do use container encryption (Veracrypt) for the relatively small subset of data files I want secured. To install, run sudo add-apt-repository ppa:unit193/encryption, then apt update and apt install veracrypt. If preferred, home folder encryption is easily done - it’s an option on the same screen as where select user name and password - but entails a performance penalty. LUKS (full disk) encryption is faster, but only supported in the installer when using the simple “erase and install” method (select both "Erase" and "Encrypt," which also selects "LVM"). I’ve tested this for BIOS Install and Unflag/Reflag, and it worked for both. From various threads on the Forum, e.g., here, here, here and here, I believe LUKS can be done manually for the other options, but I’ve not seen a tutorial directly on point.

VirtualBox. If you want to be absolutely certain the install to USB drive can’t modify your main system, installing from VirtualBox will give you that. (Credit to Valsodar for reminding me of this option; see askubuntu.) Also, saves the effort of burning the source ISO to USB or DVD, as VBox will mount it directly to a virtual CD drive. This strategy is only worth the trouble, though, if you already have VBox installed and running, as the learning curve is substantial. Moreover, installation will take longer, which isn’t surprising as VBox tends to be slower than “bare metal” systems. Can run the installation from an existing VM (take a snapshot), but easier and safer to make a new one; allocate as much memory as feasible; don’t bother with a virtual hard drive (won’t be using anyway); insert source ISO to virtual CD drive; attach target USB to host computer. By default, VBox VMs boot in BIOS mode; if want to install in UEFI mode, select “Enable EFI” from Settings: System. Start VM, which will bring up a live session; turn off screensaver and display shutoff. From the VBox menu, select Devices: USB, then click target USB, which will be mounted to the VM (as sda if the VM doesn't have a virtual hard drive). Double-click installer icon and off you go. Can use the simple “erase and install” method (with or without LUKS) or Something Else. If using an existing VM, it generally will have been installed in BIOS mode, so there will be no EFI partition to unflag when installing to USB drive, even though you have temporarily changed the boot mode. When install completes, shut down live session. If created a bare VM as suggested, can be deleted now or retained for future use; if used an existing VM, roll back with snapshot. Boot USB to test, then do post-installation tweaks mentioned above.

Multi-Boot System. As mentioned, one good use for a USB hard drive is a test box with multiple versions of Mint and/or other Linux systems. Easy to do now, with external hard drives so large and cheap. Be advised that managing multiple Grubs is a bit tricky. What I find works best is to pick one OS as primary and plan not to change it. That becomes the primary Grub. Then, when installing other OSs, put their bootloaders on the corresponding OS partition. So, if installing Ubuntu 18.04 to sdc7, specify that destination for the bootloader also. Note: If have occasion to use Timeshift on one of the secondary OSs, untick reinstall of Grub or that OS will become primary. I’ve never tested multi-boot with the rEFInd Method, so don’t know whether it’s able to manage secondary systems without installing any bootloaders.

Data Partition. I’m not going to try cover this here, but it’s a good idea for multi-boot systems and preferred by some for single install. There are many threads on the topic. I found most useful this tutorial by gold_finger. FWIW, I like to put the Data partition early in the partition scheme, before the operating systems, so I don’t have to worry about moving it later, but that’s merely personal preference.

Backups. Bear in mind external hard drives fail the same as internal ones. And, as mentioned, full install will burn out a flash drive relatively quickly. The USB drive never should have the only copy of anything you care about. No drive should.
Last edited by pbear on Tue Sep 24, 2019 12:57 pm, edited 1 time in total.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
elvino1
Level 1
Level 1
Posts: 9
Joined: Thu Aug 04, 2016 9:25 pm
Location: Taveuni, Fiji

Re: Full Install to USB Drive: Four Options

Post by elvino1 » Mon Apr 15, 2019 6:43 pm

Thi is a superb tutorial, answering questions I have been struggling with since UEFI reared its head. Many many thanks pbear
Mint19, full install 128gb flashdrive

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Mon Apr 15, 2019 7:06 pm

You're welcome and thanks for the kind words. Remember, if you have a question, please open a thread in the Forums rather than post here. Good luck.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

wd0d
Level 1
Level 1
Posts: 3
Joined: Sat Apr 27, 2019 2:22 pm

Re: Full Install to USB Drive: Four Options

Post by wd0d » Sat Apr 27, 2019 3:09 pm

Great tutorial.

I had previously tried the first three methods, and was just as successful as I would have been performing self-administered root canals, but found the fourth method worked extremely well. I would add some minor clarification for the dinosaurs like me who might try this.

After downloading the rEFInd zip file, I went to the downloads folder and choose to extract it into that folder. What I should have done next was then click on the extracted folder and chosen to open it in a terminal window. Then used the "./refind-install --alldrivers --usedefault /dev/sdc1" to install the divers. What I did was something else, which resulted in me getting a rEFInd bootloader on my laptop main hhd. This is not a real problem but it does clutter things up. I eventually got it right and I'm good to go.

By the way, is it normal to get a lot of script after choosing to boot Mint and then again on shutting down the system?

Thanks again for a great solution to a perplexing problem.

Bob

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Sat Apr 27, 2019 10:34 pm

Sorry about difficulties with the first three options. I realize this would be easier with screenshots, but would take about a hundred of them to cover all options. That's not only infeasible, ultimately it would be even more confusing (I think). Regarding the rEFInd hiccup, in my defense, you skipped a step, "Navigate to folder with unzipped files, e.g., cd Downloads/refind-bin-0.11.2/." Anyhoo, glad you got it working in the end.

Lots of stuff flying by on screen would be normal for LMDE3, but not for any of the regular versions. If it bugs you, please open a thread on the Forums.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
farkas
Level 4
Level 4
Posts: 259
Joined: Mon Sep 21, 2015 6:10 pm
Location: Oregon

Re: Full Install to USB Drive: Four Options

Post by farkas » Sun Apr 28, 2019 3:24 am

Great tutorial pbear! Your responses helped me out several times. Thank you.

I'm wondering if its possible to install LM on an external HDD and plug it into any other PC other than the one which the install was performed on.
Portable external USB 3.0 HDD prices are reasonable, $30 USD to $50 USD for 250 GB to 500 GB HDD.

Because Win7 support is expiring early next year some friends were asking about Linux. I'm thinking about giving a them a Christmas present (maybe an early one) of a Mint installed on an external HDD ready plug in and go. Which option?
I understand that I'd have have to explain how to boot from USB.
Does widows prevent it? I don't know, haven't used it since it ended XP support.
They could check it out without interfering with their current OS. Running Mint on a live DVD or USB ISO not quite the the same as a fully functional install.
If they don't like it they can reformat it and use it for something else. Hopefully that won't happen.
If your query has been resolved, edit your first post and add [SOLVED] to the subject line.
If you found a solution on your own please post it.

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Sun Apr 28, 2019 11:56 am

Cool idea. My experience has been that a full install USB drive works fine on other machines, i.e., isn't tethered to the one used to create it. This is subject to the important caveat that neither machine needs a special graphics driver or other customization. Fortunately, Win7 vintage hardware seems to be well supported by the Linux kernel, but it's an issue you should keep in view.

As for which option, if I were doing this, I'd keep it simple. So, I'd use the BIOS method and give them a USB drive which boots only on their current computer. Or you could go clever and use Hybrid Install. Both will boot easily without the newbie understanding what's happening. OTOH, their partitions won't look like what they'll see in tutorials and blogs. OTTH, if you're going to be available to explain things, maybe that's not a big deal. Also, you want to do Hybrid Install if they're going to need to get a Win10 machine anyway (e.g., for work reasons).

As for Windows, it doesn't care tuppence about a full install USB. Doesn't even recognize it as a competing OS. On a Win7 machine, all you have to worry about is the BIOS boot setting. UEFI (Win8 or 10) is a little more complex. Secure boot should be okay, but sometimes needs to be disabled. Most sources say to disable Fast Boot, which is a UEFI setting that bypasses certain diagnostic tests. And they definitely want to disable Fast Restart, a Control Panel setting under Power Options, as that hibernates the internal hard drive, making it inaccessible to Mint. Again, none of these are an issue for Win7.

A few tips. Be sure to supply also a DVD or USB from which they can boot a live session. Needed for various system repair tasks. Go ahead and set up Timeshift for them. In particular, if you're giving them separate root and home partitions, set up Timeshift to save snapshots in the home partition. If it were me, I'd set up one of the data file backup apps (whichever you use, so they can get help). The absence of a good data file backup utility (the current one is pathetic) is the biggest hole in Ubuntu/Mint, IMHO. Last but not least, explain about the no-antivirus thing.

Hope it works out. Good luck.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

crlMIDI
Level 1
Level 1
Posts: 6
Joined: Mon May 09, 2016 12:34 pm

Re: Full Install to USB Drive: Four Options

Post by crlMIDI » Thu Jun 20, 2019 2:35 pm

I just tried the 'UEFI - Hybrid Install' option on a HP Elitebook 8740w, which has one of those transitional versions of UEFI. My disk (Mint Cinnamon 19.1, 32 bit, on an ancient hard disk with a USB adapter) booted OK, but the 'Install Linux' icon was missing. Based on information on the web, I installed ubiquity on the USB disk, but it crashed (a known problem in that situation).

Usually, I use balenaEtcher or Unetbootin to make bootable USB drives, because they they have always worked until today. For a change, I tried Rufus 3.5.1497. This has an tickbox to 'add compatibility options for old BIOS' (translation: Rufus speaks French on my computer). With the box duly ticked, the USB disk booted on the old HP and the installation proceeded as normal.

User avatar
pbear
Level 8
Level 8
Posts: 2191
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Full Install to USB Drive: Four Options

Post by pbear » Fri Jun 21, 2019 11:09 am

FYI, I'm taking a break from the Forum, so I won't be in a position to answer questions or respond to comments. On the other hand, everything here uses standard Linux tools, so other users should be able to assist if needed. (Bear in mind, I didn't invent any of this.) As mentioned in the OP, help requests should be made in the Installation Forum, not here. Before posting, read how to get help. Include a link to this tutorial so folks will know what you’re trying to do, provide an inxi output for your system with the target USB drive attached, and state whether the system uses BIOS or UEFI.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

nesti
Level 1
Level 1
Posts: 8
Joined: Tue Jul 02, 2019 9:48 am
Location: Luxemburg

Re: Full Install to USB Drive: Four Options

Post by nesti » Wed Jul 03, 2019 5:00 am

pbear wrote:
Thu Mar 21, 2019 1:21 am
I believe LUKS can be done manually for the other options, but I’ve not done it and haven’t seen a tutorial directly on point.
Some time ago i was trying to set up LUKS manually for the installation of Arch Linux. I was making myself a little challenge as I am normally using Linux Mint XFCE.

If anyone is interested, I can send/post a step by step list which I found some time ago and which I changed to my needs.

greetings

nesti

Post Reply

Return to “Tutorials”