On Wed 01 Sep 2021 at 16:00:13 (-0700), David Christensen wrote: [three long posts]
That was very useful. I've condensed it into a file (attached) for my own use. The footnotes are notes, guesses and queries. My main question is — there are three identical listings taken at different times; all say: > # mount | grep '.dev.sd' > /dev/sdb3 on / type ext4 (rw,relatime,errors=remount-ro) > /dev/sdb1 on /boot/efi type vfat > (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro) and yet two are labelled as wrong, and the third as correct. I found the device letters a bit confusing when you're running the rescue system. AFAICT, sda is always the SSD. So I was perplexed by "Rescue operations -> Execute shell in /dev/sda3" because your SSD only appeared to have two partitions in the OP. What seems to be missing from the account is any consideration of the so-called NVRAM variables, about which I know nothing. I'm still working through how hiding the EFI/debian tree makes the option-less booting suddenly work, but then, I don't know how closely the Option key corresponds to pressing F12 on, say, a Dell PC, which is how you set the device boot order. (I haven't touched a Mac since the last century when they were in a little AiO box.) Cheers, David.
Post 1 (31 Aug 2021 15:31:43 -0700) Option boot with d-i inserted: Select an EFI Boot disk (unclear whether SSD vs USB, or USB's bootx64.efi vs grubx64.efi) Install buster onto newly inserted USB → "buster-mac" Debian tree for ESP (silently) onto SSD's ESP¹ Boot with USB inserted (twice): SSD's ESP debian tree points to USB buster-mac runs Boot without USB inserted: SSD's ESP Debian tree points to USB Grub> Option boot without USB inserted: Sees SSD MacBook firmware starts macOS Command-R boot: MacBook firmware stuff Boot with USB inserted: SSD's ESP Debian tree points to USB buster-mac runs again fdisk shows Mac OS on sdX2, buster-mac on sdX3 SSD's ESP is mounted at /boot/efi SSD's ESP contains APPLE and debian Post 2 (31 Aug 2021 17:39:37 -0700) Option boot with USB inserted: Still sees only SSD Boot with USB inserted (perhaps continuing from Option boot): buster-mac runs Listing of d-i's ESP with bootx64.efi² and grubx64.efi USB's ESP is empty Repeat listing of SSD's ESP Ruminations on copying files³ Post 3 (1 Sep 2021 16:00:13 -0700) Boot Rescue with d-i inserted: Insert USB Select USB's / as root filesystem Execute a shell in sda3⁴ Edit /etc/fstab to mount USB's ESP, not SSD's Mount USB's ESP Install Grub, choosing USB's ESP Boot with d-i and USB inserted: Something⁵ displays a Grub menu buster-mac selected and runs Boot with USB inserted: buster-mac selected and runs Reports "Mount device for /boot/efi is wrong⁶ -- still using internal SSD, not USB flash drive." Boot Rescue with d-i inserted: Insert USB Select USB's / as root filesystem Install Grub, forcing "Removable media path"⁷ Boot with d-i and USB inserted: Something⁵ displays a Grub menu buster-mac selected and runs Boot with USB inserted: buster-mac selected and runs Reports "Wrong⁶ -- internal SSD ESP is mounted at /boot/efi." Option boot with USB inserted: Sees SSD and EFI Boot⁸ EFI Boot selection starts buster-mac Reports success after the same listing as the two "failures" Boot with or without USB inserted: macOS runs, buster-mac never runs Option boot with USB inserted: Sees SSD and EFI Boot⁸ EFI Boot selection starts buster-mac Mount SSD's ESP Move the SSD's ESP debian tree, leaving the APPLE one Boot with USB inserted: buster-mac runs (no Option/selection needed now) Listing USB's ESP, identical to a standard Debian installation's Listing of fstab mentions sdd in the comments, rather than sdc⁹ ¹ Not the desired result, of course ² I think bootx64.efi might be the secure boot shim? ³ Copying EFI files might not be enough: what about NVRAM variables? ⁴ Does sda3 exist (on the SSD)? ⁵ Presumably USB ESP could do this, and perhaps SSD ESP as well ⁶ Not sure why: buster-mac has sdb3 on / and sdb1 on /boot/efi Both these are on sdb which is the USB There are three identical lists from mount | grep '.dev.sd' ⁷ Is this these three files? /boot/efi/EFI/BOOT/* ⁸ How different is this selection screen from the very first one? ⁹ Was sdc the firmware stick during the original installation?