Linux efi partition size

How to know the proper amount of needed disk space for EFI partition

In this Ubuntu help wiki about DiskSpace, it is recommended to have the size of EFI partition somewhere around 100~250 MB. However, I might have a 150 MB EFI partition while it actually needs 151 MB of space! So how to know the exact size I need to allocate to the EFI partition?

Mine hdd is of 500GB and its efi partition size is 100MB, I just gave 250 GB to Ubuntu and all the partition sizes was handled by Ubuntu on its own.@MahmoodKiaheyrati

6 Answers 6

You cannot know the exact size unless:

  1. you plan on never updating the OS
  2. you perform a preliminary test installation, then use that information to recreate the partitions during another OS installation

Using my own machines as a reference, the EFI partitions on the daily workhorses are 1GB in size. The partitions exist on a storage device that is at least 512GB in size. Currently none of the EFI partitions exceed 1.8% utilisation, or 180MB (the lowest is 97MB).

Having been burned by excessively small EFI partitions in the past, I allowed the Ubuntu installation wizard choose the size of its EFI partition and have had exactly 0 issues since then.

Additional Notes:

Microsoft recommends 100 MB for its operating systems, while many Linux forums suggest more for Linux based operating systems or for any dual boot or multi booting situations.

As per the Arch Linux wiki, to avoid potential problems with some EFIs, ESP size should be at least 512 MiB. 550 MiB is recommended to avoid MiB/MB confusion and accidentally creating FAT16.

So, most common size guideline for EFI System Partition is between 100 MB to 550 MB. One of the reason behind this is it is difficult to resize later as it is the first partition on the drive. EFI partition may contain languages, fonts, BIOS firmware, other firmware related stuffs. There are some firmware/software that are installed into the the EFI partition instead of the data drive.

As it may be difficult to enlarge the size of the EFI partition in the future, and because many storage devices measure in the hundreds of gigabytes, it makes sense to go with something that is not the absolute minimum unless the plan is to install the OS, disconnect the device from the Internet, and run it without updates until the end of time.

Much of the recommendation o the Linux side results from an assumption that the system will be set up for multiboot and will be dealing with random intrusions into the partition from various things from Windows or another OS, or that you’re planning to use the ESP as a boot partition. Both cases should involve at least half a gigabyte of space, but if neither of those is the case then 128MB is more than enough (I have a dual-boot setup on my laptop that’s using less than ¼ of the 256MB ESP, and this is consistent with most other systems I have dealt with).

Читайте также:  Статистика пользователей дистрибутивов linux

180MB is 18% of 1GB, not 1.8%. (I don’t think you meant that the one with 180MB used is actually larger (10GB), to still be under your 1.8% cap.)

@PeterCordes Most EFI partitions are 1GB. The one that uses the highest percentage of disk space is 180MB on a 10GB disk. The one that uses the lowest percentage is 97MB (disk size not specified).

«. none of the EFI partitions exceed [. ] 180MB (the lowest is 97MB).» — I find those numbers quite high; my Win10/Debian10 dual boot desktop uses 31M; my Debian10-only netbook uses 132K. 1G EFI partition sounds excessive to me, to be honest. Are you using it as /boot as well?

People tend to massively oversize these partitions. I have been using my Arch Linux system with an ESP as small as 32 MiB and a 128 MiB boot partition for years now, and never run into trouble. Debian and Ubuntu systems might require a 256 MiB boot partition as they keep old kernels installed, but not more.

The space required depends on the boot method used and what other operating systems are installed.

GRUB installs its first and second stage bootloader only, which is fairly small, and then uses its own file system drivers to load the kernel and initrd through the EFI interface for block device access. You get away with a few megabytes for that.

The systemd bootloader and Windows copy both their kernel and an initial ramdisk containing drivers into the ESP, which requires a bit of space — how much exactly depends on the drivers included in the initial ramdisk.

Windows selects only the bare minimum drivers, analogous to selecting MODULES=dep in initramfs.conf, so they get away with a few megabytes, but fail to boot if the hardware changes too much (e.g. when you move the harddisk from an internal SATA port to an add-on card).

Ubuntu, to my knowledge, defaults to MODULES=most , so it copies a few megabytes of drivers into the initramfs. This is robust, but requires additional space.

Ubuntu typically keeps the last two kernel versions installed, so there needs to be enough space for two versions of the initramfs, plus one extra during upgrades (where the new one is copied to the ESP before the old one is deleted).

If you use GRUB only and do not plan to (ever) switch, you get away with 10 MB.

If you dual-boot into Windows and use GRUB, Windows’s default of 100 MB is good.

If you plan to use systemd-boot, leave enough space for at least three copies of the initramfs, which is around 30-40 MB at this time and will likely grow in future releases. 200 MB should be safe, typical installations use 500 MB because with modern harddisk sizes, it doesn’t matter.

Источник

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 перестает работать wifi

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