Ubuntu on a pendrive

A little less than two years ago we wrote an article explaining how to create an Ubuntu Live USB with persistent storage. It is a good option if we want to take an installation USB with us and we want to save the changes we make, but it is not a complete operating system because it sometimes causes problems. Today we are going to show you how to install Ubuntu on a pendrive with persistent storage, but that pendrive will work like the same Ubuntu that we installed on the hard drive.

Ubuntu is not the friendliest operating system to do these things, or else ask a server that has also done it with Manjaro and the same installer does it for us. Some even recommend disconnecting the hard drive to avoid problems or make the installation process go better, but we are going to do it in a virtual machine, more specifically with GNOME Boxes.

Ubuntu on a pendrive as if it were a hard drive, but portable

Before you start missing screenshots, you need to know that there is a video demonstration at the end of the tutorial.

  1. The first thing we will do is go to ubuntu.com and download the ISO of the operating system.
  2. If we don’t have it, we install GNOME Boxes (Boxes in Spanish). It also works with VirtualBox, but in this case we have to install Guest Aditions as explained in this link.
  3. We open GNOME Boxes.
  4. We click on the plus symbol and then on «Create virtual machine» or «Create a Virtual Machine».
  5. We scroll down and choose the image file option.
  6. We choose the ISO that we have downloaded in step 1.
  7. We click on «Create» to start the checkout.
  8. We introduce the pendrive where we want to install Ubuntu.
  9. When it starts, we choose our language and “Try Ubuntu”.
  10. We click on the three points in the Boxes window and choose “Properties” (or “Properties”, depending on the language).
  11. We go to the devices tab and activate our pendrive. In my case it is a 32GB SanDisk Ultra Fit. The drive will appear in the Ubuntu GNOME Boxes. And, most importantly, it will be the preferred installation disk.
  12. We open GParted.
  13. We make sure that we have selected the destination pendrive and we delete all the partitions it has. Some may have to be disassembled first.
  14. We accept to leave the USB empty and unformatted.
  15. Once empty, we go to «Device / Create partition table».
  16. We choose “gpt” and accept by clicking “Apply”.
  17. Now we create a partition of no less than 512mb in FAT32.
  18. We confirm that the pendrive is left with a 512mb partition (at least) and the rest empty.
  19. We exit GParted and start the installer.

Installation process

  1. We click on «Continue», since it is assumed that we have already chosen the language at the beginning.
  2. We choose the language in which the operating system will be installed.
  3. If we wish, we check the box to install third-party software. What we do have to do is click on «Continue».
  4. And here the important thing begins. We click on «More options».
  5. In “Device where to install the boot loader” we choose our FAT32 partition. In my case it is / dev / sda1.
  6. We choose the free space and click on the plus symbol (+).
  7. We leave it in «transactional ext4 filesystem» and in «Mount point» we choose the root, which is the «/» symbol. Click on «OK».
  8. We click on the partition «FAT32» and then on «Change».
  9. In «Use as:» we choose «System partition« EFI ». Click on «OK».
  10. Now we click on “Install now” and accept the message by clicking on “Continue”.
  11. We continue with the personal configuration, starting with the time zone.
  12. We configure our username and password.
  13. Now we have to be patient. On my computer, the installation takes more than an hour.
  14. Once the installation process is finished, we can exit GNOME Boxes and delete the box that will have been created.
  15. We put the pendrive in a PC and start from it.

Oh oh … this doesn’t work …

  1. As soon as we start from the recently installed Ubuntu on a pendrive we will see an error message, but that it is creating an EFI file. We wait a moment.
  2. Once the EFI file is created, it shows us some bugs. We accept them by pressing any key.
  3. We will see the GRUB. We started … but it does not go.
  4. Now all we have to do is try again. The second time we start everything will go as expected. Well, not at the beginning; The first few times it is very slow, but performance improves with use.

That same pendrive can be used on any other PC, but the settings, such as the sensitivity of the touch panel, is something that we will have to re-adjust every time we change equipment. It is not the most elegant way for what happens in the end, but it is the safest and, most importantly, it works.