]> code.delx.au - refind/blobdiff - docs/refind/installing.html
Version 0.8.1 release.
[refind] / docs / refind / installing.html
index 1dd87ed7d3b84246888b36aabdcc539eb021e8a9..d22af0165742c1632526d119a9296a2c244ebc01 100644 (file)
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-8/6/2013, referencing rEFInd 0.7.2</p>
+5/15/2014, referencing rEFInd 0.8.1</p>
 
 
-<p>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!</p>
+<p>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!</p>
 
 <table border="1">
 <tr>
@@ -168,6 +168,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
    <li class="tight"><a href="#efishell">Installing rEFInd Manually Using an EFI Shell</a></ul></li>
 
+<li class="tight"><a href="#wde">Using OS X Whole-Disk Encryption</a></li>
+
 <li class="tight"><a href="#naming">Alternative Naming Options</a>
 
    <ul>
@@ -182,7 +184,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li class="tight"><a href="#addons">Installing Additional Components</a></li>
 
-<li class="tight"><a href="#sluggish">Fixing a Sluggish Macintosh Boot</a>
+<li class="tight"><a href="#sluggish">Fixing a  Macintosh Boot</a>
 
    <ul>
 
@@ -206,11 +208,11 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>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:</p>
 
-<pre class="listing"># <tt class="userinput">rpm -Uvh refind-0.6.11-1.x86_64.rpm</tt></pre>
+<pre class="listing"># <tt class="userinput">rpm -Uvh refind-0.8.1-1.x86_64.rpm</tt></pre>
 
 <p>On a Debian-based system, the equivalent command is:</p>
 
-<pre class="listing"># <tt class="userinput">dpkg -i refind_0.6.11-1_amd64.deb</tt></pre>
+<pre class="listing"># <tt class="userinput">dpkg -i refind_0.8.1-1_amd64.deb</tt></pre>
 
 <p>Either command produces output similar to that described for <a href="#installsh">using the <tt>install.sh</tt> script,</a> 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.</p>
 
@@ -229,9 +231,11 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 <h3>Quick <tt>install.sh</tt> Instructions</h3>
 </quickstart>
 
-<p>Under Linux, the <tt>install.sh</tt> 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 <tt>--esp</tt> option. Under either OS, you can install to something other than the currently-running OS by using the <tt>--root <tt class="variable">/mountpoint</tt></tt> option. (See <a href="#table1">Table 1</a> for details.)</p>
+<p>Under Linux, the <tt>install.sh</tt> 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 <tt>--esp</tt> option, or to a non-boot HFS+ partition by using the <tt>--ownhfs <tt class="variable">devicefile</tt></tt> option. Under either OS, you can install to something other than the currently-running OS by using the <tt>--root <tt class="variable">/mountpoint</tt></tt> option. (See <a href="#table1">Table 1</a> for details.)</p>
+
+<p>Under Linux, <tt>install.sh</tt> will be most reliable if your ESP is already mounted at <tt>/boot</tt> or <tt>/boot/efi</tt>, as described in more detail in the <a href="#linux">Installing rEFInd Manually Using Linux</a> section. (If you installed Linux in EFI mode, chances are your ESP is properly mounted.) If your ESP is not so mounted, <tt>install.sh</tt> will attempt to locate and mount an ESP, but this action is not guaranteed to work correctly. If you run <tt>install.sh</tt> 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 <a href="#mvrefind"><tt>mvrefind.sh</tt> script.</a></p>
 
-<p>Before running this script under Linux, you should ensure that your ESP is mounted at <tt>/boot</tt> or <tt>/boot/efi</tt>, as described in more detail in the <a href="#linux">Installing rEFInd Manually Using Linux</a> 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 <tt>install.sh</tt> 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 <a href="#mvrefind"><tt>mvrefind.sh</tt> script.</a></p>
+<p>Under OS X, <tt>install.sh</tt> attempts to install rEFInd to the OS X root partition by default. You can pass the script the <tt>--esp</tt> or <tt>--ownhfs <tt class="variable">device-file</tt></tt> option, as noted in <a href="#table1">Table 1,</a> to modify the installation location. This is helpful, and even necessary, in some cases, such as when your computer uses whole-disk encryption or if you use suspend-to-disk features.</p>
 
 <p>A sample run under Linux looks something like this:</p>
 
@@ -292,7 +296,8 @@ Installation has completed successfully.</pre>
     run the script.</li>
 
 <li>If you're using OS X 10.7's Whole Disk Encryption (WDE) feature, you
