What is root partition in linux

What is Root Partition in Linux? [A Complete Guide]

The root partition in Linux is the most essential part of the system. Therefore, as a Linux operating system user, you must know about root partition. In this article, I will demonstrate a complete overview of what is root partition in Linux.

What is Root Partition in Linux?

The root partition has prevailed since the installation of the Linux operating system. Generally, it consumes a fixed amount of the disk partition, and it is recommended to allocate enough disk space to the root partition.

Significance of Root Partition

  • Filesystem Hierarchy: The root partition is the topmost directory in the filesystem. It contains all the files and directories of the operating system.
  • Booting: It is necessary for the boot process to start up the operating system.
  • System Files: The root partition contains many critical system files including the configuration files for system services, device drivers, and libraries.
  • User Data: It stores temporary files and system logs.
  • System Upgrades: System upgrades may fail due to a shortage of enough space on the root partition to store the upgraded files.

Contents of Root Partition

The contents of the root partition usually include the following:

  • Boot files: This directory contains the boot loader, kernel, and initial RAM disk, which are necessary for starting up the system.
  • System Directories: The root directory contains directories such as /bin, /sbin, /lib, and /usr, which contain important system programs and libraries necessary for the system’s operation.
  • Configuration Files: These files are typically stored in directories such as /etc and are used to configure systems and applications.
  • Temporary Files: This includes the /tmp directory. The /tmp stores the temporary files. These files are typically deleted when the system is rebooted.
  • Log Files: The /var/log directory stores these kinds of files to track system errors and events.

Example: Checking the Disk Space of the Root Partition

You can easily check the disk space of the root partition using the df command in Linux. Here, I will check the disk space of the root partition of my system. To do so, follow the below procedures.

Steps to follow:

➊ Open the Ubuntu terminal.

➋ Then, copy the following command into the terminal

➌ Now, tap the ENTER button.

The df command with -h option has printed the disk space.

The image shows that I have printed the disk space of the root partition using the df command in Linux with the -h option.

Conclusions

In this article, I have tried to discuss the root partition. And demonstrated some examples associated with it. By going through this article, you have gained the skill of finding necessary files or directories inside the root partition properly.

Similar Readings

  • What is Root User in Linux? [A Complete Guide]
  • What is Sudo in Linux [A Detailed Review]
  • What is Root Directory in Linux? [The Ultimate Guide]
  • What is Root Access in Linux [With Practical Examples]
Читайте также:  Linux kernel install dir

Источник

DiskSpace

The goal of this page is to offer advice and strategy on partitioning a Linux system.

Required partitions

Overview

The easiest partitioning scheme, on a non-GPT disk, is simply a root partition and a swap partition.

If the disk is GPT type (this can be checked via the «sudo parted -l» command), you must also add a BIOS-Boot or an EFI partition depending on the boot mode of your BIOS.

On some computers, a separate /boot partition may also be required.

Root partition (always required)

  • Mount point: /
  • Type: Linux type (generally EXT4)
  • Description: the root partition contains by default all your system files, program settings and documents.
  • Size: minimum is 8 GB. It is recommended to make it at least 15 GB. Warning: your system will be blocked if the root partition is full.

Separate /boot (sometimes required)

Some computers can’t see boot files (/boot) if located far (>100GB) from the start of the disk. This is why it is sometimes necessary to create a separate /boot partition at the start of the disk. Remark: don’t use the same /boot for several Linux distributions, as it may mix up their kernels. See this tutorial if you want to create a separate /boot after installing Ubuntu.

BIOS-Boot or EFI partition (required on GPT disks)

If you want to install Ubuntu on a GPT disk (you can check it via the ‘sudo parted -l’ command), you will need either an EFI partition (if your BIOS is set up in EFI mode) or a BIOS-Boot partition (if your BIOS is set up in Legacy mode).

  • Mount point: none
  • Type: no filesystem
  • Description: the BIOS-boot partition contains GRUB 2’s core. It is necessary if you install Ubuntu on a GPT disk, and if the firmware (BIOS) is set up in Legacy (not EFI) mode. It must be located at the start of a GPT disk, and have a «bios_grub» flag.
  • Size: 1MB.
  • Mount point: /boot/efi (no need to set up this mount point as the installer will do it automatically)
  • Type: FAT (generally FAT32)
  • Description: the EFI partition (also called ESP) contains some boot files. It is necessary if the firmware (BIOS) is set up to boot the HDD in EFI mode (which is default on more and more modern, > year 2011 computers). It must be located at the start of a GPT disk, and have a «boot» flag.
  • Size: 100~250MB

Optional partitions

Optionally, some other partitions can be created for specific usages. Be careful, these partitions reduce the flexibility of your disk space, they must be considered only if you are sure not to fill completely your root partition (which would block your system).

Partition for sharing data with Windows, MacOS. (optional)

  • Mount point: /media/thenameyouwish
  • Type: to share data with Windows, choose NTFS. To share data with MacOS, choose HFS+. To share data with another Linux system, choose EXT4.
  • Description: other operating systems (Windows, MacOS..) cannot read nor write in the Ubuntu partitions, but Ubuntu can read and write in any partition. If you want to share files between Ubuntu and the other systems, it is recommended to create a data partition. It is not recommended to share files directly into the Windows system partition (eg files may be overwritten by hibernation).
  • Size: as you wish
