This Time Self-Hosted
dark mode light mode Search

Why people insist on using /boot

You might or might not know that for a while now I’ve passed most of my time idling and chatting in #gentoo-it, trying to offer support whenever I can (when the user asking support deserves it at least). One of the strangely quite common type of support request involved to some extent the standalone /boot partition.

But why people insist on using a standalone /boot partition?

The /boot partition, where you add not only the grub configuration (with its stages), but also the kernels (you might, and probably should, have multiple copies), with their System.map, and optionally their configuration files, the eventual splashscreen for grub and some other stuff, was classically used to allow grub to access the kernel even on systems with a BIOS unable to allow access over the 1024 sector of an hard drive (grub can’t obviously have drivers for all the controllers, so it only uses the BIOS to access the disk). As a partition that would cross that boundary wouldn’t be properly readable by the BIOS, and thus by grub, the common solution was to put a small /boot before that boundary, and then leave the root partition to cross it, as once the kernel booted, the limitation could be ignored safely.

There are of course other cases where a standalone /boot partition could be useful, one case can be to have a way for grub to start and load the kernel, which in turn can boot with a rootfs stored on a device that the BIOS wouldn’t have been able to see (like a software raid1 or a PCI controller that couldn’t be detected); this is my reason to use a /boot on a CF memory card for Klothos: OpenBOOT doesn’t recognize the Promise SATA controller (I just have a SATA disk for that box), and thus I need to boot the kernel from an EIDE-compatible storage (in this case, the CF through an adapter). Please note that Klothos runs FreeBSD; more on that later.

Other cases where having /boot standalone can help is for half-thin clients where the kernel is stored locally, and then the rootfs is mounted via NFS: you can use a simple storage, like the CF I use, to keep /boot, and then load the rest, if the network card doesn’t support proper network boot.

But for the average user, does /boot provide any advantage? Maybe the only one is to avoid the user from deleting the kernel with rm -rf / but that’s almost useless: you would have screwed your system anyway at that point. I find it actually has a big disadvantage: if the user forgets to put it in fstab, he’d have to always mount it before running a make install for the kernel, and that’s something easily forgot.

Also, the use of a different partition for /boot confuses the hell out of some users, who don’t really understand the difference between Linux’s root filesystem’s partition and grub’s root. When I get a support request about installing grub, and I understand the user is confusing the root= parameter to the kernel and the (root hdX,Y) parameter for grub, my suggestion is to just get rid of the standalone /boot.

Not only this, it’s also difficult to decide the size for such a partition: a lot of people would use a size too small, or too big and then waste space.

Now about FreeBSD, well, it also uses a /boot directory, although it contains not only the kernel but also all its modules, and it makes it way harder to move it on a standalone partition. The FreeBSD documentation doesn’t really cover that option, and even looking around you’ll see a lot of people telling you it can’t be done, that FreeBSD ain’t Linux and that /boot is not something to move to its own partition. The truth is that sometimes you just need to do it, and you can, it’s just something much harder to do than in Linux. I had my own trouble, but then solved it.

So, while I can’t say I like FreeBSD idea of hiding the information that shouldn’t be used by the average user, I think that they are cutting out a lot of possible problems this way, and I think that Linux documentation should actively discourage average users of modern system from using a standalone /boot partition.

So my suggestion is: if you can’t name the reason why you’re using /boot as a standalone partition, then don’t use it.

