Как удалить refind с mac os

Обновлено: 05.07.2024

Disclaimer: This has the potential to destroy all the data on your drive. Make sure you have adequate (and verified working) backups before you proceed. You have been warned!

That being said this should leave all of your data untouched.

I have a mid-2012 15” non-Retina Mac book pro with a 1TB hard drive. I decided that I wanted to make my system faster by replacing the hard drive with an ssd and while I was at it I decided I also wanted to have Windows and Ubuntu partitions. Doing it this way meant that I had no data on the SSD while I experimented with partitions and boot managers although everything I did should be possible on a drive with an existing system.

  • Multiple OSs installed with the ability to add more
  • A nice, manageable boot loader
  • Full disk encryption for macOS using filevault
  • A Mac running a recent-ish version of macOS
  • A linux ISO or install disk (Any should work but I picked Ubuntu Desktop)
  • A windows iso or install disk
  • An extra flash drive (may not be needed but can be very useful)
  • A macOS installer for your chosen version of macOS (can be downloaded from the App Store)
  • A second computer (again, may not be needed but also might be essential for troubleshooting)
  • A copy of rEFInd
  • a wired internet connection (in my experience this was necessary in order to get wifi working on Ubuntu but you mileage may vary)

Part 1: Installing rEFInd

These instructions assume an x86_64 architecture, if you for some reason have something different then you will need to pick a different set of files to copy across.

  1. Disable System Integrity Protections: this sounds bad but in order to mess with the EFI boot loader you have to do this.
    1. Boot into recovery mode
    2. Open terminal
    3. Run the command: csrutil disable to disable SIP
    • refind/drivers_x64/
    • refind/icons/
    • refind/refind_x64.efi
    • refind/tools_x64/

    Part 2: Partitioning

    Note: For reasons best know to itself, Windows refuses to install on a partition numbered higher than 5 (eg. disk0s5 ). MacOS wil be installed in one of the first partitions since it is already installed and linux doesn’t care where you install it to. Don’t worry about accidentally removing the recovery partition, you can get it back later and removing it my make it easier to get windows to install.

    I felt that windows was the most likely to cause problems so I decided to do it first to minimize my losses if it failed and wiped everything.

    Boot Camp drivers

    In order for windows play nicely with mac hardware you need to install the bootcamp drivers.

    1. Open Boot Camp Assistant and click continue.
    2. On the second page select the option to download the latest Windows support software from apple an follow the instructions. This shouldn't do anything to your hard drive.
    1. Restart the machine to get to the rEFInd menu
    2. Insert the Windows install media and press escape to make reFind regenerate its list of boot options.
    3. Select the Windows installer.
      There will probably be two options where one of them is labled legacy. I have always avoided the legacy options and had good experiences so I would recommend picking the other option.
    4. Once inside the installer, select advanced/custom install
    5. Select the correct partition and reformat it to ntfs.
      If it then complains about the partition table just restart the machine and it might work the second time. If not then you could try repartitioning the drive again.
    6. Finish the installation then install the bootcamp drivers once windows has booted
    7. Fix rEFInd

    The Linux installation process is similar to windows but it doesn't care which partition it is installed into. The exact process will vary between distributions but you will probably want to select the advanced option to make sure it only touches the correct partitions. If there is an option, I would recommend enabling proprietary drivers as this may help make wifi work. After the install is finished you will need to fix rEFInd again.

    Part 5: Filevault

    Try enabling it normally. (Hey, it might work, who knows!) If it complains about a lack of recovery disk then complete the section on recreating the recovery partition and try again.

    Whenever you install a new OS or somtimes when you install updates, one of the operating systems may decide that you EFI boot selection is all broken and that it needs to be fixed. When this happens then when you reboot it will boot straight into that OS and skip rEFInd. Instructions for how to fix this are below and there is a script in the attached file.

    1. Restart and hold down the option key.
      This tells the hardware to skip straight to the mac bootloader, allowing you to bypass your broken EFI settings.
    2. Select your macOS partition to boot from.
    3. Open terminal
    4. Mount the ESP volume:
      mkdir /Volumes/ESP
      mount -t msdos /dev/disk0s1 /Volumes/ESP
    5. Bless the reFind program bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/EFI/REFIND/refind_x64.efi --shortform

    Everything should be fixed now and rEFInd should work as normal

    Recreate Recovery Partition

    1. Download the Recovery Partition tool
      This tool is very simple and does exactly what it claims to do. The only downside in my experience is that it gives no indication of progress.
    2. Run it. You may need to provided it with an installer for your current version of macOS.
    3. Check to see if it worked.
      Restart and hold option. If it worked you should see an option to boot into recovery mode.

    If you got this far then you should still have a working macOS install and in addition you should now be using rEFInd and have one or more other operating systems installed. At this point adding, removing, or changing which OSs you have should be fairly simple and rEFInd should automatically detect them. From time to time installing updates will break you rEFInd configuration but when that happens just follow the instuctions to fix it and everything should be ok. Unfortunately System Integrity Protections are still disabled but if they are enabled again they will make it impossible to fix rEFInd and may break things.


    First Cup of Ubuntu

    How can I remove rEFInd

    I have a Macbook Pro 8,2 and I managed to install Windows 8 and Ubuntu 12.10 along with Mac OS X Mountain Lion.

    To make my life �easier� I decided to install rEFIt, which did not work correctly and did not display all my operative systems, so I uninstalled it by erasing the folder �/efi/refit� using OS X.

    Then I stumbled upon rEFInd, which seemed to be a better option as it had been updated as compared to rEFIt which development seem to have stopped in 2010.

    WHAT HAPPENED:
    Now, rEFInd �worked� in the following manner:


    It�s menu showed the following:

    From left to right.:
    Option 1.- Mac OS X
    Option 2.- vmlinuz-3.5.0-22-generic
    Option 3.- initrd.img-3.5.0-22-generic
    Option 4.- vmlinuz-3.5.0-17-generic
    Option 5.- initrd.img-3.5.0-17-generic
    Option 6.- Linux (Ubuntu)
    Option 7.- Windows 8

    Options 2 � 5: took me to some kind of �Terminal�
    Options 6 & 7: took me to Ubuntu�s booting menu. (Where I could choose from Ubuntu and Windows 8)

    Now, this made having rEFInd useless for my purposes. So I tried the following to remove it.

    I followed the procedure for OS X, which consisted of opening the terminal and doing:

    $ sudo rm -r /EFI/refind � Result: No such directory was found.

    Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
    Try 'modprobe efivars' as root.

    Then ran 'modprobe efivars' in the terminal, but it made no difference.

    Installed and used the automated �Recommended Repair�option.


    CURRENT SITUATION:

    rEFInd initiates upon booting, only Option 1 (OS X) works.

    I need some guidance/help on:
    -Fixing my booting options.
    -Removing rEFInd.

    If I can�t solve it then I would like to know how to reset my Macbook 8,2 to manufacturing settings. (The recovery option does not appear when I press �Alt� upon turning my laptop on)
    Any help would be GREATLY appreciated.

    I recently tried installing rEFInd on Yosemite using the command ./install.sh --alldrivers however it would not recognise the ubuntu 14.04 x64 for Mac disk I made and so I would like to uninstall rEFInd.

    Edit
    Here are my drives if this helps (found using diskutil list

    Ignore disk0s4 because I am going to remove it (that is where my Linux partition would have been)


    4,280 16 16 gold badges 52 52 silver badges 85 85 bronze badges The author of rEFInd recommends not to uninstall, but rather to bypass it. See Uninstalling rEFInd from OS X. If rEFInd did not work, then how are you booting ubuntu.? @DavidAnderson that bypass worked for me. How would I go and reinstall it using different options if I cannot remove it? Could I simply remove the EFI partition or would that corrupt my Mac? "I have tried removing rEFInd from the EFI directory, however the EFI directory does not exist." You have to mount the EFI partition into a directory, first. This is what the answer of davidcondrey does.

    2 Answers 2

    Note: El Capitan (OS X 10.11) prevents users from selecting rEFInd and common Linux distributions from the Startup Disk pane. The new preferred method is to install rEFInd into the an EFI partition. My answer, to an unrelated question, outlines this new preferred method to start the rEFInd Boot Manager and Linux operating systems. The answer, given below, applies to Yosemite (OS X 10.10) and possibly earlier versions of OS X.

    Personally, I installed rEFInd on my computer to its own partition. This prevents the problems you are encountering. Everything ./install.sh installed went to this partition. If I want to remove rEFInd, I can simply erase or remove the partition. Of course both are unnecessary, because I can turn rEFInd on and off at will. I just go to the Startup window in System Preferences select my boot partition. This computer has OS X, Windows, Fedora and rEFInd installed.

    2

    I also can select the boot partition under Windows by using BootCamp and by holding the Option key down at startup. The command diskutil list produces:

    Note, the rEFInd partition is

    1 GB in size. In fact, it can be as small as 100 MB. When I setup this computer, I used the Disk Utility application to create the rEFInd partition. If I would have used the gpt command, I could have created a smaller partition. Neither OS X, Windows, Fedora nor rEFInd use the EFI partition to boot the computer. In fact, there is nothing useful in the EFI partition.

    Answer to your questions:

    How would I go and reinstall it using different options if I cannot remove it? The author of the software never said rEFInd could not be removed. I suggested you just install it again to its own partition. This might be a good place to mention the gpt command has to be run while either booted to an external recover partition or while booted to internet recovery.

    Could I simply remove the EFI partition or would that corrupt my Mac? Do not remove the EFI partition! It is not used to boot OS X, but it is used by OS X for other things.

    I've disabled SIP and tried to install rEFInd on my MacBook, which is not partitioned in any way by boot camp and is one single drive. The install of rEFInd says it is installing to /Volumes/ESP for the EFI boot and completes successfully. After rebooting, however, rEFInd menu does not come up when holding option key or anything. How do I get that installed so that it is usable?


    62.5k 9 9 gold badges 118 118 silver badges 189 189 bronze badges 51 1 1 gold badge 1 1 silver badge 3 3 bronze badges Currently I am running El Capitan with Linux dual boot. I would like to know if it is feasible the upgrade as well.

    3 Answers 3

    After reading through the refind-install script (at version 0.10.4), I discovered that all I needed to do was make sure that the EFI partition was mounted.

    1. From the terminal, run diskutil list to find the EFI partition. In my case this was /dev/disk0s1 .
    2. Mount the EFI partition from the location identified in step 1. For me this was mount /dev/disk0s1
    3. Run the rEFInd install script (from the unzipped rEFInd directory): sudo ./refind-install

    I got friendly output in my terminal: Installation has completed successfully. After this rEFInd worked on my MacBook Pro.

    OP, refind-install already mount the partition, so there is no necessary manual mounting.

    Not sure if this means anything to you as I had rEFInd previously installed and not a fresh install as you are, but quick story so far I had rEFInd installed from the Yosemite days for dual boot OSX and KALI Linux, then updated to El Capitan and had to go back over a few of the steps to get it running again(cant remember which parts).

    I then upgraded to Sierra and thought I had lost rEFInd as I could not mount /Volumes/ESP. Running 'diskutil list' to me it looks like its now called EFI so mounted which on my machine was disk0s1 so 'diskutil mount disk0s1' allowed me to find the lost rEFInd files.

    With regards to the 'bless' part I renamed ESP to EFI and added in another rEFInd folder path so it now read as

    'sudo bless --mount /Volumes/EFI --setBoot --file /Volumes/EFI/efi/refind/refind/refind_x64.efi --shortform'

    On reboot the rEFInd bootload is now replacing the started MAC bootload and is giving me the dual option back.

    To be honest holding 'option key' during boot allowed me to find the rEFInd bootloader, but I never put 2 and 2 together as per the change from ESP to EFI.

    The only thing is the GRUB loader for KALI is no longer working as it used to. Like I say not sure if this means anything to your setup as it a fresh install, but for previously installed rEFInd it worked for me.

    Читайте также: