2

I am trying to install Ubuntu on to a clean system and use XFS for the system partition, however it seems that my UEFI system does not like XFS.

When installing I select Something else and manually partition the disk. As part of troubleshooting I have put the partitions back to the bare minimum of a single ESP partition and a system partition. When I choose ext4 for the system partition the system installs and then boots successfully. When I do everything exactly the same but change the system partition to use XFS the system installs, but when it reboots I am presented with the grub prompt. When listing disks (ls (hd0,gpt2)) the XFS partition is seen as unknown and unreadable.

What am I doing wrong, and how can I install Ubuntu using XFS as the format for the system disk?

karel
  • 114,770
fileinsert
  • 162
  • 1
  • 9
  • https://unix.stackexchange.com/a/230310 –  Aug 11 '17 at 14:54
  • Thank you. However I should point out that the boot partition is fully compliant with the UEFI specification and uses a FAT32 file system. It is only the system partition that is XFS. I just found further evidence that XFS may not be a good choice of OS file system https://wiki.ubuntu.com/XFS says "GRUB-Support is in an early stage, therefore using xfs as boot-filesystem can be a bad idea". That's disappointing. I would like verification beyond my own experience. – fileinsert Aug 11 '17 at 15:19

1 Answers1

4

I haven't tried such an installation in a while, but it sounds like there's a bug in GRUB's XFS support, or at least in the way Ubuntu sets it up. I have three suggestions for workarounds:

  • Create a separate /boot partition -- If you create a separate /boot partition and use ext4fs on it, that will eliminate GRUB's need to read XFS, which should bypass the problem. I recommend making /boot at least 500 MB in size, and maybe as large as 1 GB.
  • Mount the ESP at /boot -- This approach is a variant of the preceding one. I'm pretty sure that the Ubuntu installer will refuse to accept this layout, so you'd need to install in some other way and then tweak the configuration using an emergency boot system. Even aside from the difficulty setting this up, there's one BIG caveat: Ubuntu sometimes (but not always) creates symbolic links as a temporary part of installing a new kernel. Since FAT (which is used on the ESP) does not support symbolic links, this will fail, as will any kernel update that creates symbolic links. Thus, this approach will cause minor problems from time to time. If your computer were a Mac (or if you were installing to a VirtualBox virtual machine), you could use HFS+ on the ESP, which is a violation of the EFI spec but would work on a Mac or under VirtualBox. Using HFS+ on the ESP will not work on any UEFI-based PC I know of. In any event, you'd want to ensure the ESP was big enough (at least 512 MiB) if you try this.
  • Use rEFInd and the efifs XFS driver -- GRUB isn't the only EFI boot loader for Linux; but most require that the kernel reside on the same partition as the boot loader itself. GRUB and my own rEFInd are the two exceptions to this rule. The trick with rEFInd is that it includes no XFS support; however, there is an XFS driver for EFI available in the efifs package. Thus, installing both rEFInd and the XFS driver from efifs should work. The trick is that you'll need to do this at least somewhat manually and from an emergency system, so it'll be a pain to set up. Also, efifs is derived from GRUB's filesystem drivers, so if GRUB's XFS support is flaky, efifs might not be any better.

Overall, creating a separate ext4fs /boot partition is likely to be the easiest solution; however, if you're really keen on having everything (except the ESP) on XFS, you could try rEFInd or mounting the ESP at /boot. Of those two, I'd recommend rEFInd above mounting the ESP at /boot; mounting the ESP at /boot is just too far from what Ubuntu expects to be a good choice, particularly since you're likely to see occasional failed kernel package updates. I mentioned that option mainly for completeness, not to say it's a good idea.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • That cements the conclusions I'm drawing that XFS may be a bad idea for what I'm trying to do. I have flexibility with my options so I may rethink my file system choice. More research required. Thank you. – fileinsert Aug 11 '17 at 20:14