문제

After swapping the DVD drive with an SSD, I installed Debian Linux on it. I left the original SSD with OS-X untouched.

  • After a reboot, OS-X (El Capitan) started.
  • After another reboot, pressing Command-R, Linux started.
  • After yet another reboot, without pressing any key, Linux started by default, without the option to boot OS-X.

How can I have the option to boot in OS-X again? Do I have to set grub somehow?

I am using a MacBook Pro 17" 2009 with the original drive running Mac OS X El Capitain.

This is the output of diskutil list:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            250.1 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk1
   1:                        EFI                         248.5 MB   disk1s1
   2:                 Linux Swap                         16.0 GB    disk1s2
   3:           Linux Filesystem                         150.0 GB   disk1s3
   4:           Linux Filesystem                         300.0 GB   disk1s4
   5:                  Apple_HFS shared                  20.0 GB    disk1s5
도움이 되었습니까?

해결책

I installed debian on my computer. I probably did not choose the same configuration as you did. The output from diskutil list disk1 is shown below.

/dev/disk1 (external, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +109.3 GB   disk1
   1:                        EFI NO NAME                 536.9 MB   disk1s1
   2:           Linux Filesystem                         30.0 GB    disk1s2
   3:                 Linux Swap                         1.1 GB     disk1s3
   4:           Linux Filesystem                         77.7 GB    disk1s4

The output above shows the label on my disk1s1 is NO NAME. What concerns me about your output from diskutil list is that there is no label given for disk1s1. Your comment states you can not mount this volume. My conclusion is the FAT32 volume was never created in this partition. One possible explanation is your installation of debian never completed correctly.

Another possibility is you have not included all the steps you preformed before posting your question. For example, it is fairly unlikely the debian installer added partition with the identifier of disk1s5.

If you had installed Debian correctly to your second internal disk, then you have to preform the following steps in macOS to finish the installation. Here, I assume 64 bit version of Debian was installed to use the EFI boot method.

The steps below copy the boot file for grub to the correct location in the EFI partition. This is not only a requirement for the Mac Startup Manager, but is also defined in the UEFI specification.

  1. From a Terminal application window, enter the command diskutil mount disk1s1. A new device representing this partition should appear in the Finder application. If you view the contents of this volume a Finder application window, you should see the same as in the image below.

    a1

  2. Using the Finder application, navigate to this device.

  3. Create a folder labeled boot in the folder EFI.
  4. Copy the file grubx64.efi found in the EFI/debian folder to the EFI/boot folder.
  5. Rename the grubx64.efi file in the EFI/boot folder to bootx64.efi.
  6. From a Terminal application window, enter the command diskutil unmount disk1s1.

If you can boot to the correctly installed Debian operating system, then the above steps can be replaced by commands given below. These commands need to be entered in a Debian Terminal window.

Note: To enter these commands, you will have to know the root users password.

su
mkdir  /boot/efi/efi/boot
cp  /boot/efi/efi/debian/grubx64.efi  /boot/efi/efi/boot/bootx64.efi
exit

Once the changes are made, you can do the following to choose an operating system.

  1. Start or restart your Mac and immediately hold down the option key until the Startup Manager appears.
  2. Select the icon for the desired operating system. Debian will appear with label EFI Boot.
  3. To boot the desired operating system, select the arrow below the chosen icon .

    Note: If you hold down the control key while selecting the arrow, the chosen operating system will be come the default.

다른 팁

  • To boot back in OSX, at startup: press [Alt] key.
  • To boot Linux, at start up: press [Command]+R.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 apple.stackexchange
scroll top