X-Git-Url: https://code.delx.au/refind/blobdiff_plain/16ed1bfb9ca9b0b491572d515810c3889e652617..e366a10e438344bd1331f2de89d177079a91ba76:/docs/refind/installing.html diff --git a/docs/refind/installing.html b/docs/refind/installing.html index 422133a..8497bf8 100644 --- a/docs/refind/installing.html +++ b/docs/refind/installing.html @@ -8,6 +8,8 @@ + +

The rEFInd Boot Manager:
Installing rEFInd

@@ -15,7 +17,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -12/8/2014, referencing rEFInd 0.8.4

+9/19/2015, referencing rEFInd 0.9.2

This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

@@ -132,7 +134,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Don't be scared by the length of this page! Only portions of this page apply to any given user, and most people can install rEFInd from an RPM or Debian package in a matter of seconds or by using the install.sh script in minute or two.

-

Once you've obtained a rEFInd binary file, you must install it to your computer's EFI System Partition (ESP) (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. See the Contents sidebar to the left for links to specific installation procedures. For most Linux users, an RPM or Debian package is the best way to go. If your Linux system doesn't support these formats, though, or if you're running OS X, using the install.sh script can be a good way to go. If you're using Windows, you'll have to install manually.

+

Once you've obtained a rEFInd binary file, as described on the preceding page, you must install it to your computer's EFI System Partition (ESP) (or conceivably to some other location). The details of how you do this depend on your OS and your computer (UEFI-based PC vs. Macintosh). The upcoming sections provide details. See the Contents sidebar to the left for links to specific installation procedures. For most Linux users, an RPM or Debian package is the best way to go. If your Linux system doesn't support these formats, though, or if you're running OS X, using the install.sh script can be a good way to go. If you're using Windows, you'll have to install manually.

@@ -186,21 +188,35 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Fixing Windows Boot Problems
  • -
  • Uninstalling rEFInd
  • +
  • Uninstalling rEFInd - +
  • @@ -208,13 +224,13 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Installing rEFInd Using an RPM or Debian Package File

    -

    I provide RPM and Debian package files for rEFInd; and starting with version 0.8.4, I'm maintaining an Ubuntu PPA for rEFInd. If you have a working RPM-based or Debian-based Linux installation that boots in EFI mode, using one of these files is likely to be the easiest way to install rEFInd: You need only download the file and issue an appropriate installation command. In some cases, double-clicking the package in your file manager will install it. If that doesn't work, a command like the following will install the RPM on an RPM-based system:

    +

    I provide RPM and Debian package files for rEFInd; and starting with version 0.8.1, I'm maintaining an Ubuntu PPA for rEFInd. If you have a working RPM-based or Debian-based Linux installation that boots in EFI mode, using one of these files is likely to be the easiest way to install rEFInd: You need only download the file and issue an appropriate installation command. In some cases, double-clicking the package in your file manager will install it. If that doesn't work, a command like the following will install the RPM on an RPM-based system:

    -
    # rpm -Uvh refind-0.8.4-1.x86_64.rpm
    +
    # rpm -Uvh refind-0.9.2-1.x86_64.rpm

    On a Debian-based system, the equivalent command is:

    -
    # dpkg -i refind_0.8.4-1_amd64.deb
    +
    # dpkg -i refind_0.9.2-1_amd64.deb

    Either command produces output similar to that described for using the install.sh script, so you can check it for error messages and other signs of trouble. The package file installs rEFInd and registers it with the EFI to be the default boot loader. The script that runs as part of the installation process tries to determine if you're using Secure Boot, and if so it will try to configure rEFInd to launch using shim; however, this won't work correctly on all systems. Ubuntu 12.10 users who are booting with Secure Boot active should be wary, since the resulting installation will probably try to use Ubuntu's version of shim, which won't work correctly with rEFInd. The shim program provided with more recent versions of Ubuntu should work correctly.

    @@ -242,11 +258,13 @@ $ sudo apt-get install refind

    Quick install.sh Instructions

    + +

    By default, the install.sh script installs rEFInd to your disk's ESP. Under Mac OS X, you can instead install rEFInd to your current OS X boot partition by passing the script the --notesp option, or to a non-boot HFS+ partition by using the --ownhfs devicefile option. Under either OS, you can install to something other than the currently-running OS by using the --root /mountpoint option. (See Table 1 for details.)

    Under Linux, install.sh will be most reliable if your ESP is already mounted at /boot or /boot/efi, as described in more detail in the Installing rEFInd Manually Using Linux section. (If you installed Linux in EFI mode, chances are your ESP is properly mounted.) If your ESP is not so mounted, install.sh will attempt to locate and mount an ESP, but this action is not guaranteed to work correctly. If you run install.sh from a BIOS/legacy-mode boot, particularly on a computer that also runs Windows, you should be aware that the tricks the script uses to install itself from BIOS mode are rather delicate. You can convert to a more conventional configuration using the mvrefind.sh script after you've booted in EFI mode.

    -

    Prior to version 0.8.4, install.sh installed rEFInd to the OS X root partition by default. I changed this because the default configuration for OS X 10.10 ("Yosemite") makes this placement unusable. Instead, install.sh now installs to the ESP under OS X, just as it does under Linux; however, the default installation location under OS X is EFI/BOOT/ rather than EFI/refind/. This difference accommodates a quirk of Apple's EFI, which sometimes imposes a 30-second delay when using anything but the EFI/BOOT location. If you're upgrading a working install of rEFInd to the OS X root partition, it's best to pass the --notesp option to install.sh. This option is described in more detail shortly.

    +

    Prior to version 0.8.4, install.sh installed rEFInd to the OS X root partition by default. I changed this because the default configuration for OS X 10.10 ("Yosemite") makes this placement unusable. Instead, install.sh now installs to the ESP under OS X, just as it does under Linux. If you're upgrading a working install of rEFInd to the OS X root partition, it's best to pass the --notesp option to install.sh. This option is described in more detail shortly.

    A sample run under Linux looks something like this:

    @@ -385,13 +403,21 @@ Unmounting install dir refind_linux.conf, though—for instance, to add dolvm to the boot options on Gentoo systems that use LVM. +
  • If you pass the --shim option to the script (along with a + filename for a shim binary), the script sets up for a Secure Boot + configuration via shim. By default, this causes the rEFInd binary to be + renamed as grubx64.efi. Recent versions of shim support + passing the name of the follow-on program to shim via a parameter, + though. If you want to use this feature, you can pass the + --keepname option to install.sh.
  • +

    In addition to these quirks, you should be aware of some options that install.sh supports to enable you to customize your installation in various ways. The syntax for install.sh is as follows:

     install.sh [--notesp | --usedefault device-file | --root mount-point | \
    -            --ownhfs device-file ] \
    +            --ownhfs device-file ] [--keepname ] \
                [--nodrivers | --alldrivers] [--shim shim-filename] [--localkeys] [--yes]
     
    @@ -428,12 +454,16 @@ install.sh [--notesp | --usedefault device-file | --ro --shim shim-filename or --preloader preloader-filename - If you pass this option to install.sh, the script will copy the specified shim program file to the target directory, copy the MokManager.efi file from the shim program file's directory to the target directory, copy the 64-bit version of rEFInd as grubx64.efi, and register shim with the firmware. (If you also specify --usedefault, the NVRAM registration is skipped.) When the target file is identified as PreLoader, much the same thing happens, but install.sh copies HashTool.efi instead of MokManager.efi and copies rEFInd as loader.efi rather than as grubx64.efi. The intent is to simplify rEFInd installation on a computer that uses Secure Boot; when so set up, rEFInd will boot in Secure Boot mode, with one caveat: The first time you boot, MokManager/HashTool will launch, and you must use it to locate and install a public key or register rEFInd as a trusted application. The rEFInd public key file will be located in the rEFInd directory's keys subdirectory under the name refind.cer. Note that I'm not providing a shim binary myself, but you can download one from here. Some distributions also provide their own shim programs, so can point to them—for instance, in /boot/efi/EFI/fedora/shim.efi. + If you pass this option to install.sh, the script will copy the specified shim program file to the target directory, copy the MokManager.efi file from the shim program file's directory to the target directory, copy the 64-bit version of rEFInd as grubx64.efi, and register shim with the firmware. (If you also specify --usedefault, the NVRAM registration is skipped. If you also use --keepname, the renaming to grubx64.efi is skipped.) When the target file is identified as PreLoader, much the same thing happens, but install.sh copies HashTool.efi instead of MokManager.efi and copies rEFInd as loader.efi rather than as grubx64.efi. The intent is to simplify rEFInd installation on a computer that uses Secure Boot; when so set up, rEFInd will boot in Secure Boot mode, with one caveat: The first time you boot, MokManager/HashTool will launch, and you must use it to locate and install a public key or register rEFInd as a trusted application. The rEFInd public key file will be located in the rEFInd directory's keys subdirectory under the name refind.cer. Note that I'm not providing a shim binary myself, but you can download one from here. Some distributions also provide their own shim programs, so can point to them—for instance, in /boot/efi/EFI/fedora/shim.efi. --localkeys This option tells install.sh to generate a new Machine Owner Key (MOK), store it in /etc/refind.d/keys as refind_local.*, and re-sign all the 64-bit rEFInd binaries with this key before installing them. This is the preferable way to install rEFInd in Secure Boot mode, since it means your binaries will be signed locally rather than with my own key, which is used to sign many other users' binaries; however, this method requires that both the openssl and sbsign binaries be installed. The former is readily available in most distributions' repositories, but the latter is not, so this option is not the default. + + --keepname + This option is useful only in conjunction with --shim. It tells install.sh to keep rEFInd's regular filename (typically refind_x64.efi) when used with shim, rather than rename the binary to grubx64.efi. This change cuts down on the chance of confusion because of filename issues; however, this feature requires that shim be launched with a command-line parameter that points to the rEFInd binary under its real name. versions of shim prior to 0.7 do not properly support this feature. (Version 0.4 supports it but with a buggy interpretation of the follow-on loader specification.) If your NVRAM variables become corrupted or are forgotten, this feature may make rEFInd harder to launch. This option is incompatible with --usedefault and is unavailable when run under OS X or without the --shim option. If the script discovers an existing rEFInd installation under EFI/BOOT or EFI/Microsoft/Boot and no other rEFInd installation when this option is used, it will abort. + --yes This option causes the script to assume a Y input to every yes/no prompt that can be generated under certain conditions, such as if you specify --shim but install.sh detects no evidence of a Secure Boot installation. This option is intended mainly for use by scripts such as those that might be used as part of an installation via an RPM or Debian package. @@ -460,7 +490,7 @@ Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 191284 16604 174681 9% /boot/efi - +

    This example shows that /dev/sda1 is mounted at /boot/efi, which is a typical configuration. (The ESP can be on another disk or partition, but /dev/sda1 is the most common place for an ESP.) If your output shows /boot or / under the Mounted on column, then your ESP isn't mounted. (An exception is if you're mounting the ESP at /boot. This is an unusual configuration. If you're using it, you can proceed, making suitable adjustments to subsequent commands.) If you get a df: `/boot/efi': No such file or directory error message, then the /boot/efi directory doesn't even exist. In such cases, you may need to jump through some extra hoops, as described on my EFI Boot Loader Installation page.

    @@ -481,7 +511,7 @@ Filesystem 1K-blocks Used Available Use% Mounted on -
  • On a UEFI-based system, type efibootmgr -c -l \\EFI\\refind\\refind_x64.efi -L rEFInd to add rEFInd to your EFI's list of available boot loaders, which it stores in NVRAM. Adjust the path to the binary as required if you install somewhere else. You may also need to include additional options if your ESP isn't on /dev/sda1 or if your configuration is otherwise unusual; consult the efibootmgr man page for details. You may need to install this program on some systems; it's a standard part of most distributions' repositories. Also, if you're installing in Secure Boot mode, you must normally register shim.efi rather than the rEFInd binary, and rename refind_x64.efi to grubx64.efi.
  • +
  • On a UEFI-based system, type efibootmgr -c -l \\EFI\\refind\\refind_x64.efi -L rEFInd to add rEFInd to your EFI's list of available boot loaders, which it stores in NVRAM. Adjust the path to the binary as required if you install somewhere else. You may also need to include additional options if your ESP isn't on /dev/sda1 or if your configuration is otherwise unusual; consult the efibootmgr man page for details. You may need to install this program on some systems; it's a standard part of most distributions' repositories. Also, if you're installing in Secure Boot mode, you must normally register shim.efi rather than the rEFInd binary, and rename refind_x64.efi to grubx64.efi. Shim 0.7 and later enables you to keep rEFInd's usual name by adding a -u "shim.efi refind_x64.efi" option to your efibootmgr command line, though. Change the filenames to the ones used by your actual Shim and rEFInd binaries, respectively.
  • If other boot loaders are already installed, you can use efibootmgr to adjust their boot order. For instance, efibootmgr -o 3,7,2 sets the firmware to try boot loader #3 first, followed by #7, followed by #2. (The program should have displayed a list of boot loaders when you added yours in the preceding step.) Place rEFInd's number first to set it as the default boot program.
  • @@ -496,6 +526,8 @@ Filesystem 1K-blocks Used Available Use% Mounted on

    Installing rEFInd Manually Using Mac OS X

    + +

    Before installing rEFInd on a Mac, you must determine whether it uses a 32-bit or 64-bit EFI implementation. Most Intel-based Macs have 64-bit EFIs, so you should use the refind_x64.efi file with them; but very early Intel-based Macs have 32-bit EFIs (and sometimes 32-bit CPUs), which require the refind_ia32.efi file. You can determine whether your Mac needs the x86-64 or IA32 build by typing the following command in a Mac Terminal window:

    @@ -562,8 +594,8 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi
         
     
    -

    Unfortunately, I lack a recent Mac and so can't investigate these issues myself, so I'm dependent upon others (mostly non-programmers) to offer workarounds. This is the type of problem that really requires hands-on interactive debugging sessions with the code to stand any chance of finding a better solution.

    +

    I've recently acquired a 2014 MacBook Air, but I haven't yet had the chance to try to reproduce this problem and find a workaround. It's on my to-do list, though.

    + +
    +

    Fixing a Failure to Find Linux

    +
    + +

    Some users report that rEFInd doesn't detect Linux, or won't boot it when it is found. Broadly speaking, there are two common causes of this problem:

    + + + +

    If you suspect that your hybrid MBR is damaged, you can try re-creating it with my GPT fdisk (gdisk) program. The GPT fdisk hybrid MBR documentation covers this procedure in detail. You can run gdisk from either OS X or Linux, although you may need to install it, particularly in OS X.

    + +

    If you suspect driver problems, you'll need to mount your ESP (as described in the manual OS X installation instructions), locate the rEFInd drivers_x64 directory, and adjust its contents. Make sure you have a driver for the filesystem that holds your Linux kernel. If you don't know what filesystem this is, it's probably ext4fs. rEFInd ships with several filesystem drivers, including one for ext4fs. You should also remove unnecessary filesystem drivers. I've seen several reports of one driver interfering with others' operation. The biggest culprit seems to be the HFS+ driver when used on Macs.

    + +

    Fixing Windows Boot Problems

    @@ -1073,27 +1146,103 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi

    Uninstalling rEFInd

    -

    If you decide you don't want to keep rEFInd, you can uninstall it. Doing so is a matter of removing the rEFInd files from your ESP (or from your OS X boot partition, if you installed the program there). In Linux, a command like the following, typed as root, should do the trick:

    +

    If you decide you don't want to keep rEFInd, you can uninstall it. Doing so is a matter of removing the rEFInd files from your ESP (or from your OS X boot partition, if you installed the program there). The exact details of how to do this vary from one OS to another, though; and in some cases there are alternatives to completely uninstalling rEFInd that are easier to implement.

    + + +

    Uninstalling rEFInd from Linux

    +
    + +

    In Linux, a command like the following, typed as root, should remove rEFInd:

     # rm -r /boot/efi/EFI/refind
     
    -

    This example assumes that your ESP is mounted at /boot/efi and that rEFInd is installed in EFI/refind on that partition. If you've mounted your ESP elsewhere, or installed rEFInd elsewhere, you should adjust the command appropriately.

    +

    You must type this command as root (or use sudo in some environments, such as under Ubuntu). This example assumes that your ESP is mounted at /boot/efi and that rEFInd is installed in EFI/refind on that partition. If you've mounted your ESP elsewhere, or installed rEFInd elsewhere, you should adjust the command appropriately.

    -

    The same procedure works in OS X, with the caveat that the ESP isn't normally mounted in OS X. Thus, you must first mount the ESP, as described earlier, in the section on manually installing rEFInd in OS X. (You can forego this step if you installed to the OS X root partition.) You'll also need to use sudo to acquire root privileges. Thus, you'd probably use a command like the following in OS X:

    +

    If you installed via an RPM or Debian package in Linux, using your package manager will remove the package files, but not the files that the installer places on your ESP. Thus, you must uninstall those files manually, as just described. To complete the job, you'll also have to remove /boot/refind_linux.conf, and perhaps the /etc/refind.d directory.

    -
    -$ sudo rm -r /Volumes/esp/EFI/refind
    -
    + +

    Uninstalling rEFInd from OS X

    +
    -

    Many variants of both of these commands are possible on both OS X and Linux. For instance, you'd probably use sudo on Ubuntu. Note that dragging the rEFInd files to the Trash in OS X does not delete them; it just moves them to a different folder. Given the way that Macs reference boot loaders, this means that rEFInd may still launch. If you want to use the Finder to delete rEFInd, be sure to empty the trash after you drag the files there. That should do the job, provided there's no second installation hiding somewhere.

    +

    The easiest way to restore the standard OS X boot loader on a Mac is not to uninstall rEFInd; it's to bypass it. This can be accomplished with the Startup Disk item in the System Preferences panel:

    -

    If you installed via an RPM or Debian package in Linux, using your package manager will remove the package files, but not the files that the installer places on your ESP. Thus, you must uninstall those files manually, as just described. To complete the job, you'll also have to remove /boot/refind_linux.conf, and perhaps the /etc/refind.d directory.

    +
    The OS X Startup Disk tool enables you to reset a Mac
+    to use the standard OS X boot loader.

    + +

    Select your startup disk (Macintosh HD OS X, 10.10.1 in this example) and then click Restart. The computer should reboot into OS X, bypassing rEFInd.

    + +

    I recommend stopping here, because the procedure for completely removing rEFInd from a Mac depends on your installation method and tends to be challenging for many Mac users, who are unfamiliar with the necessary command-line tools. Basically, you must reverse the steps described earlier, in Installing rEFInd Manually Using Mac OS X:

    + +
      + +
    1. You must first determine where rEFInd is installed. This can be any of + several locations: + +
        + +
      • If you installed rEFInd 0.8.3 or earlier with the default options, + or if you used the --notesp option with rEFInd 0.8.4 or + later, it will be /EFI/refind on your main partition
      • + +
      • If you installed rEFInd 0.8.4 or later with the default options, or + if you used the --esp option with rEFInd 0.8.3 or earlier, + it will be in EFI/refind or EFI/BOOT on the + ESP.
      • + +
      • If you used the --ownhfs option to install.sh, + rEFInd will be in the System/Library/CoreServices + directory on the volume you specified.
      • + +
      • If you installed rEFInd manually, it will be wherever you put + it.
      • + +
      • In all cases, there could be duplicate (inactive) rEFInd files in + unexpected places. This is particularly true if you tried + installing rEFInd multiple times, each with different options to + install.sh. Thus, if you delete rEFInd and it still comes + up, you may have deleted the wrong files. (Note that dragging files + to the Trash may have no effect, though—at least, not until + you empty the Trash.)
      • + +
      + +
    2. If necessary, mount the ESP or rEFInd-specific HFS+ volume, as + described in Installing rEFInd Manually Using Mac OS + X.
    3. + +
    4. Verify that rEFInd is installed in the directory noted in step #1. If a + refind.conf file is present, rEFInd is almost certainly + installed in that directory. If not, it's not rEFInd there and you + should not proceed. Be extra cautious about deleting the + System/Library/CoreServices directory, since that's + the default location of the OS X boot loader! Never delete this + directory from your OS X root (/) partition, only from the + partition you specified to install.sh using the + --ownhfs option.
    5. + +
    6. Once you've identified the rEFInd directory, delete it, or at least the + rEFInd boot file. This file may be called refind_x64.efi, + bootx64.efi, boot.efi, or conceivably something else. + You may need to use sudo rm at the command line to accomplish + this task, as in sudo rm -r + /Volumes/esp/EFI/refind.
    7. + +
    + + +

    Uninstalling rEFInd from Windows

    +

    From Windows, you must reverse the directions for installing in Windows—type mountvol S: /S to mount your ESP as S:, then navigate to the S:\EFI directory and delete the refind subdirectory.

    -

    In any of these cases, when the computer boots and cannot find the rEFInd files, it should move on to the next boot loader in its list. In my experience, some EFI firmware implementations remove boot loaders they can't find from their NVRAM lists, so nothing else will be required, provided you have another working boot loader in your firmware's list. If your firmware doesn't automatically clean up its NVRAM entries, rEFInd's entry will do little harm; however, you can delete it with the efibootmgr utility in Linux:

    + +

    Post-Uninstallation Activity (UEFI-Based PCs)

    +
    + +

    On a UEFI-based PC, when the computer boots and cannot find the rEFInd files, it should move on to the next boot loader in its list. In my experience, some EFI firmware implementations remove boot loaders they can't find from their NVRAM lists, so nothing else will be required, provided you have another working boot loader in your firmware's list. If your firmware doesn't automatically clean up its NVRAM entries, rEFInd's entry will do little harm; however, you can delete it with the efibootmgr utility in Linux:

     # efibootmgr --verbose
    @@ -1110,11 +1259,14 @@ Boot0007* CD/DVD Drive

    This example shows use of efibootmgr's --verbose (-v) option to display boot programs so as to identify which one is rEFInd, followed by --delete-bootnum (-B) to delete a boot program and --bootnum (-b) to identify which one to delete. Of course, in this example there's not much else left, so you'd presumably want to install another boot program at this point! If you already have another one installed, you may want to check the BootOrder line to determine which one will take precedence when you reboot. If you don't like what it shows, you can adjust it with the --bootorder (-o) option; consult efibootmgr's man page for details.

    -

    If you're not using Linux, you may be able to find a utility that serves a similar function. The OS X bless utility (or its GUI equivalent, the Startup Disk item in System Preferences) should do the trick; but Macs pick up standard OS X boot loaders when they boot and find that a configured non-standard boot loader is missing, so this shouldn't be necessary on Macs. Under Windows, the bcdedit command, described in the section on installing rEFInd under Windows, may work, although I've not attempted this.

    +

    If you're not using Linux, you may be able to find a utility that serves +a similar function. Under Windows, the bcdedit command, described +in the section on installing rEFInd under Windows, +may work, although I've not attempted this.


    -

    copyright © 2012–2014 by Roderick W. Smith

    +

    copyright © 2012–2015 by Roderick W. Smith

    This document is licensed under the terms of the GNU Free Documentation License (FDL), version 1.3.