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?
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.
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
The
/boot
partition contains the GRUB configuration, the kernel with their System.map, ... I think ~ 100 MB is enough.Yes. But a separate
/boot
partition has some advantages: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.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
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 6 created a 500 MiB /boot partition.
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:
It remains at 1024 MB in RHEL 8.
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.
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 :)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).
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.
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:
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.