59

What is the recommended size for a Linux /boot partition?

And is it safe to not have a /boot partition?

I see some servers don't have a /boot partition while some servers have a 128 MB /boot partition. I am a little confused. Is /boot partition necessary? If it is, how large should it be?

Cristian Ciupitu
  • 6,226
  • 2
  • 41
  • 55
Tyler Liu
  • 693
  • 1
  • 6
  • 7

13 Answers13

54

I tend to create a 1 GB /boot. I leave a live CD image which has various repair tools in my /boot. I mostly do this for systems that at the remote sites I support.

With the right configuration, and enough memory, GRUB 2 can boot the image without extracting the contents. A couple of times I have talked remote staff into rebooting the system to the live CD image and starting networking/ssh on a system that was having issues so I could connect and repair things.

This certainly isn't required, or even common.

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
Zoredache
  • 128,755
  • 40
  • 271
  • 413
49

These days, 100 Megabytes or 200 Megabytes is the norm.

You do not need to have a /boot partition. However, it's good to have for flexibility reasons (LVM, encryption, BIOS limitations).

Edit:

The recommended size has been increased to 300MB-500MB.

Also see: https://superuser.com/questions/66015/installing-ubuntu-do-i-really-need-a-boot-parition

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • 4
    200 MB is the minimum on most modern Linux but I'd increase it to at least 300 MB to avoid the hassle of re-sizing it. – Wernight May 01 '15 at 11:48
  • @josten I could install elementary OS on a single btrfs without further `/boot` partition or issue. Not sure why you'd say that. – Wernight May 01 '15 at 11:49
  • @josten Ok, some it's more "you *might* need". Thanks for clarifying. – Wernight May 04 '15 at 09:30
  • I wish I see this answer before my installation - installed Debian 8 with 100MB boot and realized almost half of the boot partition is gone. – Codism Jun 03 '15 at 19:40
  • @ewwhite Where does this recommended size come from? – Tim Jun 04 '15 at 19:00
  • 1
    Just today after getting /boot full, I would definitely recommend more than 200MB. Of course you can *manually* remove old kernels but from a sysadmin point of view that is a bad thing. – lahjaton_j May 23 '17 at 04:07
  • This question/answer is from 2011. – ewwhite May 23 '17 at 04:18
  • I frequently run in to Ubuntu Server machines with their tiny /boot partitions full, causing various issues. I can easily recover, but it does both me that apt will screw itself up by installing new kernels until /boot is full and then all of apt is in a broken state. Again, an easy, fix, but just feels.. Microsofty.. – James T Snell Oct 02 '17 at 20:24
  • 1
    @lahjaton_j I don't see why. Keeping all old kernels is a quirk of debian. There's normally no need to keep more than the most recent besides the current one. – Bachsau Apr 30 '19 at 19:22
  • 3
    Tested 9 Aug. 2020: the Ubuntu 20.04 installer gave my boot partition exactly **732.00 MiB**, so, if I was doing this manually today, I'd just give it **1 GiB** and call it good. See my answer here: https://serverfault.com/a/1029458/357116. – Gabriel Staples Aug 10 '20 at 01:15
23

What is the recommended size for a Linux /boot partition?

The /boot partition contains the GRUB configuration, the kernel with their System.map, ... I think ~ 100 MB is enough.

And is it safe to not have a /boot partition?

Yes. But a separate /boot partition has some advantages:

  • As a rescue partition
  • rootfs is on a LVM, RAID, is encrypted, or unsupported by GRUB
  • Maybe saves a few seconds of the boot time
Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
quanta
  • 50,327
  • 19
  • 152
  • 213
  • 2
    I've been surprised relatively recently with a bios that couldn't access above 1023(?) cylinders, too. – Random832 Nov 25 '11 at 07:54
  • 2
    @quanta how _'may be saves a few seconds of boot time'_? – Alessandro Pezzato Nov 25 '11 at 13:28
  • 2
    Because usually /boot is at the beginning of the disk, which is usually on the outer sectors has less chances to get fragmented and the path is smaller (less directory reads), it is usually a primary partition (no need to read the logical partition chain). But I doubt that you gain more than 1s. – Mircea Vutcovici Nov 25 '11 at 15:49
  • "a separate /boot partition has some advantages"...Note that a separate, non-encrypted `/boot` partition is also required when doing a LUKS-encrypted installation where all root (`/`) contents are on the LUKS-encrypted partition. – Gabriel Staples Aug 08 '20 at 09:17
13

As we have seen quite an increase in linux kernel storage requirements and ever increasing initrds, I nowadays (February 2018) tend to allocate 1 GB of storage for /boot.

