So, not knowing the syntax of Linux at all, how do I set the permission to be able to view and edit a certain file withint the boot/efi folder?

The file is refind.conf - and is the config file for the refind boot OS selector application.


  • 1
    Please don't change any permissions. You just use sudo for that :) I don't know the path to the file, but you run something like sudoedit /boot/efi/refind/refind.conf. Are you sure you need to edit that file btw? – Zanna Apr 25 '17 at 9:50
  • Hi Zanna - well, the refind documentation suggests there is a refind.conf file usually located in the boot/efi folder. When I try to access this folder either in file manager or terminal I see folder with 'x' through it or get permission denied message. – John Apr 25 '17 at 9:56
  • OK, please can you run in a terminal sudo -i, enter your password and then type cd /boot/efi and then ls to see the files there. – Zanna Apr 25 '17 at 10:06
  • Many thanks, that seems to have allowed me to view the files. The file I am after is a few layers further down in /boot/efi/efi/refind - but I do now see the refind.conf file I mentioned. I am not planning on editing this just yet, as I will do some more reading and learning before I do - as it is listed in green withint the terminal! (which I assume means it is protected in some manner and maybe I have misunderstood the configuration options) – John Apr 25 '17 at 10:11

I'd like to collect some information from the comments, and add more information, in a formal answer:

  • rEFInd's main configuration file is refind.conf. It exists in the same directory as the rEFInd EFI binary, which is normally refind_x64.efi (or variants for non-AMD64 architectures; or bootx64.efi or variants if it's installed using the fallback filename). This configuration file will normally be /boot/efi/EFI/refind/refind.conf, or sometimes /boot/efi/EFI/BOOT/refind.conf, from Ubuntu.
  • In Ubuntu, the default location for rEFInd is /boot/efi/EFI/refind; however, /boot/efi/EFI/BOOT is the fallback location, which is used when installing rEFInd to a USB flash drive, if the installation script runs in BIOS mode, or if mvrefind is used to move rEFInd to the fallback filename. The fallback filename is used if the EFI's NVRAM-based variables don't exist or if they all point to non-existent boot loaders or boot loaders that fail. In theory, rEFInd can be installed anywhere on the ESP, so it could exist in other oddball locations.
  • Because the EFI System Partition (ESP) can be mounted at different locations in different OSes, the rEFInd documentation generally refers to files without specifying a mount point. In this context, rEFInd is installed in EFI/refind or EFI/BOOT; you'd add the standard Ubuntu ESP mount point of /boot/efi/ to the start of these values to get /boot/efi/EFI/refind or /boot/efi/EFI/BOOT.
  • The rEFInd binary and configuration file are stored on the ESP, which is a FAT partition. FAT does not support Unix-style ownership or permissions, but because Linux requires these features, they're faked in a crude way by mount options, which are typically specified in /etc/fstab. See this question and its answers for an introduction to how this is done.
  • FAT is a case-insensitive filesystem. Since the ESP is mounted at /boot/efi, that means that any directory or filename component after that point is case-insensitive. Thus, /boot/efi/EFI/refind is equivalent to /boot/efi/efi/rEFInd; but these two are not equivalent to /boot/EFI/EFI/refind, since /boot/efi is normally on a Linux-native filesystem like ext4fs, and Linux-native filesystems are case-sensitive.
  • The green text in ls listings identifies executable files. Files on an ESP are not normally executable in Linux, although rEFInd and other EFI binaries are executable in EFI. Ubuntu mounts the ESP in such a way that all files appear to be executable. I suspect that's because the executable bit does double duty as a way to identify directories that can be searched/entered, so it's required to make directories useful. The easy thing to do is to ignore this. If you're annoyed by it, you can edit the mount options in /etc/fstab, using separate dmask and fmask options, which set directory and file permissions separately, rather than a single umask option, that applies to both directories and files.
  • See this question and its answers for more on color coding in ls listings. Note that you can get more detailed information on individual files' permissions and ownership by doing long listings, as in ls -l ~/foo; however, on a FAT partition, all files will have identical ownership, and permissions will be identical with the possible exception of write permission being denied on some files. (Directories might or might not have identical permissions, depending on the mount options.)
  • Recent versions of Ubuntu have set rather restrictive permissions on access to the ESP because it's such a critical partition; an ordinary user should not be able to modify its contents because the boot loaders it contains are required to boot the OS. Indeed, there's little reason for ordinary users to even see what's on that partition, and knowing settings in files like refind.conf could conceivably be a security threat, particularly on a multi-user computer. To access this partition, you can use sudo, as in sudo ls /boot/efi/EFI/refind. If you're not so concerned with security, you can edit /etc/fstab to give yourself greater access to the partition; but even then, I strongly recommend against giving universal read/write access to it. The risk of accidentally trashing a directory is too great.
  • If you do change mount options in /etc/fstab, you can unmount the ESP (with sudo umount /boot/efi), make the changes, and then re-mount the ESP (with sudo mount -a).

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.