LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Is the boot partition useless? (https://www.linuxquestions.org/questions/linux-general-1/is-the-boot-partition-useless-4175611315/)

bloupbloup 08-04-2017 10:36 AM

Is the boot partition useless?
 
I don't understand why the default partitions have still a boot partition in many Linux distros. Is it for compatibility purposes?

Everything under the /boot folder is rarely updated and for sure it is only used during startup. adding the /boot under the / does not seem to hurt. I don't understand why we create a 500 Mb partition still today. The files and folders of the boot folder are rarely updated and accessed.

I have one root partition on my server with the boot in it. It is a RAID 5 array. I have installed grub2 on the mbr of every drive. It works. My tmp and swap are in 2 files with a fixed size.

I don't like partitions because i like to remember what i am doing on my servers.

Please challenge me!

schneidz 08-04-2017 10:39 AM

i actually put my /boot under the same partition as /. doesnt seem dangerous.

but the files in that directory are changed at least every few weeks (new kernel, new init.rd, new grub.cfg, ...).

i would guess backup images and restoring would be somewhat more flexible with smaller compartmentalized partitions ?

hydrurga 08-04-2017 10:47 AM

As far as I am aware, there are quite a few situations where a separate boot partition can still be useful e.g. allowing the root filesystem to be on certain RAID devices or be a filesystem that the bootloader doesn't support. It's also useful if you have an encrypted root partition.

IsaacKuo 08-04-2017 10:48 AM

Quote:

Originally Posted by bloupbloup (Post 5744441)
I don't understand why the default partitions have still a boot partition in many Linux distros. Is it for compatibility purposes?

Everything under the /boot folder is rarely updated and for sure it is only used during startup. adding the /boot under the / does not seem to hurt. I don't understand why we create a 500 Mb partition still today. The files and folders of the boot folder are rarely updated and accessed.

I have one root partition on my server with the boot in it. It is a RAID 5 array. I have installed grub2 on the mbr of every drive. It works. My tmp and swap are in 2 files with a fixed size.

I don't like partitions because i like to remember what i am doing on my servers.

Please challenge me!

Personally, I think that the default partitions should always be just one partition on a desktop/server and just two partitions on a laptop (/ and swap, since hibernation with a swap file is a not-worth-it mess).

But there are useful use cases for a /boot partition. The big one for me is putting /boot on a small USB thumbdrive. This can be good for various sorts of computers like Macs or Chromebooks which you might not want to mess with the internal drive's weird bootloader - but they can boot just fine from a MBR style USB thumbdrive.

In this case, you don't want any more than just /boot on the USB thumbdrive even if there's space for it because they're slow. And you can conveniently remove the /boot drive with no ill effects so it isn't sticking out the side of your laptop (or you want to use that USB port for something else).

DavidMcCann 08-04-2017 11:05 AM

The /boot partition is largely a legacy thing. There was a time when boot-loaders would not work from inside LVM, so distros like Red Hat which default to LVM told you to create /boot. That restriction vanished with Grub 2.

The Arch wiki (where would we be without it!) says you need /boot is you have a software RAID 0.

Apart from the RH family, which distros automatically create it? I've always used manual partitioning, so I don't know what they get up to, except for Mint, which only creates root and swap.

273 08-04-2017 01:17 PM

For some reason I thought UEFI required a /boot partition (will check whether I have one when I get home)?

Can't say I see a seperate /boot in the installers I have tried though.

TheEzekielProject 08-04-2017 01:34 PM

As others, have mentioned, there are use cases where a separate /boot is needed. Such as encrypted /. Or for keeping on a removable usb for security purposes.

I do personally think it makes things easier to have separate partitions for various mount points, such as /boot, /home, swap, and /. It makes system maintenance and recovery easier IMO. But I probably mess around with things I shouldn't more than the average Joe, so I find it useful :D

I have an efi computer though, which requires vfat /boot(/efi). So there are definitely still cases where it seems to be necessary rather than just historical

hazel 08-05-2017 02:20 AM

Quote:

Originally Posted by 273 (Post 5744499)
For some reason I thought UEFI required a /boot partition (will check whether I have one when I get home)?

Can't say I see a separate /boot in the installers I have tried though.

UEFI requires an EFI system partition with a FAT32 filesystem. You usually mount it on /boot/efi when you want to look at it.

bloupbloup 08-05-2017 03:16 AM

10 years ago, size of the default boot partition for Fedora was 100mb.

today it is 250 mb.
https://docs.fedoraproject.org/en-US...mmend-x86.html

I have a centos with 500 Mb of boot partition.

I have seen people who had boot partitions that were too small.

syg00 08-05-2017 03:31 AM

The distro devs figured /boot was a handy place to hide packages during (principally) upgrades. Except they forgot to tell people ...
Eventually they issued the advisory to increase the size. Fedora and Ubuntu (at a minimum) were both guilty IIRC.

273 08-05-2017 04:02 AM

Quote:

Originally Posted by hazel (Post 5744702)
UEFI requires an EFI system partition with a FAT32 filesystem. You usually mount it on /boot/efi when you want to look at it.

Thank you for the clarification :). I knew a separate partition was required but thought it was /boot.

hydrurga 08-05-2017 04:12 AM

Quote:

Originally Posted by hazel (Post 5744702)
UEFI requires an EFI system partition with a FAT32 filesystem. You usually mount it on /boot/efi when you want to look at it.

Just a precision that the filesystem type for the ESP (EFI System Partition) is based on FAT but is actually a new filesystem type, independent from FAT and part of the UEFI specification. For example, it includes long filenames and will not be modified to reflect any future changes to the FAT32 specification.

See http://www.uefi.org/sites/default/fi...s/UEFI 2_5.pdf (p536).

DavidMcCann 08-05-2017 10:58 AM

Quote:

Originally Posted by bloupbloup (Post 5744710)
10 years ago, size of the default boot partition for Fedora was 100mb. today it is 250 mb.
I have seen people who had boot partitions that were too small.

I remember that problem. People made the default installation with LVM and a small /boot, required by Grub 1. I congratulated myself for not having accepted LVM!

AwesomeMachine 08-13-2017 02:16 AM

It was once the case that /boot had to be a certain type of file system for grub to work. So, if you wanted to use xfs for the system, you could make a separate /boot partition in ext3, and the system would boot.

Luridis 08-13-2017 12:04 PM

The boot partition is still useful, not only for EFI, but for security. Any malware that gets picked up by a machine is almost certainly looking to attach itself to the boot process. It is for this reason that on my LFS machines /boot is mounted read-only at runtime. Some distributions don't mount it at all during runtime. However, there are programs that need access to System.map and typically look for it in /boot. This is why I mount mine as read-only. While it is true that malware could remount the volume if it gains root privileges, I suspect most malware is written to be as simple as possible. Inserting the code to check for errors on executed shell commands and following up with code to parse fstab to remount a volume is at odds with typical malware behavior.


All times are GMT -5. The time now is 11:17 AM.