Читайте также:  Remote file system in linux

Separate /home (optional)

  • Mount point: /home
  • Type: Linux type (generally EXT4)
  • Description: see HomeFolder. When your hard disk is big enough, a separate /home allows to separate your settings (and also your data if you don’t use a data partition, see previous paragraph) from the rest of the system. A separate /home does not allow to share data with Windows nor MacOS (see previous paragraph).
  • Size: as you wish

More Complex Schemes

For more information on what various directories are used for, see The Linux Filesystem Hierarchy.

More complex schemes could involve creating a separate partition for any number of the default folders used by Ubuntu. System critical folders are important to protect, and since drives, and / or partitions do fail, it is often useful to have your file system broken down into as many small parts as possible. This can be over done however. Installing every core directory to its own partition could cause a noticeable degradation of performance.
Bearing that in mind, the following directories should NEVER be placed in their own separate partitions:

Note about /sbin

It can be argued, and reasonably so, that moving this directory to its own partition is a wise choice. If any of your partitions or drives should fail, then this directory / partition will be the one that most likely contains the tools you will need to repair it. So while moving this would decrease performance marginally, it could also be considered a wise move.

Sizes For Alternative Schemes

On a six month old installation of Ubuntu 10.04.3 LTS the disk usage could resemble something like this: (examples taken from my own system with many extra packages installed)

The above recommendations assume you are using large modern hard drives and can afford the space.

Space Requirements

Absolute Requirements

The required disk space for an out-of-the-box Ubuntu installation is said to be 15 GB. However, that does not take into account the space needed for a file-system or a swap partition.

It is more realistic to give yourself a little bit more than 15 GB of space. Give yourself 15-25 GB to have some space left for actually doing things. If your file-system is full to the brim, you will feel some performance loss.

A certain percentage of an ext3 file-system is dedicated to root, as a way of preventing a rogue process from filling the disk to the point that the system is unusable. This dedicated portion is 5% by default. Also, the anti-fragmentation strategies used by Linux file-systems require that the disk is not close to full. A rule of thumb is to keep them less than 90% full.

Installation on a small disk

(This section is out-of-date & may need research for sizes) During a normal install, the installer copies the packages from the CD to the hard drive (in addition to actually installing them). If you are short on disk space before you install, you can tell the installer not to use extra disk space. The packages take up about xxx Mb. You will be able to install a full Ubuntu system with less than xx GB of hard drive space.

At the installation prompt (just after you boot from CD) type:

linux archive-copier/copy=false

DiskSpace (последним исправлял пользователь ckimes 2017-09-02 19:35:04)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Читайте также:  Linux заархивировать папку gzip

Источник

How To Resize The “/” (root) Partition In Linux?

A partition is nothing but a logical division of a physical disk. Partition makes it easy to organize and share the data of that disk. You can edit or manipulate these partitions for various purposes.

For example, it is useful while sharing files on a network you can share the data of a partition without worrying about the data of other partitions. Similarly, You can install multiple operating systems on a single physical drive, by dividing it into multiple partitions. Different partitions can be formatted into different filesystems.

Linux root partition by default, contains all the system files, program settings, and documents. Ahead in this article, we will see more about it.

What is the root partition in Linux?

A root partition always required for installing Linux OS. “/” is the mount point of the root partition. The root directory in the Linux filesystem hierarchy is the starting point for all other mount points or the ramdisk etc.

By default it contains all the system files program settings and documents etc. In Debian and align distributions, it is recommended to use at least 15GB of space for the root partition.

It may vary for different Linux distributions. Linux partitions including root partition generally use an ext4 filesystem. If you assign less amount of space to the root partition it may full after some time then you will have to expand its size later.

Resizing the “/” Root partition using GParted

Gparted (also known as GNOME partition editor) is a free partitioning tool. This is a GUI application that uses GNU parted in the backend. Gparted is used to create, delete, or resize a partition without data loss.

Apart from this, it offers many other functionalities such as mirroring one partition with others. By using Gparted in a live OS we will able to access all the features. This way we can use tools for any other partition which contains a different OS like windows or mac. Now if you want to resize a partition use the following steps.

How to resize a partition, step-by-step guide

sudo apt-get install gparted
  • Launch the GParted tool from the menu. Click on the drop-down menu given at the upper right corner which is highlighted in the red. And select the hard drive where the partition is located. Look at the image below-
  • Next, select the partition from the list that you want to resize. And click on the resize icon for resizing your partition. See the image below the Resize icon is highlighted in the red –
  • Once you select a partition and click on resize, a new resize window will open. Now fill the new size of the partition in MB and then click on the resize button.
  • Now click on the icon highlighted in red to apply all operations this will make the changes permanent.
  • [alert color=”green”]Once it gets successfully applied, reboot your system and remove live USB. Now you can boot into the newly installed OS on your hard drive.[/alert]

    Conclusion

    There are other methods also available by which you can resize a partition, for example, you can use Gparted live. I may consider to cover the GParted Live in a new article.

    I hope this article is useful to you and if you have a query or suggestion related to this article then write us in the comments below.

    Источник

    Оцените статью
    Adblock
    detector