What partitions does Ubuntu need

ubuntu partitions

Whenever I get ready to write an article like this I remember my first years in Ubuntu. To be completely honest, in my pre-Linux life I think I had reinstalled Windows 98 once and formatted another XP, so the partitioning thing for me was something to split up, I don't know, pies and stuff. Soon after, my Linux mentor told me something to the effect that if he wanted my data to be safe and not lose it after doing something extreme, it was worth separating things. I know that many of you ask yourself the question of what partitions you need Ubuntu, but I think that the first thing we have to do is differentiate between need, require and what would be advisable.

Another thing to keep in mind is which partitions we as users have to worry about. For example, if we are going to install the operating system taking up the entire hard drive, I'd say we have to worry about one or none. Ubuntu will take care of everything so that the system can load the kernel, then the operating system, and finally the user interface. The thing is if we want something else, whether it's different possibilities or knowing what does what. Here we are going to try to explain some things about the partitions of Ubuntu, although it is valid for any operating system based on Linux in general.

Partitions needed for Ubuntu (and any Linux) to work

Although if we want to occupy the entire hard drive we only have to think of one, we actually need two. one of them will be the /boot, the EFI, where everything necessary for the computer to start will be installed. When the operating system creates it automatically, it usually has a size of about 300MB, and its position is the first of all. Its format is usually FAT32, and you have to be very careful when touching anything on this partition or then you will have to come to this or another specialized blog if you want to recover the GRUB or the information on the hard drive.

The other partition that is mandatory to have is the root (/). If we do not make any more partitions, everything will go to the root, both the operating system files and the configuration files, among which will also be those of the personal folders of all the users who have registered on the computer.

If your doubt was this, what partitions were necessary for it to work Ubuntu for whatever reason, the article no longer has anything more interesting for you. In the case of looking for something else, in the next section we explain something more interesting, specifically what the first person who taught me something about Linux told me.

root, /home and /swap

When they explained that to me, the boot partition was omitted from the information, partly because it installs itself (if it already existed) when we chose a drive and we don't have to do anything, but they told me about these three. The reason is very simple, a kind of divide and conquer, or divide and you will not lose, or you will lose less.

If one wants to do distro-hopping on Linux, and the distributions are not so different that it might be a problem to keep some changes, it is worth having the folder /home separated from the rest. In /home will go the personal folders of all the users that have registered in a team, and each one will have their documents and configuration files. The idea is that these files are not lost after reinstalling, and if what we are going to reinstall is exactly the same operating system that we had installed, by not formatting the /home partition we will have almost everything in its place.

When we reinstall without formatting the /home partition, the operating system may show us some error messages, such as when it is not able to install the applications that we had installed during the process. But the good thing is that the configuration files will be in the folder, so when installing a program that we had installed before reinstalling, the configuration will be as it was.

For example, if you do like me, that in GIMP I leave the left panel of a single strip and you have saved templates, when you reinstall the system and reinstall GIMP all that will be in its place. If we have Visual Studio Code with a lot of settings or the fully customized browser, everything will be back to how it was before we had the problem that made us decide to restore.

About the /home partition: don't underestimate it

One may think that the /home partition is not important for the operation of the operating system, and they would be partly right. But I tell you that it only leaves. Some time ago I verified it myself: I had a SSD disk of 128GB and a hard drive of 1TB, and I thought "if there are only data and documents in /home, then I put it on the hard drive". It seems like a no-fault conclusion, but the performance difference will be noticeable, and a lot. Everything seems slower, and things get worse if we create a virtual machine. Being on a hard drive, it has a hard time moving.

If we have space, the /home folder also has to be on the SSD (if we have). If it turns out that we have a lot of space on a hard drive, then we can leave documents such as the music and movies, and create symlinks to the Music and Videos folders in our personal folder. Since only documents have to be read, the speed is not greatly reduced, I tell you from experience.

The /swap area: a little oxygen

It may be a personal impression, but I think that over the years there is less and less talk about the partition /swap. Many years ago, when we had computers with 1GB of RAM, things were different, but now, when any weak computer already has 4GB of RAM, it is not so necessary. Not so much, but it can come in handy.

The swap partition in Linux is an area of ​​the hard drive that is used for temporarily store memory that is not actively used in RAM. When RAM becomes full, Linux uses the swap partition to free up space in RAM to allow the system to continue running. This partition can also be useful in situations where a large amount of memory is being used, such as when running memory-intensive applications or when doing work in the data science field. Or something more at the user level, when pulling graphic software, like a video editor. In these situations, a swap partition can help ensure that the system does not run out of memory.