As /boot is usually the only thing that is not on LVM, it is the only partition you cannot resize easily. Thus "wasting" a few hundred megabytes usually doesn't hurt as bad as a /boot filesystem that turns out to be too small in maybe 5 or 10 years.

Andreas Rogge
  • 2,670
  • 10
  • 24
8

It also differs distribution from distribution. For example for Fedora minimum is 250 MB[1] and 500 MB is default and if you plan to (pre)upgrade in the future 500 MB is required[2]. If space is not a problem I would go for 1 GB to prevent shuffling partitions later as I had to do when upgrading recently.

[1] http://docs.fedoraproject.org/en-US/Fedora/16/html/Installation_Guide/s2-diskpartrecommend-x86.html
[2] http://fedoraproject.org/wiki/How_to_use_PreUpgrade#Not_enough_space_in_.2Fboot

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
Martian
  • 1,060
  • 8
  • 8
6

Modern systems are generally installed with a much larger /boot partition than in the past. The number has just been growing over time.

Consider:

RHEL 5 created a 101 MiB /boot partition.

RHEL 5 Partitioning

RHEL 6 created a 500 MiB /boot partition.

RHEL 6 Paritioning

RHEL 7 also created a 500 MiB /boot partition, but this was changed to 1024 MiB in 7.3, because as the release notes state:

In previous releases of Red Hat Enterprise Linux 7, the default size of the /boot partition was set to 500 MB. This could lead to problems on systems with multiple kernels and additional packages such as kernel-debuginfo installed. The /boot partition could become full or almost full in such scenario, which then prevented the system from upgrading and required manual cleanup to free additional space.