Comments 26
  1. I’ve used it before because grub-install STILL doesn’t support XFS, meaning any distro that tries to use it to install (*buntu, I’m looking at you) fails if you use it.

  2. Security reasons perhaps? Having /boot as separate partition (or separate disk even) and not having it mounted reduces the chances of it being compromised in case of a hacker or a hardware failure. Atleast in theory. I’d like to say I’m just cautious and that’s why.

  3. Mike, I have to say that I never used grub-install 🙂 So I can’t really asses why it’s not supported and how much sense there is in it not supporting XFS. On the other hand, I never had problems with Fedora, I suppose that running the grub commands by hand is still possible? But from Ubuntu, you can get anything that makes no sense whatsoever :PSecurity reasons aren’t really concerned with your /boot: if your system is compromised to the point they can access root-owned filesystem to write (reading the kernel isn’t really useful), then it’s likely the partition can also be mounted; and hardware failure brings you more or less to the point of rm -rf: what about saving your kernel when the rest of the installation is gone? I find /usr much more critical to save, most of the time you can recreate the kernel from the sources and the configuration file, that you’d be storing in /usr..Thinking of standalone /boot as a security measure is one of those things giving you a false sense of security, maybe you might want to look at proper security measures.

  4. I have to put /boot on a separate partition because my root partition is on an LVM volume, and grub doesn’t understand LVM.

  5. It’s a rescue partition for when my / gets corrupted. A kernel + busybox are all I need.

  6. I agree with Donnie. It’s useful for system rescue, but I also like running with a separate /boot because (on my laptop at least) I always triple, or even quad-boot. I occasionally like to try out a new distro, installing it on a spare partition. Keeping a single /boot, with folders for the appropriate distro and its kernel/files, helps keep everything organized. Multiple /boot directories for all those distros would be a PITA to manage!

  7. File system? IIRC, it’s best to use ext2 for the /boot partition, but for / and others, it’s better to have something more modern.

  8. The reason most people use a separate /boot partition is simply because the Gentoo Handbook says so.

  9. Separate /boot gives you more freedom when choosing FS for “/”.Also it can be buttsaver to have separate partition for root, especially if a bit oversized.It wasn’t once my system was foobared and I needed just a couple of Gigs space where I could set up my crysis management system just to be able to repair things on “/” partition…For taht matter its nice to have a big swap partition that one can transform in a usefull filespace in time of need…

  10. Doh, you have to have a separate /boot if you want to encrypt your /.Simple reason: People still insist on using /boot because they still need it.

  11. Udo you haven’t read the entry at all, and just tried to answer the question in the title. As I said, there are cases when you need a separate /boot, but those are not the cases of average users.(Let’s skip over the fact that encrypting your / doesn’t make that much sense anyway)The same goes for LVM users, those are not average users systems, and those setups requires a separate /boot.Once again the problem is that Joe the average user _still_ uses separate /boot without any reason to.Read the last part of the blog: if you can’t tell WHY you’re using /boot standalone, you don’t have to.

  12. “Joe the average user still uses separate boot without any reason to”Crucial system defaults shouldn’t be decided using “the average user” as the baseline. I personally find the term annoying and not a little demeaning, but that’s a topic for another time. On topic, there’s a big difference between transparently usable and technically dumbed down. I *don’t* believe that a disinclined (but otherwise perfectly intelligent) user should be forced to understand the inner workings of an operating system to use it. But that disinclination should not be the basis for sound technical reasoning.If there are valid technical reasons for a separate /boot (and there are), then don’t contradict them in the name of simplicity. The average user might not need or want to deal with a separate /boot, but the service technician or Linux-knowledgeable friend trying to fix a broken system might benefit from having a separate boot partition. The value of a separate /boot doesn’t manifest itself during daily use, but rather is realized in those rare moments when something goes wrong.”Joe the average driver” doesn’t have a reason to wear his seatbelts during normal driving conditions either, but they come in handy those few times in his driving lifetime when the unusual occurs.Please stop trying to turn Linux into Windows where the typical answer to system error is ‘reformat and reinstall’.

  13. Seems like our anonymous commenter don’t really know me at all, if he thinks I’m interested in turning Linux into Windows.I think I can be considered enough of a power user to know when /boot is useful and when it’s blatantly a “follow whatever the guide says without knowing why”, which in case of Gentoo has very bad results on both the users and us developers. And I can tell you that a splitted /boot saves me nothing for rescuing a system.Besides, on Gentoo at least there are very little “crucial system defaults” that you don’t set by yourself; if you know you need /boot, fine; if the friend who’s installing might find /boot useful, fine… but why doing it unconditionally? That sounds stupid.

  14. For me I need it because I am using a root lvm. And then as far as habit goes I like the kiss approach for consistency. All my systems are setup the same regardless of them needing to use lvm. So from that standpoint why make an unnecessary exception to move boot to a separate mount point for advanced users only.

  15. So, summary:* separate /boot is necessary for many configurations (lvm, encrypted /, unsupported filesystems, as a rescue partition, for multiple distros, etc.)* separate /boot does not hurt (does not affect performance, and takes up only a tiny bit of hard drive space)* therefore, separate /boot should be the default, unless the user knows he will never need it.

  16. Personally,i use a separate /boot in my system(s) only when using a “non standard” setup,eg: root partition contained in LVM2 o in raid0 (software raid).for the rest (normal default uses) i never use a separate /boot

  17. If you suspend-to-disk and have /boot mounted read-write, then grub needs to read its files from an unclean partition. Having /boot on a separate partition (mounted read-only most of the time) solves this issue nicely.

  18. Flameeyes, the way I have always looked at it was like this:File systems get fragmented on both Windows and Linux. Linux may be a bit better at Fragmentation, but they still get that way. Also, over time, new files van get pushed towards the slow end of the hard drive. Having a separate partition for boot, namely the first partition, keeps kernels and other important boot files right there at the beginning of the hard disk. Thus, the seek times are less and boot times are less. This is also why it has always been recommended to have the swap partition as the second partition, to keep it fast. Everything under / can change a lot and files can get corrupted, fragmented, spaced out to the far end … and so on, but since /boot rarely changes, it will stay nice, clean and at the front of the drive, the fastest part of the drive. I mean, how often do you have a new kernel? Not very often, so a lot on the system will change by the time you make a new kernel and since a lot has changed, the new kernel might be further at the end of the drive because you keep the old one in case the new one is broken.So, there is a practical reason to have a separate partition, but now-a-days, most people don’t know about this. Heck, a lot of people don’t know about fragmentation and the difference in seek times depending on where a file is located on the hard drive. They only know what corporations like Diskeeper tell them and they only say things like you need to have our software that monitors your hard drive ever second to make sure something doesn’t fragment so they sell you the product, when in reality it hurts the hard drive. Point is, people need to be better educated on all things hard drives so they can make an educated decision if they want to have a separate boot partition or not. If you don’t care about kernel fragmentation and position on the hard drive, then don’t have a separate partition.I do agree with some comments stating that users have a separate partition because the guide says so. I don’ think there is enough information there for new users to make an educated decision.Good question. I enjoy reading your blog. 🙂 Happy Gentoo-ing.

  19. how about: prevent make menuconfig from using the config from /boot?how about: journaled fs not supported by grub?how about: one /boot for several distris?The last point is imho the best. One /boot once set up with all the kernels, one swap everybody is using and different / for the distris.

  20. There’s one extremely good reason for using a separate /boot on certain archs: some bootloaders can only read things located inside the first two gigs of a drive.

  21. I would like to note that grub supports XFS, JFS and EXT3 just fine; I can’t say for ReiserFS, but at least those three journaled file systems are perfectly supported by grub.And yes Ciaran, that’s probably the best reason of all, I’ve focused mostly on the standard PC in the post, but the issue BIOS had with cylinder 1024 is likely comparable with other arches’ two gigs limitation.

  22. Another reason — on the Cobalt Qube2 and similar machines, the primitive bootloader on the machine’s boot ROM *only* understands EXT2 Revision 0.So sure, if you don’t mind using ext2r0 for your / filesystem, then go right ahead and make it your root. However, most of us like some journaling capability without the inconvenience of having to flash CoLo onto the machine’s boot ROM — thus we use a separate /boot that houses CoLo (since the aforementioned primitive bootloader on-chip can’t load big kernels) and the OS kernels.

  23. Separate boot on my rather old system saves me a few seconds of boot time – kernel boots instantly when it’s separate. The save is worth it because I’m using hibernation to disk, so system booting doesn’t take too much time.

  24. @FllameeyesFor JFS there is an “ro” option necessary in the Kernel line for successful boot up from Grub. But yes it works fine.I’m using a separated partition for /boot because i can use ext2 filesystem with a great inode size. There is a little performance improvement for boot up.

  25. The reason I use it is because I have a multiple partitions and got tired of Ubuntu/OpenSuse/etc destroying and replacing the initial grub instance with their own, whether I wanted it or not. I do not have time to figure out the various clumsy overly complicated installers.Now I have just gone with one which I like, which I have install a separate /boot and then when I’m experimenting or installing any other distro I keep everything in it’s own partition.This way, my grub never gets clobbered, and always seems to stay updated with the available distros as well as windows. Are there easier ways to do this? Who knows, but if you frequently install clean linux distros then this seems to work. Now I’m not worried about what the latest distro will do to my startup screen.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.