For another thing that is essential is to hibernate the computer, to the point that the option to put it into hibernation disappears (or rather does not appear) on some computers if the necessary amount has not been left.

The swap partition is created or must be created during the installation of the operating system, and is usually located in a separate file from the main file system. The swap partition can also be a file on the main file system, although this is not recommended as it can slow down the system.

And how much should be left to this partition? I think if you throw that question in a linux bar, there will be a fight. I have heard of everything, and all different. In general, it is recommended that the swap partition have at least twice the size of the installed RAM in the system. For example, if your computer has 8 GB of RAM, it is recommended that you have at least a 16 GB swap partition.

It is important to note that although the swap partition can be useful in some situations, it should not be viewed as a solution to a lack of RAM. If our system is using the swap partition frequently, the best we can do, if possible, is to increase the RAM.

The root: … the root of everything

The root is in where should the entire operating system go. It is like C: in Windows, where everything is installed and, from it, the rest. In the root partition (/) is where we will find the most important folders and with which we have to be more careful, such as /bin and /etc.

About the size that should be left, it is a little opinion of each one. Mine is that it is not necessary to leave a lot of space, because programs in Linux, unless many snap and flatpak packages are installed, are usually small (complemented with shared dependencies with other programs). ubuntu it can be installed perfectly in 20GB, and we could install quite a few programs until our root ran out of space. Because here we are talking about a case in which the /home folder is separated, and it is in /home that the largest files will be, among which there will be music, movies and games that can be in ISO format.

Now, if you were to ask me how much to leave at least, I would say just double, about 40GB so that more than 30 remain free after installation.

How to create partitions in Ubuntu

I know there are people who will still say that more partitions are needed, and maybe on other file systems, but I think that with these three we would have it well. If anything, also talk about, if we have space, leave a partition for data in the form of a backup, and the size to give it will also depend on the needs of each one. Of course, we must choose the format well: EXT4 is the native and most used in Linux, but BTRFS is what will be used in the future and if we also want to use it with Windows (dualboot), what we will have to do is format that partition as NTFS or ExFAT.

Having explained all this, the way to create the partitions in Ubuntu must be done during the installation. In the step where we see "More options", we choose that and we will enter a kind of partition manager.

6.2-Something-else

If the disk is empty, we click on the plus symbol at the bottom left and create the partitions. As explained here, we should leave it like this:

  • /boot/efi: 300mb size and formatted in FAT32. With the right click we have to mark it as a boot partition. At the mount point we will see just /boot/efi, or something similar, since it can vary from one installer to another.
  • / (root): the size, if possible, has to be above 30GB, which although it is true that they may not be necessary, it is also true that it is better to be safe than sorry.
  • / Home: the personal folder to which we will leave the necessary space to save all our documents. And be careful using a hard drive.
  • /swap: the exchange area, what the system will use to breathe when it cannot cope with the task we are asking it to do. It is also where a session will be temporarily saved if we hibernate, so it is recommended to leave at least half of our physical RAM.

As for /home and root, they can be formatted or not; If we want to keep a previous configuration, /home must be left unformatted.

And this would be all. If done like this, reinstalling will never be a problem.


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.   octavio said

    Very good article, it clarified some doubts that I had, greetings

  2.   Carlos said

    Perfectly explained. Clear and concise. Congratulations.

  3.   we said

    These days I was installing a pop_os, I put 512MB in it and it won't let it, then I read that it recommended 1GB and it stayed (for about the 2 days I used it, I didn't like it).

  4.   Jose Gabriel said

    Greetings, please, I am looking for the steps to partition, there is an article that mentions that, but it does not tell me the format in which the basic partitions should be, it only says that ———»»»> the first one is in FAT32, but the others I don't know if they are EXT or other formats....can you clarify...————-»»»»»»»»If the disk is empty, we click on the plus symbol at the bottom left and we create the partitions. As explained here, we would have to leave it like this:
    • /boot/efi: size 300mb and formatted in FAT32. With the right click we have to mark it as the boot partition. At the mount point we will see /boot/efi, or something similar, since it can vary from one installer to another.

    1.    Diego German Gonzalez said

      Hello. If the disk is empty, it is best to let the installer do its job automatically. Anyway, regarding your question, the other partition is Ext4