In Red Hat Enterprise Linux 7.3, the default size of the /boot partition is increased to 1 GB, and these problems no longer occur on newly installed systems. Note that installations made with previous versions will not have their /boot partitions resized, and may still require manual cleanup in order to upgrade. (BZ#1369837)

RHEL 7 Partitioning

It remains at 1024 MB in RHEL 8.

RHEL 8 Partitioning

My current EL7 and EL8 systems have roughly 250 MiB used in /boot, but I usually don't install kernel-debug packages.

As the Linux kernel continues to grow over time, mostly due to adding hardware device drivers, this recommendation is likely to continue to grow as well.

And again, as noted by others, a /boot partition isn't strictly required anymore for most installations. VMs generally do not need it, for instance, and UEFI booting systems also don't need it (though they have an EFI System partition which must exist and be large enough to hold various UEFI files). A /boot partition is required for some very old legacy systems and for using LUKS full-disk encryption.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
4

I just installed Ubuntu 13.10 (Saucy Salamander) with a 105 MB /boot. It installed fine, but after it rebooted I did the updater, and it said that there was not enough space.

It wanted around another 196 MB for the upgrade; it must have been a kernel upgrade or something. So had to reinstall with a bigger /boot. I went for 500 MB, and that seemed to work. It is a good thing it doesn't take long to do a new install :)

Peter Mortensen
  • 2,319
  • 5
  • 23
  • 24
Newbie
  • 49
  • 1
  • 1
  • Ubuntu doesn't always remove old kernels after an upgrade. You need to do that yourself. Otherwise it may keep several of them around for a long time. – hookenz Mar 24 '14 at 02:38
  • I used the default size on my laptop, which is less than 100Mb. The consequence is that whenever I update, I need to remove the before-previous update, so I always have two versions on my computer. On my new laptop, I'll make /boot 1Gb. On my desktop it's 500Mb, wich seems ok. – Christine Dec 16 '16 at 21:13
3

It's mostly a function of how many kernels you have installed, and the size of their initrds.

For a 3.0 series kernel, initrd runs about 13 MB. For early 2.6 kernels, this was 3.4 MB. So, if you plan on keeping more than a few kernels around, you'll need at least a couple hundred MB.

How much and whether or not this applies to you depends on your use case. If you multi-boot, test kernels, and/or upgrade frequently, you could run out of space on a 100 MB /boot partition quickly. If you don't do any of these things, it's probably going to be sufficient.

There are very few reasons to skimp on storage (it's cheap, BIOS, mount, and bootloader restrictions on blocks are mostly a thing of the past), and I'm seeing a marked growth in kernel resources with time, so the safe bet would be ~250 MB - 1 GB for now. I still generally prefer a separate /boot partition for control and isolation, though this has almost entirely become a matter of taste (RAID devices would be one obvious exception, LVM and encryption as well as noted by others).

1

There is a special case when you use a BIOS boot partition on a GPT formatted drive. This partition should be 1 MiB large. From RedHat manual:

You need to create a BIOS Boot (biosboot) partition to install on a BIOS system where the disk containing the boot loader uses GPT. The biosboot partition should be 1 MiB in size. However, you do not need the biosboot partition if the disk containing the boot loader uses MBR.

There was a similar bug too (that was closed, but seems so because of moving that to another place).

I encountered this error when trying to install Fedora Core 29. When I tried to format a 500 Mb bios boot partition, it gave an error biosboot partition: device is too large. I tried to install Arch Linux earlier with that boot partition. It reported no error, but after the installation GRUB continuously reloaded the system (so the boot went no further than GRUB screen).

Otherwise 500 Mb partition is fine. Note also that a EFI partition should be FAT32 formatted, be careful to read the instructions not to reinstall everything again. For a biosboot partition you can choose ext4 if you want.

1

What is the recommended size for a Linux /boot partition?

Answer: 732.00 MiB. I just did an Ubuntu 20.04 install on a completely empty disk and I let it do all the partitioning stuff. I chose the options for "LVM" and "encrypted partition" or whatever, then looked at gparted to see what partition scheme it produced. Here's what I saw on my 512GiB Solid State Drive (SSD):

Partition   Name                    File System          Mount Point        Size        Used        Unused      Flags
---------   ----                    -----------          -----------        ----------  ----------  ----------  -----
/dev/sda1   EFI System Partition    fat32                /target/boot/efi   512.00 MiB    1.02 MiB  510.98 MiB  boot,esp
/dev/sda2   (none)                  ext4                 /target/boot       732.00 MiB   47.66 MiB  684.34 MiB  (none)
/dev/sda3   (none)                  [Encrypted] lvm2 pv  vgubuntu           475.72 GiB  475.72 GiB    0.00 B    (none)

So, it gave the /target/boot partition 732.00 MiB. If I was doing this manually, I'd just give my EFI partition 512 MiB and my boot partition 1 GiB and call it good.

1

Moderators ought to close this discussion and put a banner indicating that the 100-200MB /boot partition is an obsolete idea and could cause a world of misery to a novice user and even to one who's been using Linux for a decade, like myself, today. It should be 1 GB as of 2021.

Alex

alex_223
  • 70
  • 1
  • 8
  • Indeed, I have a server with 250MB and forever having issues with it running out of space. Over the years the shipping initrd images have bloated to now be over 50MB (in 2022), so that 250MB partition, once you also factor in a MEMTest image and a vmlinuz, you have enough space for 3 kernels. When your distribution wants to change them every month, that's not much breathing space at all. Recommendation would be 500MB, or 1GB – Mike Macpherson Apr 04 '22 at 13:08
1

It depends also on how many kernels you want to have available. A normal kernel, a "xen" kernel, a "desktop" kernel and in more than one version really sums up well. I wouldn't go for smaller than 500MB. Resizing a front-positioned partition afterwards takes a lot of time.

If you are creating a virtual machine, a separate (virtual) disk may come in handy for several partitions (/home, /boot, /) if you are not familiar with LVM.

0

I always use 100MB as a rule when I'm building systems. I suppose if you're going to be testing out tons of different kernels (or building your own custom kernels) you may want a larger one, but 100MB is enough for most people. Also, as mentioned, having a separate boot partition is a good idea for a bunch of reasons.

Matthew
  • 2,666
  • 8
  • 32
  • 50
  • 5
    Current distributions want 200MB+. – ewwhite Jun 29 '12 at 02:20
  • 1
    Update for 2017: May as well make your /boot more like 500MB. 200MB will work, but storage is cheap and having some breathing space will be nice. Use your judgement. – James T Snell Oct 02 '17 at 20:27
  • 1
    @JamesTSnell btw had an Ubuntu 16.04 installation run out of disk space on 200MB /boot after ~3 years of updates and new kernels - apparently Ubuntu 16.04 update system is not good at cleaning up old kernels. right now /boot is sitting at 240MB there.. and it was quite the hassle fixing it, having to move everything in boot elsewhere, then delete the boot partition, then resize the root partition, then re-create the boot partition then having to move everything back then making sure the new boot partition had the boot flag blah blah blah – hanshenrik Sep 06 '19 at 16:03
  • @hanshenrik - I've fixed that problem may times. You don't HAVE to resize your /boot, but doing so will let you change how long will pass before it comes up again. It's definitely quite annoying and I'm not sure if there's a proper solution to having it manage itself. – James T Snell Sep 06 '19 at 20:04