-    <i>must</i> install rEFInd to the ESP, so the <tt>--esp</tt> option to
+    <i>must</i> install rEFInd to the ESP, so the <tt>--esp</tt> or
+    <tt>--ownhfs <tt class="variable">device-file</tt></tt> option to
     <tt>install.sh</tt> is required. I'm still a little bit foggy about
     what's required to boot the system once this is done; see <a
     href="https://sourceforge.net/p/refind/discussion/general/thread/5c7d0195/">this
@@ -348,7 +353,8 @@ Installation has completed successfully.</pre>
 <p>In addition to these quirks, you should be aware of some options that <tt>install.sh</tt> supports to enable you to customize your installation in various ways. The syntax for <tt>install.sh</tt> is as follows:</p>
 
 <pre class="listing">
-install.sh [--esp | --usedefault <tt class="variable">device-file</tt> | --root <tt class="variable">mount-point</tt> ] \
+install.sh [--esp | --usedefault <tt class="variable">device-file</tt> | --root <tt class="variable">mount-point</tt> | \
+            --ownhfs <tt class="variable">device-file</tt> ] \
            [--nodrivers | --alldrivers] [--shim <tt class="variable">shim-filename</tt>] [--localkeys] [--yes]
 </pre>
 
@@ -367,6 +373,10 @@ install.sh [--esp | --usedefault <tt class="variable">device-file</tt> | --root
    <td><tt>--usedefault <tt class="variable">device-file</tt></tt></td>
    <td>You can install rEFInd to a disk using the default/fallback filename of <tt>EFI/BOOT/bootx64.efi</tt> (and <tt>EFI/BOOT/bootia32.efi</tt>, if the 32-bit build is available) using this option. The <tt class="variable">device-file</tt> should be an <i>unmounted</i> ESP, or at least a FAT partition, as in <tt>--usedefault /dev/sdc1</tt>. Your computer's NVRAM entries will <i>not</i> be modified when installing in this way. The intent is that you can create a bootable USB flash drive or install rEFInd on a computer that tends to "forget" its NVRAM settings with this option. This option is mutually exclusive with <tt>--esp</tt> and <tt>--root</tt> (except for implicit use of <tt>--esp</tt> on Linux).</td>
 </tr>
+<tr>
+   <td><tt>--ownhfs <tt class="variable">device-file</tt></tt></td>
+   <td>This option should be used <i>only</i> under OS X. It's used to install rEFInd to an HFS+ volume <i>other than</i> a standard Mac boot volume. The result should be that rEFInd will show up in the Mac's own boot manager. More importantly, suspend-to-RAM operations may work correctly. Note that this option requires an HFS+ volume that is <i>not</i> currently an OS X boot volume. This can be a data volume or a dedicated rEFInd partition. The ESP might also work, if it's converted to use HFS+.</td>
+</tr>
 <tr>
    <td><tt>--root <tt class="variable">/mount-point</tt></tt></td>
    <td>This option is intended to help install rEFInd from a "live CD" or other emergency system. To use it, you should mount your regular installation at <tt class="variable">/mount-point</tt>, including your <tt>/boot</tt> directory (if it's separate) at <tt class="variable">/mount-point</tt><tt>/boot</tt> and (on Linux) your ESP at that location or at <tt class="variable">/mount-point</tt><tt>/boot/efi</tt>. The <tt>install.sh</tt> script then installs rEFInd to the appropriate location&mdash;on Linux, <tt class="variable">/mount-point</tt><tt>/boot/EFI/refind</tt> or <tt class="variable">/mount-point</tt><tt>/boot/efi/EFI/refind</tt>, depending on where you've mounted your ESP; or on OS X, to <tt class="variable">/mount-point</tt><tt>/EFI/refind</tt>. The script also adds an entry to your NVRAM for rEFInd at this location. You cannot use this option with either <tt>--esp</tt> or <tt>--usedefault</tt>, except for implicit use of <tt>--esp</tt> on Linux. Note that this option is <i>not</i> needed when doing a dual-boot Linux/OS X installation; just install normally in OS X.</td>
@@ -431,7 +441,7 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
 
 <li>Rename the configuration file by typing <tt><b>mv refind.conf-sample refind.conf</b></tt>. Consult the <a href="configfile.html">Editing the rEFInd Configuration File</a> page for information on how to adjust your options.</li>
 
-<p class="sidebar"><b>Weird:</b> A <a href="http://mjg59.dreamwidth.org/20187.html">bug exists</a> in some Lenovo computers (and perhaps in some others, too) that causes the firmware's boot manager to refuse to boot any boot loader that doesn't have the name <tt>Windows Boot Manager</tt> or <tt>Red Hat Enterprise Linux</tt>. If you have such a system, you must pass one of those names (in quotes) rather than <tt>rEFInd</tt> to <tt>efibootmgr</tt> via its <tt>-L</tt> option. This bug was reported to Lenovo in mid-November 2012, so with any luck updated firmware without this bug will be available later this year or early in 2013. I can make no promises about this, though.</p>
+<p class="sidebar"><b>Weird:</b> A <a href="http://mjg59.dreamwidth.org/20187.html">bug exists</a> in some Lenovo computers (and perhaps in some others, too) that causes the firmware's boot manager to refuse to boot any boot loader that doesn't have the name <tt>Windows Boot Manager</tt> or <tt>Red Hat Enterprise Linux</tt>. If you have such a system, you must pass one of those names (in quotes) rather than <tt>rEFInd</tt> to <tt>efibootmgr</tt> via its <tt>-L</tt> option. This bug was reported to Lenovo in mid-November 2012, and by late 2013, at least some Lenovos were mercifully free of this bug.</p>
 
 <a name="efibootmgr">
 <li>On a UEFI-based system, type <tt><b>efibootmgr -c -l \\EFI\\refind\\refind_x64.efi -L rEFInd</b></tt> 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 <tt>/dev/sda1</tt> or if your configuration is otherwise unusual; consult the <tt>efibootmgr</tt> 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 <tt>shim.efi</tt> rather than the rEFInd binary, and rename <tt>refind_x64.efi</tt> to <tt>grubx64.efi</tt>.</li>
@@ -592,6 +602,8 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 <h3>Installing rEFInd Manually Using an EFI Shell</h3>
 </a>
 
+<p class="sidebar"><b>Warning:</b> Do not attempt to use the procedure described in this section on a Macintosh. Macs have a strange EFI implementation that does not use the EFI variables that this procedure manipulates. Therefore, chances are this procedure simply won't work. It's conceivable that this procedure will actually cause problems, but I'm not curious enough to try it and risk damaging my Mac!</p>
+
 <p>If you can't currently boot any OS (say, because a firmware update has wiped your NVRAM entries), you may find it convenient to install rEFInd using an EFI version 2 shell. Unfortunately, the <tt>bcfg</tt> command described here is not available in the EFI version 1 shell, and the version 2 shell is unusable on many firmware implementations prior to 2.3.1. Thus, this procedure won't work for all systems.</p>
 
 <p>In addition to emergency situations, using <tt>bcfg</tt> can be desirable if <tt>efibootmgr</tt> or other OS-hosted tools don't do the job. This happens under VirtualBox, for instance. An alternative in such cases can be to use <a href="#naming">alternative names for rEFInd.</a></p>
@@ -691,6 +703,20 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 
 <p>With any luck, rEFInd will start up at this point. If not, you can check your settings using a shell or an emergency system for your OS of choice. In an EFI shell, you might type <tt class="userinput">bcfg boot dump -b</tt> to view your boot loader entries and verify that rEFInd appears at the top of the list. Be sure to check the pathname for typos. If you continue to have problems, you might look into giving rEFInd a <a href="#naming">fallback filename</a> that your firmware will recognize.</p>
 
+<a name="wde">
+<h2>Using OS X Whole-Disk Encryption</h2>
+</a>
+
+<p>If you're using OS X's Whole-Disk Encryption (WDE) feature, you must do two extra things:</p>
+
+<ul>
+
+<li>You must install rEFInd to the ESP. Unfortunately, as described earlier, this can result in a delay (usually of 30 seconds) as the firmware launches rEFInd. See the upcoming <a href="#sluggish">section on fixing sluggish Mac boots</a> if you run into this problem.</li>
+
+<li>You must uncomment the <tt>dont_scan_volumes</tt> line in <tt>refind.conf</tt> and ensure that <tt>"Recovery HD"</tt> is <i>not</i> among its options. (You can use a blank line or provide a dummy value if you want to scan all your volumes.) Alternatively, you can create a manual boot stanza to boot OS X.</li>
+
+</ul>
+
 <a name="naming">
 <h2>Alternative Naming Options</h2>
 </a>
@@ -834,7 +860,7 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 
 <li><b><a
     href="http://tianocore.git.sourceforge.net/git/gitweb.cgi?p=tianocore/edk2;a=blob_plain;f=EdkShellBinPkg/FullShell/X64/Shell_Full.efi;hb=HEAD"><tt>shell.efi</tt></a></b>&mdash;This
-    file, placed in the ESP's <tt>efi/tools</tt> directory, adds the
+    file, placed in the ESP's <tt>EFI/tools</tt> directory, adds the
     ability to launch a text-mode EFI shell from rEFInd. Note that the
     download link is to a 64-bit binary that must be renamed before rEFInd
     will recognize it. Additional shell download links appear on the <a
@@ -842,6 +868,24 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
     Linux wiki,</a> and on other sites; try a Web search if the shell you
     find doesn't work to your satisfaction.</li>
 
+<li><b><a
+    href="http://www.memtest86.com/download.htm">Memtest86</a></b>&mdash;This
+    is a popular tool for performing basic hardware tests, and especially
+    memory tests. rEFInd recognizes this program when it is stored in the
+    <tt>EFI/tools</tt>, <tt>EFI/tools/memtest</tt>,
+    <tt>EFI/tools/memtest86</tt>, <tt>EFI/memtest</tt>, or
+    <tt>EFI/memtest86</tt> directory, with a program filename of
+    <tt>memtest86.efi</tt>, <tt>memtest86_x64.efi</tt>,
+    <tt>memtest86x64.efi</tt>, or <tt>bootx64.efi</tt>. (Change
+    <tt>x64</tt> to <tt>ia32</tt> on IA-32 systems.) Be sure to download
+    the EFI version of the program. If you get the USB flash drive version,
+    you should mount the flash drive's ESP (partition 2) and copy the
+    <tt>EFI/BOOT</tt> directory to your own ESP's
+    <tt>EFI/tools/memtest</tt> or other Memtest86 directory name, as just
+    specified. rEFInd should then recognize it, provided the
+    <tt>showtools</tt> line includes the <tt>memtest</tt> or
+    <tt>memtest86</tt> token.</li>
+
 <li><b><tt>gptsync.efi</tt> or <tt>gptsync_<tt
     class="variable">arch</tt>.efi</tt></b>&mdash;This program creates a <a
     href="http://www.rodsbooks.com/gdisk/hybrid.html">hybrid MBR</a> from
@@ -902,13 +946,17 @@ $ <b>ioreg -l -p IODeviceTree | grep firmware-abi</b>
 
 <p>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.</p>
 
-<p>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 <tt>force</tt> option to <tt>mount</tt>; 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 <tt>/boot</tt> 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.</p>
+<p>A variant of this solution is to create a small (~100MiB) HFS+ volume to be used exclusively by rEFInd. You can then install rEFInd to that volume with the <tt>--ownhfs</tt> option to <tt>install.sh</tt>, as in <tt class="userinput">./install.sh --ownhfs /dev/disk0s6</tt> if the volume is <tt>/dev/disk0s6</tt>. This approach has the advantage that it can be managed via OS X's own Startup Disk tool in System Preferences.</p>
+
+<p>The biggest drawback to storing rEFInd on an HFS+ volume 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 <tt>force</tt> option to <tt>mount</tt>; however, this procedure is noted as being risky in the Linux HFS+ documentation, so I don't recommend doing this on a regular basis on the OS X boot volume. This isn't as risky if you use a dedicated HFS+ rEFInd partition, though. You could even mount it as the Linux <tt>/boot</tt> partition, in which case it would also hold the Linux kernel and related files. If you use disk encryption, you can't store rEFInd on the OS X root (<tt>/</tt>) partition, but you could still use an (unencrypted) separate HFS+ partition.</p>
+
+<p>A variant of this solution is suggested in <a href="http://www.sparxeng.com/blog/software/fixing-slow-boot-on-a-triple-boot-mountain-lion-mac">this blog post,</a> which recommends placing rEFInd on an HFS+ volume on the first SATA channel. (In the blogger's case, that channel used to hold an optical drive, but that drive was replaced by a hard disk.)</p>
 
 <a name="fallback">
 <h3>Using the Fallback Filename</h3>
 </a>
 
-<p>I've received one report that installing rEFInd to the ESP using the fallback filename (<tt>EFI/BOOT/bootx64.efi</tt> on most systems, or <tt>EFI/BOOT/bootia32.efi</tt> on very old Macs) can work around the problem.</p>
+<p>I've received a few reports that installing rEFInd to the ESP using the fallback filename (<tt>EFI/BOOT/bootx64.efi</tt> on most systems, or <tt>EFI/BOOT/bootia32.efi</tt> on very old Macs) can work around the problem.</p>
 
 <a name="clearing">
 <h3>Clearing the NVRAM Entries</h3>
@@ -975,7 +1023,7 @@ Boot0007* CD/DVD Drive</pre>
 
 <hr />
 
-<p>copyright &copy; 2012&ndash;2013 by Roderick W. Smith</p>
+<p>copyright &copy; 2012&ndash;2014 by Roderick W. Smith</p>
 
 <p>This document is licensed under the terms of the <a href="FDL-1.3.txt">GNU Free Documentation License (FDL), version 1.3.</a></p>