5

I want to install GRUB 2 to its own, comparatively small (500 MB), partition.

Are there any requirements on what file system type it has to be? Are there any that, although possible, are not recommended, and for what reason?

3 Answers 3

3

Nowdays on modern Linux distros ext2, ext3 and ext4 are equally supported so it means you can use one of them.

Sources:

3

After just losing some time over this myself, I can confirm the following:

  • As psusi mentioned, it is generally not necessary to have a separate boot partition anymore. Quote:

psusi: /boot partition is an anachronism from days gone by, where it was common for the bios to not be able to access the whole disk, or before grub2 gained the ability to recognize just about any filesystem

  • However, a big problem is that GRUB in fact is not able to recognize just about any filesystem. GRUB last stable release (2.0.2beta) is from 2 years ago, and this is the version that most distributions ship. So, while XFS, for example, was supported back in the time of the release, this filesystem has evolved* in the meantime but GRUB did not follow with a new release. Meaning that GRUB cannot boot from a boot partition that is XFS formatted. The same goes for BTRFS afaik.

  • GRUB patches for the mentioned changes or new file systems sometimes do exist but it usually means that you would have to compile GRUB entirely yourself if your distribution offers a build package. In case of Arch Linux I had to build Grub-Git from Arch user repositories for XFS boot to work.

  • After this experience, I will use a separate boot partition (300MB is plenty), formatted in ext3 or even fat32, just to be safe and not having to resort to unstable repositories.

* I found it impossible to figure out which those improvements or changes were, I'm just relaying what I read from other people, it might be wrong. But it's a fact that GRUB release cannot boot from XFS as of this writing.

3
  • I bet it's because of changes in the on-disk format phoronix.com/scan.php?px=MTY5MTY&page=news_item . Try formatting by "mkfs.xfs -n ftype=0 -m crc=0". I had the same issue with the Crossmeta driver.
    – beroal
    Feb 13, 2016 at 20:10
  • 1
    if you use encryption or LVM for / then you must have a separate /boot partition
    – phuclv
    Jan 8, 2017 at 13:46
  • 1
    I know this is an old topic, but according to en.wikipedia.org/wiki/Comparison_of_boot_loaders, grub2 supports the following filesystems: ext2, ext3, ext4, btrfs, zfs, ufs, minix, iso9660, udf, jfs, hfs, hfs+, afs, affs, sfs, xfs, reiserfs, tar, cpio, NTFS, FAT16, FAT32 .
    – Marin N.
    Aug 3, 2018 at 12:58
0

It is standard-practice to have GRUB on a partition of its own - which is why most systems have a separate partition for /boot which will be around 200M or 300M.

About the filesystem to be used, you can go with the regular ext4/3 filesystems

  • What filesystem types you should NOT use:

You should not use XFS filesystem for GRUB2.

Below given is the message I got when I tried to install grub2 in an XFS partition for the heck of it.

grub2-install: error: hostdisk//dev/loop7 appears to contain a xfs filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).

The only thing I could gather from google with the limited time and knowledge I had was that the superblock of an XFS filesystem is held in the first sector(where the bootloader has to be) and that makes the XFS unsuitable for grub2 or grub. I hope(and look forward to) that anyone among the more knowledgable members here can take it from here and explain what exactly what makes XFS and GRUB2 a bad match with a better explanation.

4
  • 1
    Having a separate /boot partition is an anachronism from days gone by, where it was common for the bios to not be able to access the whole disk, or before grub2 gained the ability to recognize just about any filesystem. It is no longer needed or recommended. You also can use xfs just fine; the error you got is from trying to install grub to the partition instead of the MBR, which you should not be doing with any filesystem.
    – psusi
    Dec 24, 2014 at 15:51
  • @psusi Though it's still useful if you multi-boot, that way you can wipe and reinstall partitions without having to move or re-install the bootloader.
    – IQAndreas
    Dec 24, 2014 at 16:02
  • 2
    @psusi A separate /boot is getting a new life with full disk encryption becoming more common — though on modern PCs Grub can often be on the UEFI boot partition, it doesn't need a separate partition of its own. Dec 24, 2014 at 20:11
  • “the superblock of an XFS filesystem is held in the first sector(where the bootloader has to be)” You are supposed to write a bootloader into the master boot record, not into the boot record of the boot partition. Would you give an exact command installing Grub2?
    – beroal
    Feb 13, 2016 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.