How To Install Linux from USB Stick.

If you install Linux on a USB drive, you will be able to use it on any computer that can boot from USB drive. Use a fast USB drive, and preferably one that can operate on USB 3 (These can also operate as USB 2 if necessary.)

There are two levels of installation onto USB drives:

(1) Linux Live

(2) Installed.

If you are going to use this frequently and for extended periods then go to level (2) Installed. That way you will be able to use all the space on the drive for applications and data. Linux Live is mostly for short term activities, such as testing out hardware compatibility before a full install and then installing for real.

You have to start with level 1.

  1. Download the distribution’s ISO image.

2. “Burn” the ISO image to the USB stick. A 4 GB stick is fine. Use unetbootin or something similar that makes the USB device bootable. This is your Live USB stick.

3. Boot the Linux Live USB stick. If you only have one USB 3 port, put this in a USB 2 port.

4. Leave the Live USB inserted. Insert the target USB device into another USB port, preferably a USB 3 port if you have one.

5. Use a disk management utility or command line commands to see what the devices id’s are for all the attached disks. command-line utilities include:

  • df
  • lsusb
  • sudo lshw | less

Your hard drive might be /dev/sda, the boot drive /dev/sdb, and the target for the installation /dev/sdc. Write down whatever is your reality..

6. Use the Live install’s application to install Linux onto the installation target USB. The partitions on it will be /dev/sdx1, /dev/sdx2, where x matches your situation.

DO NOT INSTALL ONTO THE LIVE BOOT USB DRIVE.

DO NOT INSTALL IT ONTO THE COMPUTER’S INTERNAL DRIVE.

Decide if you want or need a swap partition on the USB device. If you will be using the stick on computers with inadequate memory, then definitely allocate 4 or 8 GB on the stick for a swap partition as part of the installation process.

If installing onto a 128GB stick, I would partition it as follows:

/dev/sdx1 30 GB FAT32 for /sneakernet

/dev/sdx2 60GB EXT4 for /

/dev/sdx3 30 GB EXT2 for /home

/dev/sdx4 8 GB SWAP

That way Windows machines could also read files I create or copy to /sneakernet.

You may have the option of formatting the installation partition as EXT2, EXT3 or EXT4. Be aware that EXT4 is safer, but slower and will wear out the flash memory sooner. Almost the same for EXT3. EXT2 is faster and has less worn, but not as safe, especially in case of crashes, removal without unmounting, incomplete shutdown, and power outages. If you use EXT2, it is recommended that you use fsck at least weekly or after anything bad happens. My SDCard USB adapter’s plug is a bit loose, so I use EXT4.

Keep the Live stick around as well, especially if you use EXT2 for the installation.