Dual boot: I cannot boot in OS-X, after installing Linux (Debian) 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.


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.


Using the Finder application, navigate to this device.
Create a folder labeled boot in the folder EFI.
Copy the file grubx64.efi found in the EFI/debian folder to the EFI/boot folder.
Rename the  grubx64.efi file in the EFI/boot folder to bootx64.efi.
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.


Start or restart your Mac and immediately hold down the option key until the Startup Manager appears. 
Select the icon for the desired operating system. Debian will appear with label EFI Boot.
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.