Linux раздел boot размер

This article explains the recommended size for the boot partition on Debian 11 and other Linux distributions.

The smart way to install Linux requires the user to partition the disk, mainly to isolate possible future problems in each partition. The directory containing vital files for the boot process is part of this partitioning. In such a scenario, before a boot problem related to files located under /boot, the user can reinstall the partition keeping the rest of the system untouched. Another reason to dedicate the /boot directory to its own partition would be the use of encryption methods. If you encrypt your / (root) partition, you will need to partition the /boot directory, so the needed files to boot remain accessible for the MBR (Master Boot Record, where GRUB is stored).

Of course, the same applies for other partition types; for example /var, a directory we may want to dedicate its own partition to avoid logs from taking over our disk space. The same applies to the /tmp directory. Other partitions may be chosen just because the user considers different and specific file systems that would benefit his system. Other users decide to dedicate the home directory to its own partition to prevent users from taking over the disk with personal files.

Before continuing with this article, the answer on the recommended boot partition size on Debian (Or any other Linux distribution) is 256 MB. Some users choose to leave up to 512 MB to the boot partition, more than that is indeed (unless for some reason you want to keep a kernels collection).

It is important to clarify the main disadvantage of partitioning storage devices is you don’t know how much space you will need in the future. If your calculation fails or your needs change, you may need to reinstall your system or storage devices. That’s why many users decide to install only two partitions: The root partition for system files and the swap partition for the virtual memory.

While this article focuses on the /boot partition, let’s use this opportunity to analyze the most common Linux partitions. The following table depicts Linux would be partitioned, their recommended minimum size, and usage.

PARTITION MINIMUM RECOMMENDED SIZE USAGE
/ 10 GB System files / all files
/boot 256 MB / 512 MB Boot files
/home 100 MB User files
/tmp 50 MB Temporal files
/usr 8 GB Program files
/var 400 MB Dynamic data
  • / (Root): The root partition stores all the systems when the system isn’t partitioned. When the system is partitioned, the root partition stores system files and all files belonging to directories that were not assigned a dedicated partition.
  • /boot: As said previously, the boot partition contains the necessary files to boot the system.
  • /home: The home directory or partition stores user files, such as profile configuration files and all content created by the user. Dedicating a partition to the /home directory will ease backup tasks.
  • /tmp: The tmp partition stores temporary files; dedicating the /tmp directory its own partition is useful to limit the disk space for temporary files.
  • /usr: The /usr partition stores read-only program files, such as executables, libraries, etc. This is similar to the Windows “Program Files” directory.
  • /var: This partition is used for dynamic data, such as log files, cached data, etc. Files located under the /var partition are related to the /usr partition but stored in this different partition since /usr is read-only.
Читайте также:  X org server linux

The boot partition on Debian 11 and other Linux distributions:

The boot partition in Linux includes vital files to boot the system, including the kernel and bootloader configuration files. You can check the content of the boot partition using the ls command, as shown in the example below.

As you can see, there are a few files and directories detailed below.

  • config-x.x.x-x-amd64: This file includes needed components for the Debian kernel building.
  • efi: This directory contains necessary files when the computer has UEFI (Unified Extensible Firmware Interface) instead of BIOS (basic input/output system).
  • grub: This directory contains grub configuration files such as grub.cfg.
  • initrd.img-x.x.x-x-amd64: initrd.img* (Initial Ram Disk) allows the bootloader (GRUB) to load kernel executable into the ram memory before running the kernel.
  • System.map-x.x.x.-amd64: Despite being located under the /boot directory, System.map* files are not necessary to boot the system. Such files are useful for debugging kernel problems.
  • vmlinuz-x.x.x-x-amd64: vmlinuz files are booteable compressed kernel images.

Conclusion:

As you can see, the recommended minimum size for the /boot partition on Debian 11 or other Linux distributions is between 256 MB and 512 MB.

In many scenarios, a dedicated /boot partition may benefit your system by isolating possible problems.

Partitioning the disk is a process done during the installation phase any Linux level user can carry out, even when partitioning seems a difficult task. The /boot partition does not require a considerable disk space amount. While partitioning may imply disadvantages in many cases (Since your needs may change in the future, and you can’t guess how much space you’ll need), this is not the case of the /boot directory, whose recommended size does not vary and is mandatory when you deal with encrypted storage devices. It is important to keep all files contained within the /boot partition, but you must not accumulate compressed kernel versions (vmlinuz) that are not compatible with your system. Also, it is worth clarifying that most domestic Linux systems don’t have a dedicated /boot partition, but only a root (/) and swap (virtual memory) partition without a problem.

Thank you for reading this article explaining the proper size for the /boot partition on Debian 11. Keep following us for additional Linux tips and tutorials.

About the author

David Adams

David Adams is a System Admin and writer that is focused on open source technologies, security software, and computer systems.

Источник

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.

Читайте также:  Linux сбросить кеш днс

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

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
Читайте также:  Linux посмотреть содержимое папок

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

Источник

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