X-Git-Url: https://code.delx.au/refind/blobdiff_plain/e1ec473588a10ba284d916f49622fdbcb5d4f1b1..119f040f3c096ef2ab59f5d02059e9d872047dcd:/docs/refind/installing.html diff --git a/docs/refind/installing.html b/docs/refind/installing.html index 05ebb41..a38452c 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

+1/8/2013, referencing rEFInd 0.6.4

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!

@@ -114,8 +114,6 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Extra install.sh Instructions
  • -
  • Using refind-unhijack.sh
  • -
  • Installing rEFInd Manually @@ -130,7 +128,15 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

  • Installing rEFInd Manually Using an EFI Shell
  • -
  • Alternative Naming Options
  • +
  • Alternative Naming Options + +
  • Upgrading rEFInd
  • @@ -158,7 +164,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    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 run the refind-unhijack.sh script after you boot Linux in EFI mode for the first time.

    +

    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.

    @@ -175,7 +181,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. 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 refind-unhijack.sh script.

    +

    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:

    @@ -271,13 +277,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, @@ -342,44 +345,6 @@ install.sh [--esp | --usedefault device-file | --root

    In any event, you should peruse the script's output to ensure that everything looks OK. install.sh displays error messages when it encounters errors, such as if the ESP is mounted read-only or if you run out of disk space. You may need to correct such problems manually and re-run the script. In some cases you may need to fall back on manual installation, which gives you better control over details such as which partition to use for installation.

    - -

    Using refind-unhijack.sh

    -
    - -

    Sometimes it's necessary to install rEFInd from a BIOS/legacy-mode boot. This can happen because you've accidentally installed Linux in this mode or because you're using a BIOS-mode emergency disc to do the installation, for instance. Ordinarily, such installations are unlikely to work, particularly if the computer already has an EFI-mode OS installed. Since version 0.6.3, though, rEFInd's install.sh script has attempted to install in one of three ways when run from BIOS mode:

    - - - -

    The first two approaches are perfectly legitimate and are unlikely to cause problems, although they also might not work in all circumstances. The third approach is essentially an act of desperation, and it violates the usual rule that each OS should manage its own boot loader directory. It has the benefit of working, though; and in fact on some computers with buggy firmware, this approach may be the only way to get rEFInd (or any other non-Microsoft boot loader) to work. When install.sh uses this method, it notifies you of the fact:

    - -
    Running in BIOS mode with a suspected Windows installation; moving boot loader
    -files so as to install to /boot/efi/EFI/Microsoft/Boot.
    - -

    The install.sh script preserves the Windows boot loader, and rEFInd should continue to be able to boot Windows when installed in this way. It's possible, though, that Windows will notice the change and will attempt to "fix" the "damage," which will remove rEFInd from the boot process. To avoid this problem, you can run the refind-unhijack.sh script. This script moves the rEFInd installation files to a more appropriate location on the ESP (EFI/refind) and registers rEFInd with the EFI in the officially-sanctioned manner.

    - -

    Unfortunately, on some systems you really should leave rEFInd installed as EFI/Microsoft/Boot/bootmgfw.efi; some EFIs have bugs that prevent them from launching any boot loader but that one. Thus, there are no hard-and-fast rules; you'll have to determine what works on your system and run refind-unhijack.sh or not as you deem best.

    - -

    To run the script, type its name (and perhaps its path) as root. It will report on what it does:

    - -
    # ./refind-unhijack.sh
    -I'm not yet written!
    - -

    If you run this script on a system whose Windows boot loader has not been "hijacked" by rEFInd, no harm will come of it; the script only does its thing when it detects that rEFInd is installed where the Windows boot loader should be.

    -

    Installing rEFInd Manually

    @@ -410,7 +375,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.
  • @@ -678,19 +643,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.
    @@ -726,11 +755,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.

    @@ -766,7 +804,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 @@ -824,6 +862,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:

    @@ -832,7 +872,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 @@ -847,7 +887,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.