How to install a full Ubuntu on a pendrive (not Live)

Complete Ubuntu on a pendrive

At the end of March we publish an article in which we explain how to create an Ubuntu Live USB with persistent storage. For testing or as a recovery tool that keeps the changes going very well, but the performance is not as good as we would like. Also, not everything is updated as it should because the configuration is not the same as a full installation. In this article we will explain how to install a full Ubuntu on a pendrive as if it were a hard drive.

Until recently, if I remember correctly, Ubiquity didn't do as well as it does now. When installing the operating system on a pendrive, I moved the / boot (or EFI) partition to the USB, which meant that the PC would not start without the USB connected. In addition, it did not work at all well if we used it on other computers. Apparently all of this has changed and now can be installed without problems and used on any other PC. Of course, the first step that I would do would be to avoid some problems of this type: unmount the hard drive from Nautilus. On the other hand, I would like to make it clear that this is something that can happen, so I would create a Live USB with the operating system that I have on my PC to reinstall it (without formatting), so that it can happen.

How to install Ubuntu on a USB

Requirements

  • A pendrive to install the operating system. 8GB should be sufficient.
  • A pendrive to create a Live USB. I have come to put the ISO in 2GB, but 4GB is recommended.
  • A little while.

Installation process: preparing the USB

  1. We downloaded the ISO of an Ubuntu-based operating system. For example, Ubuntu 19.04 Disco Dingo.
  2. We create the Live USB. We can do it with UNetbootin or with the boot disk creation tool.
  3. We start from the pendrive that we just created.
  4. We choose the language and click on "Try Ubuntu".
  5. Now we have to partition the pendrive where we will install Ubuntu. To do this we insert the USB and open GParted.
  6. This is the most important step. We take a good look at which disk we choose and choose the destination pendrive. This is usually / dev / sdb or sdc. In my specific case, with an SSD + HDD hybrid hard drive, it is sdd.

Gparted

  1. We delete the partitions with the right button and choosing «Delete». Then we add a partition to it and choose "Clean". The color of the partition will be black.
  2. We click on the green V to apply the changes.
    • From step 5 to 8 we can also do it with the Ubuntu disk tool, from where we would also create the partitions. If we do it in this second way, the installation process will be different, since we will not have to create the partitions.
  3. We accept the warning message by clicking "Apply".
  4. Once the changes have been made, we click on «Close».
  5. We left Gparted.

Installation process 2: installing Ubuntu

  1. Now we start the installation program.
  2. We select the keyboard layout.
  3. We select the type of installation. I recommend the normal installation, but we can choose the "minimum" if we want to avoid installing all the software that Ubuntu brings by default.
  4. In the type of installation, we choose «More options».

More options

  1. We choose the destination USB. As we have mentioned, it is usually / dev / sdb or sdc, in my case sdd.
  2. In my case, "sdd" has nothing. We right click and select «New partition table».

Installing the system

  1. We select the partition that says "Free space" and we click on the (+). We will have to do it twice (on the empty space) and create:
    • A FAT32 partition for the / home folder. IMPORTANT: the FAT32 partition must be sdX1, different from what you see in the screenshot.
    • An EXT4 partition for the operating system (/). 5GB would be the most recommended. I have given it 10 because my pendrive is 32GB and I do not want to be short with the tests that I can do in the future.
    • Swap partition, something that we can omit if our computer has enough RAM. With 8GB on my pc, I don't believe it.
  2. At the bottom, on the startup device we choose our USB. BEWARE OF THIS: GRUB may change and the main system may stop startingr. We can choose our hard drive to start, in which case you will not be able to start from the pendrive on another computer.

Partitions to install Ubuntu

  1. We click on "Install".
  2. We choose the area.
  3. We choose our login details (name, password, etc).
  4. We wait and, when the installation is finished, we will have a complete Ubuntu on a pendrive.

What we gain by performing a complete installation

Live sessions do not take advantage of all the resources of a team. Although we start by choosing the option to take advantage of RAM, it is not the same. Performing the complete installation we will have an operating system as if we had installed it on the hard drive. Also, since we are using Flash memory, the performance will be more than decent.

Have you already installed your full operating system on a pendrive? What is your chosen one?


