X-Git-Url: https://code.delx.au/refind/blobdiff_plain/b2410fb7695fb349a65a2749e9524f250a4f6420..25fa33d6ede1e5a5dfa7831231e9068a25ccf7d2:/docs/refind/installing.html diff --git a/docs/refind/installing.html b/docs/refind/installing.html index 14f72ac..a6445cf 100644 --- a/docs/refind/installing.html +++ b/docs/refind/installing.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -12/31/2012, referencing rEFInd 0.6.2-2

+2/3/2013, referencing rEFInd 0.6.7

I'm a technical writer and consultant specializing in Linux technologies. 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!

@@ -128,13 +128,31 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Installing rEFInd Manually Using an EFI Shell
  • -
  • Alternative Naming Options
  • +
  • Alternative Naming Options + +
  • Upgrading rEFInd
  • Installing Additional Components
  • -
  • Fixing a Sluggish Macintosh Boot
  • +
  • Fixing a Sluggish Macintosh Boot + +
  • Uninstalling rEFInd
  • @@ -146,16 +164,18 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Installing rEFInd Using an RPM or Debian Package File

    -

    Beginning with version 0.6.2, I've included an RPM package file for rEFInd, and I quickly updated this (in 0.6.2-2) to be more sophisticated and to include a Debian package file, as well. 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:

    +

    Beginning with version 0.6.2, I've included RPM and Debian package files 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.6.2-2.x86_64.rpm
    +
    # rpm -Uvh refind-0.6.7-1.x86_64.rpm

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

    -
    # dpkg -i refind_0.6.2-2_amd64.deb
    +
    # dpkg -i refind_0.6.7-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.

    +

    Since version 0.6.3, the installation script makes an attempt to install rEFInd in a bootable way even if you run the script from a BIOS-mode boot, and therefore the RPM and Debian packages do the same. I cannot guarantee that this will work, though, and even if it does, some of the tricks that install.sh uses might not last for long. You might therefore want to use mvrefind.sh to move your rEFInd installation to another name after you boot Linux for the first time from rEFInd.

    +

    Since version 0.6.2-2, my package files have installed the rEFInd binaries to /usr/share/refind-version, the documentation to /usr/share/doc/refind-version, and a few miscellaneous files elsewhere. Upon installation, the package runs the install.sh script to copy the files to the ESP. This enables you to re-install rEFInd after the fact by running install.sh, should some other tool or OS wipe the ESP or should the installation go awry. In such cases you can use install.sh or install manually.

    @@ -171,7 +191,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    Under Linux, the install.sh script installs rEFInd to your disk's ESP. Under Mac OS X, the script installs rEFInd to your current OS X boot partition by default; but you can install to your ESP instead by passing the script the --esp 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.)

    -

    Before running this script under Linux, you should ensure that your ESP is 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.) This precaution isn't necessary under OS X.

    +

    Before running this script under Linux, you should ensure that your ESP is 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.) This precaution isn't necessary under OS X. 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.

    A sample run under Linux looks something like this:

    @@ -267,13 +287,10 @@ Installation has completed successfully. available, installs it. Note that the "/boot directory" may be on a separate partition or it may be part of your root (/) filesystem, in which case the driver for your root filesystem is - installed. If install.sh detects that the filesystem in - question is ext2fs or ext3fs, it installs the ext4fs driver, which can - handle all three of these filesystem types. This feature is unlikely to - work properly from an emergency system, although it might if you have a - separate /boot partition and if you mount that partition at - /boot in your emergency system, and the ESP at - /boot/efi. + installed. This feature is unlikely to work properly from an emergency + system, although it might if you have a separate /boot + partition and if you mount that partition at /boot in your + emergency system, and the ESP at /boot/efi.
  • If you run install.sh on Linux and if /boot/refind_linux.conf doesn't already exist, @@ -332,7 +349,7 @@ install.sh [--esp | --usedefault device-file | --root --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. Note: I introduced this option with the 0.6.2-2 incremental release, which was primarily an update of the 0.6.2 RPM package; it's not yet available in the mainline 0.6.2 version. + 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. @@ -368,7 +385,7 @@ Filesystem 1K-blocks Used Available Use% Mounted on
  • Type cd /boot/efi/EFI/refind to change into rEFInd's new directory on the ESP.
  • -
  • Type rm refind_ia32.efi to remove the IA32 binary if you're using an x86-64 (64-bit) system; or type rm refind_x64.efi to remove the x86-64 binary if you're using an x86 (32-bit) system. You can optionally rename the binary you keep as refind.efi, but this isn't required. (Note that you must keep the version that's the correct bit width for your EFI; if you've installed a 32-bit Linux on a 64-bit PC with a 64-bit EFI, you'd keep refind_x64.efi.
  • +
  • Type rm refind_ia32.efi to remove the IA32 binary if you're using an x86-64 (64-bit) system; or type rm refind_x64.efi to remove the x86-64 binary if you're using an x86 (32-bit) system. (Note that you must keep the version that's the correct bit width for your EFI; if you've installed a 32-bit Linux on a 64-bit PC with a 64-bit EFI, you'd keep refind_x64.efi.
  • Optionally, type rm -r drivers_ia32 to remove the x86 drivers from an x86-64 system, or rm -r drivers_x64 to remove the x86-64 drivers from a 32-bit x86 system. You may also want to remove some or all of the drivers for the architecture you are using. If you don't need them, they'll slow down the start process, and worse, if you're using Secure Boot, rEFInd can load just one shim/MOK-signed driver. See the page on drivers for more on this topic.
  • @@ -636,19 +653,83 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi

    Alternative Naming Options

    +

    Some EFI implementations do a poor job of honoring the boot options set via Linux's efibootmgr or other tools. You may also lack access to such utilities, such as if you must install rEFInd in Windows. In such cases, you may need to change the boot loader's name so that the EFI will see it as the default boot loader. rEFInd should then boot when your NVRAM lacks information on specific boot loaders to use. Broadly speaking, there are two alternative names that are most useful:

    + + + +

    If you need to use one of these names, or something more exotic, you can do so in either of two ways: You can use the mvrefind.sh script to move your installation in one step, or you can move and rename your files manually.

    + + +

    Using mvrefind.sh

    +
    + +

    The easiest way to move a rEFInd installation, at least in Linux, is to use the mvrefind.sh script. If you installed from one of my RPM or Debian packages, this script should be installed in /usr/sbin, so you can use it like a regular Linux command; otherwise you'll need to install it to your path yourself or type its complete path. Either way, it works much like the Linux mv command, but you pass it the directory in which a rEFInd installation appears and a target location:

    + +
    +# mvrefind.sh /boot/efi/EFI/BOOT /boot/efi/EFI/refind
    +
    + +

    This example moves rEFInd from /boot/efi/EFI/BOOT to /boot/efi/EFI/refind. It differs from mv in several ways: + +

    + +

    The mvrefind.sh script is likely to be useful in resolving boot problems—if your system won't boot, you can try copying the installation to /boot/efi/EFI/BOOT, /boot/efi/EFI/Microsoft/Boot, and /boot/efi/EFI/refind in turn, testing the boot process after each attempt. (These filenames all assume your ESP is mounted at /boot/efi.) You could also copy a BIOS-mode install from /boot/efi/EFI/BOOT or /boot/efi/EFI/Microsoft/Boot to /boot/efi/EFI/refind to make it more robust against Windows repairs (assuming your firmware isn't broken).

    + + +

    Renaming Files Manually

    +
    +

    Some EFI implementations do a poor job of honoring the boot options set via Linux's efibootmgr or other tools. You may also lack access to such utilities, such as if you must install rEFInd in Windows. In such cases, you may need to change the boot loader's name so that the EFI will see it as the default boot loader. rEFInd should then boot when your NVRAM lacks information on specific boot loaders to use. To do this, follow these steps:

    1. Access your ESP and install rEFInd to it, as described in earlier sections.
    2. -
    3. Look for an existing directory called EFI/BOOT or EFI/Microsoft/BOOT. If neither of these directories exist, skip the next step. (Note that FAT is case-insensitive, so the name may vary in case.)
    4. +
    5. Look for an existing directory called EFI/BOOT or EFI/Microsoft/Boot. If neither of these directories exist, skip the next step. (Note that FAT is case-insensitive, so the name may vary in case.)
    6. -
    7. Rename the existing directory or boot loader file to something else. For EFI/BOOT, try renaming it to EFI/Oldboot. For EFI/Microsoft/BOOT, move or rename the bootmgfw.efi file it contains. For instance, you can move it to EFI/Microsoft. This will keep the boot loader accessible to rEFInd's menu, while preventing the firmware from launching it automatically.
    8. +
    9. Rename the existing directory or boot loader file to something else. For EFI/BOOT, try renaming it to EFI/Oldboot. For EFI/Microsoft/Boot, move or rename the bootmgfw.efi file it contains. For instance, you can move it to EFI/Microsoft. This will keep the boot loader accessible to rEFInd's menu, while preventing the firmware from launching it automatically.
    10. -
    11. Rename/move your EFI/refind directory to EFI/BOOT. If you're working from EFI/Microsoft/BOOT, you should move the contents of your rEFInd directory to EFI/Microsoft/BOOT.
    12. +
    13. Rename/move your EFI/refind directory to EFI/BOOT. If you're working from EFI/Microsoft/Boot, you should move the contents of your rEFInd directory to EFI/Microsoft/Boot.
    14. -
    15. Rename EFI/BOOT/refind_x64.efi to the name of the boot loader it's replacing—it should become EFI/BOOT/bootx64.efi or EFI/Microsoft/BOOT/bootmgfw.efi.
    16. +
    17. Rename EFI/BOOT/refind_x64.efi to the name of the boot loader it's replacing—it should become EFI/BOOT/bootx64.efi or EFI/Microsoft/Boot/bootmgfw.efi.
    @@ -684,11 +765,20 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi icons directory (icons-backup, which holds the original icons, whereas icons holds the icons from the new package). Normally this just wastes some disk space; but if you've customized your icons, - you'll need to copy your altered icons back. + you'll need to copy your altered icons back. Since version 0.6.2, + install.sh has searched for rEFInd in several locations on the + ESP, and will upgrade whatever it finds. + +
  • Under an RPM- or Debian-based Linux distribution, you can use your + package system to install a newer version of the RPM or Debian package + that I provide. This will upgrade the files in your Linux filesystem + and re-run the install.sh script, so as with the previous + options, you'll waste a little disk space on duplicated icons, but the + process should otherwise work quite well.
  • -

    In all cases, if the new version includes new or altered configuration file options, you may need to manually update your configuration file. Alternatively, if you've used the default configuration file, you can replace your working refind.conf with refind.conf-sample from the rEFInd zip file. (When using install.sh, this file will be copied to rEFInd's installation directory under its original name, so you can rename it within that directory to replace the old file.

    +

    In all cases, if the new version includes new or altered configuration file options, you may need to manually update your configuration file. Alternatively, if you've used the default configuration file, you can replace your working refind.conf with refind.conf-sample from the rEFInd zip file. (When using install.sh, this file will be copied to rEFInd's installation directory under its original name, so you can rename it within that directory to replace the old file.)

    If you're upgrading to rEFInd from rEFIt, you can simply run the install.sh script as described earlier or perform a manual installation. Once installed, rEFInd will take over boot manager duties. You'll still be able to launch rEFIt from rEFInd; a rEFIt icon will appear in rEFInd's menu. You can eliminate this option by removing the rEFIt files, which normally reside in /EFI/refit.

    @@ -724,7 +814,7 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi href="http://refit.sourceforge.net">original rEFIt package.
  • Drivers—You can install drivers to extend the capabilities - of the EFI. rEFInd ships with filesystem drivers for ext2fs and + of the EFI. rEFInd ships with filesystem drivers for ext2fs, ext4fs, and ReiserFS, which can enable you to boot a Linux kernel with EFI stub support from an ext2fs, ext3fs, ext4fs, or ReiserFS partition. (rEFInd also provides ISO-9660 and HFS+ drivers.) You can find additional drivers @@ -746,7 +836,27 @@ $ ioreg -l -p IODeviceTree | grep firmware-abi

    Fixing a Sluggish Macintosh Boot

    -

    I've received a few reports of a sluggish boot process (a delay of about 30 seconds before starting rEFInd) on some Macs after installing rEFInd. I've been unable to replicate this problem myself, and its true cause remains mysterious to me. I have found a Web forum post describing a possible fix. Be aware, though, that this procedure involves using the efibootmgr utility on Macs, which has been known to damage the firmware on some Macs. Other reports indicate that this problem has been fixed with 3.3.0 and later kernels. Thus, I present this information cautiously and with a strong "use at your own risk" warning. If you care to proceed, I recommend you update your Linux kernel to the latest possible version and then proceed as follows:

    +

    I've received a few reports of a sluggish boot process (a delay of about 30 seconds before starting rEFInd) on some Macs after installing rEFInd. I've been unable to replicate this problem myself, and its true cause remains mysterious to me. I have found three possible solutions, though: moving rEFInd to an HFS+ volume, using the fallback filename, and clearing NVRAM entries.

    + + +

    Moving rEFInd to an HFS+ Volume

    +
    + +

    Most of the reports of sluggish Macintosh boots I've seen note that the user installed rEFInd to the ESP rather than to the OS X root partition. Some users have reported that re-installing rEFInd to the OS X root partition clears up the problem. This is obviously a straightforward solution to the problem, if it works. Note that rEFInd can launch boot loaders that are stored on any partition that the EFI can read no matter where it's installed; therefore, you'll still be able to launch boot loaders stored on the ESP (or elsewhere) if you install it in this way.

    + +

    The biggest drawback to this approach is that you won't be able to edit the rEFInd configuration file or move rEFInd-related binaries from an EFI shell if you install it in this way, since Apple's HFS+ driver for EFI is read-only. (The same is true of rEFInd's HFS+ driver, so it won't help you overcome this limitation.) You may also be limited in making changes to your rEFInd configuration from Linux or other OSes, too, since Linux's HFS+ drivers disable write support by default on volumes with an active journal. You can force write access by using the force option to mount; however, this procedure is noted as being risky in the Linux HFS+ documentation, so I don't recommend doing this on a regular basis. As a compromise, you might try creating a small non-journaled HFS+ volume that's dedicated to holding rEFInd. You could even mount it as the Linux /boot partition, in which case it would also hold the Linux kernel and related files. You'll need to install rEFInd manually if you try this.

    + + +

    Using the Fallback Filename

    +
    + +

    I've received one report that installing rEFInd to the ESP using the fallback filename (EFI/BOOT/bootx64.efi on most systems, or EFI/BOOT/bootia32.efi on very old Macs) can work around the problem.

    + + +

    Clearing the NVRAM Entries

    +
    + +

    The first is a Web forum post that describes a possible fix. Be aware, though, that this procedure involves using the efibootmgr utility on Macs, which has been known to damage the firmware on some Macs. Other reports indicate that this problem has been fixed with 3.3.0 and later kernels. Thus, I present this information cautiously and with a strong "use at your own risk" warning. If you care to proceed, I recommend you update your Linux kernel to the latest possible version and then proceed as follows:

      @@ -782,6 +892,8 @@ $ sudo rm -r /EFI/refind

      Many variants of both of these commands are possible on both OS X and Linux. For instance, you'd probably use sudo on Ubuntu; and if you installed rEFInd to your ESP on a Mac, you'd need to first mount the ESP and include its path in the rm command.

      +

      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.

      +

      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:

      @@ -790,7 +902,7 @@ $ sudo rm -r /EFI/refind # efibootmgr --verbose Timeout: 10 seconds BootOrder: 0000,0007 -Boot0000* rEFInd HD(2,1b8,64000,f1b7598e-baa8-16ea-4ef6-3ff3b606ac1e)File(\EFI\refind\refind.efi) +Boot0000* rEFInd HD(2,1b8,64000,f1b7598e-baa8-16ea-4ef6-3ff3b606ac1e)File(\EFI\refind\refind_x64.efi) Boot0007* CD/DVD Drive BIOS(3,0,00)PATA: HP DVD Writer 1040r . # efibootmgr --delete-bootnum --bootnum 0000 Timeout: 10 seconds @@ -805,7 +917,7 @@ Boot0007* CD/DVD Drive
      -

      copyright © 2012 by Roderick W. Smith

      +

      copyright © 2012–2013 by Roderick W. Smith

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