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.
- The first thing we will do is go to ubuntu.com and download the ISO of the operating system.
- 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.
- We open GNOME Boxes.
- We click on the plus symbol and then on «Create virtual machine» or «Create a Virtual Machine».
- We scroll down and choose the image file option.
- We choose the ISO that we have downloaded in step 1.
- We click on «Create» to start the checkout.
- We introduce the pendrive where we want to install Ubuntu.
- When it starts, we choose our language and “Try Ubuntu”.
- We click on the three points in the Boxes window and choose “Properties” (or “Properties”, depending on the language).
- 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.
- We open GParted.
- 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.
- We accept to leave the USB empty and unformatted.
- Once empty, we go to «Device / Create partition table».
- We choose “gpt” and accept by clicking “Apply”.
- Now we create a partition of no less than 512mb in FAT32.
- We confirm that the pendrive is left with a 512mb partition (at least) and the rest empty.
- We exit GParted and start the installer.
Installation process
- We click on «Continue», since it is assumed that we have already chosen the language at the beginning.
- We choose the language in which the operating system will be installed.
- If we wish, we check the box to install third-party software. What we do have to do is click on «Continue».
- And here the important thing begins. We click on «More options».
- In “Device where to install the boot loader” we choose our FAT32 partition. In my case it is / dev / sda1.
- We choose the free space and click on the plus symbol (+).
- We leave it in «transactional ext4 filesystem» and in «Mount point» we choose the root, which is the «/» symbol. Click on «OK».
- We click on the partition «FAT32» and then on «Change».
- In «Use as:» we choose «System partition« EFI ». Click on «OK».
- Now we click on “Install now” and accept the message by clicking on “Continue”.
- We continue with the personal configuration, starting with the time zone.
- We configure our username and password.
- Now we have to be patient. On my computer, the installation takes more than an hour.
- Once the installation process is finished, we can exit GNOME Boxes and delete the box that will have been created.
- We put the pendrive in a PC and start from it.
Oh oh … this doesn’t work …
- 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.
- Once the EFI file is created, it shows us some bugs. We accept them by pressing any key.
- We will see the GRUB. We started … but it does not go.
- 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.