12 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Cesar Peralta said

    Hahaha I did it on a USB hdd

    1.    Victor Rodriguez said

      Hi Cesar, he did not let me create a fat32 partition ... I had to create two Ext4 partitions, and so he did let me install the OS, but he did not let me start it. I don't know if it's because of that.

    2.    Gabriel said

      I would like to know how to protect the pc that does it, so imagine doing it on a friend's pc because yours does not have much usb and it does not give you to live and the installation ... and then it turns out that you have your Ubuntu usb and he stays without it working ... I don't know if it protects itself by unmounting the disk ...

      1.    July said

        Maybe you miss the 100 megabytes for the efi partition and tell him what grub goes on that disk

  2.   Victor Rodriguez said

    Hi, for some reason it doesn't allow me to create the fat32 partition. It just let me install Ubuntu by putting 2 Ext4 partitions. But I can't boot from USB.
    Some clue?

  3.   Alexander H said

    It would not be better to free this from installing it on a USB and that we could have an OS to test it completely and that installing it on the hard disk is a tool in this type of Operating Systems.

    Why couldn't it be?

    since it is very difficult to do this installation.

    1.    July said

      I do not understand you, although this system can be installed as live on a usb, it is always also possible to install it on a normal hard disk or hard disk as you do with windows, what it is about here is to install it on a usb not as live but fixed as if it were a hard drive.

  4.   Oscar said

    It is very poorly explained, incomplete and erroneous instructions.

  5.   July said

    I tried to do the same in kubuntu since my hard drive petó and I have this 2Tb Chinese usb but it does not accept the fat32 partition for the / home so I corrected it and put it in ext4 it reaches 33% of the operation but after a while get a warning stating that you can not ride /

  6.   pancenu said

    I have installed linux on a USB for a few years, the lifetime of the flash drives has been reduced (they don't last long), if they are constantly being rewritten, (in the first ones I had dropbox installed, due to the handling of the dates, sometimes i synced everything, being really unnecessary now i use rclone) so, it is recommended to disable journaling, avoid swap partition first i used crunchbang, when it was discontinued i decided on lubuntu (I have it installed on a 1TB external mechanical drive) . I recently bought a 64 GB memory to install a new one and be able to take it with me on a trip, very convenient due to the authentication systems that can ask for cell phone codes to which I will not have access, but I am reconsidering the distribution of linux that I want to have installed ( I didn't like some of the ubuntu updates). I don't remember exactly how I dealt with the EFI partition, but I had no problem with creating it, in the first few times I could remove the hard drive from the computer so as not to put the PC at risk, now that they say they have had problems I will choose to use an old laptop with damaged hard drive.

  7.   Joana DiAlexandria said

    It is not well explained at all. Live usb with persistence and installation are two completely different things. The Live USB doesn't create an OS entry for you and can be used on any computer without a trace (as long as you don't mess with its hard drive). The installation forces you to use GRUB yes or yes.

    If you're lucky that unmounting the host hard drive doesn't touch the Windows installation and force its grub on you, you still face another problem. Ubuntu will only work on that machine not the others. So if for example you have an Asus with 16GB RAM and nvidea card and then you want to use that usb with Ubuntu on an ATVIO with only 4GB RAM or a Lenovo or an Acer or HP, most likely your Ubuntu won't boot.

    It is possible to solve that from the console, with a lot of free time and having access to the Internet from another pc or laptop or even from a mobile, but if that is not your case, you simply will not be able to start unless you already know what to do, and If this has never happened to you before, you probably have no idea what to do.

    There are distros that are already designed with the purpose of being "live" from the beginning, such as Puppy Linux, this distro if you know how to use it despite being based on Ubuntu, it does not mess with your Windows installation and you start perfectly, you can install things to the distro, everything you do on it is recorded and you can use it on many different PCs.

    Tails is another distro that does not usually mess with your Windows installation either and you can use it on many different machines and everything you install and do is saved. LibreElec installed on a USB is the same, it doesn't mess with your Windows installation.

    I recommend distros that are of that type, that are oriented to be used from a USB on several different machines without forcing you to install their GRUB. Ubuntu unfortunately is a distro that has the ugly habit of messing with your Windows installation, it will force you to use its GRUB.

    If you install GRUB on the hard drive, every time you boot it will ask you which operating system to choose. The problem is that you will not be able to use that Ubuntu on another PC, it will not start on another because its GRUB is linked to that hard drive.

    If you have the EFI partition and the GRUB installed on the USB in theory you can boot on other PCs, in practice you may experience some difficulties such as running out of graphical environment, no sound or no wifi, if you solve it no matter what, make sure you don't delete nothing with sudo apt-get autoremove or you will probably have to reinstall things when you return to another pc where you used it before. As for the EFI sometimes you move it without asking the USB even if you unmount the hard drive from the beginning, if that happens to you you will have to investigate how to reverse that and put it back where it was, good luck with that, you will have to do a lot of reading. It is one of the risks you run for wanting to install Ubuntu, you must accept it and take responsibility for it.

    As I said before, there are distros that are designed to always be used from USB, I recommend using those distros instead of using distros designed to be installed on the hard drive coexisting with Windows. Those distros designed to be used from a USB do not impose GRUB on you, they can be updated, customized and installed packages, they do not have the limitations of an Ubuntu Live with persistence because they are precisely optimized for that purpose, while Ubuntu is not designed for that purpose , Ubuntu is intended to occupy the entire hard drive or be installed along with Windows or other distros on the hard drive, not to be used incognito from a USB.

    1.    patricia said

      hello I have problems installing the linux mint iso on another pendrive with the partitions already created, do you know where I can find more information, the grub installation fails me at the end