No Battery Adventures using a MacBook Pro 13 (Early 2015)

  1. Battery Requires Removal
    1. Manually limit CPU frequency upperbound
    2. Use Airplane Mode
    3. Minimize Ambient Temperature
  2. Reinstalling the Battery
    1. Startup Boot Repair
  3. Remarks

Battery Requires Removal

While working on my MacBook Pro, I noticed that the four laptop foot pads no longer made contact with the desk evenly, but rather the front two pads were lifted off the surface. The center of the laptop bulged slightly, deforming the track pad and spacebar key slightly.

After opening up the laptop, I saw that all my lithium ion cells had swollen.
Calling a local Apple repair shop, I was quoted a repair price of approximately $330 for a top case replacement, and $100 for labor.
The associate explained to me that the new batteries were fixed onto the case assembly and could not be sold separately. Additionally, the case assembly replacement would require additional, specialized tools.
(Other shops did not carry a battery or did not perform this repair.)
Therefore, I opted for a third party battery that I could reasonably install myself.

I followed the instructions in this iFixit battery replacement tutorial with no issues.
I did not use adhesive remover, only a hair dryer and a old gym membership card.
There is a slight risk of static discharge and fire.

As I wait for the new battery to arrive, I’ve kept track of the following notes.
The laptop is bootable without a battery.
Using Debian, there is no automatic throttling of the CPU, contrary to these following reference posts.

Manually limit CPU frequency upperbound

The laptop is not stable under high CPU loads.
When under high load, the laptop will now sporadically power off (presumably due to insufficient power).

I used cpufrequtils to manually set the CPU frequency scaling daemon (Debian package).

sudo apt install cpufrequtils
cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 4294.55 ms.
hardware limits: 500 MHz - 3.40 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 500 MHz and 3.40 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 1.02 GHz.
analyzing CPU 1:
driver: intel_pstate
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 4294.55 ms.
hardware limits: 500 MHz - 3.40 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 500 MHz and 3.40 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 924 MHz.
analyzing CPU 2:
driver: intel_pstate
CPUs which run at the same hardware frequency: 2
CPUs which need to have their frequency coordinated by software: 2
maximum transition latency: 4294.55 ms.
hardware limits: 500 MHz - 3.40 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 500 MHz and 3.40 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 918 MHz.
analyzing CPU 3:
driver: intel_pstate
CPUs which run at the same hardware frequency: 3
CPUs which need to have their frequency coordinated by software: 3
maximum transition latency: 4294.55 ms.
hardware limits: 500 MHz - 3.40 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 500 MHz and 3.40 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 942 MHz.

The first step is to manually limit the cpu upper frequency to a reduced value.
I arbitrarily chose 1.2GHz, further fine tuning to determine higher maximum is necessary.

# as root, each CPU core must be set independently
cpufreq-set -g powersave -u 1.2GHz -c0
cpufreq-set -g powersave -u 1.2GHz -c1
cpufreq-set -g powersave -u 1.2GHz -c2
cpufreq-set -g powersave -u 1.2GHz -c3

When running cpufreq-info, the current policy should now indicate the new upper and lower bounds.

...
current policy: frequency should be within 500 MHz and 1.20 GHz.

These settings are valid for the current session and will revert back to defaults on reboot.

Use Airplane Mode

Whenever possible, avoid using wireless communication methods (WiFi, Bluetooth) and opt for the wired connection alternative.

Minimize Ambient Temperature

Even if the cpu clock speed is limited, if the surrounding temperature is high, there is a higher probability that the laptop will sporadically shut off.
My hypothesis is that there is not enough available power to run the fans at high speed. The MacBook Pro relies heavily on passive cooling through the metal case underbody, so using an externally powered laptop cooling fan may be prudent.

Reinstalling the Battery

Although the physical process of installing the battery hardware was straight forward, there were additional issues trying to get the laptop battery detected by my operating system.
The following steps were performed to get my laptop back into a usable state, beginning with the laptop powered off and the battery freshly installed.

  1. Connect the charger/power adapter to the MacBook. Wait until the adapter’s amber light becomes green, indicating that the battery is fully charged.
  2. Reset the system management controller (SMC) by pressing and holding Shift + Control + Option (Alt) + Power Button for at least 10 seconds. The SMC will indicate that it has been reset if the light on the magsafe connector blinks. Immediately transition to the next step to avoid having the laptop start, although if it does start simply power it off.
  3. Reset the nonvolatile random-access memory (NVRAM) and parameter ram (PRAM) by pressing and holding Option (Alt) + Command + P + R for at least 20 seconds. The startup sound should chime, the keys may be released after the second startup sound.

It was at this point that I tried to boot into my Debian OS, but my battery was not recognized (despite the laptop functioning without the adapter plugged in).
I repeated the SMC and NVRAM/PRAM reset steps before booting into OSX Recovery Mode by holding down Command + R during start up.
After booting into recovery mode, the laptop could detect the battery and I was satisfied that the hardware installation was correct.
Unfortunately, after another reboot, the laptop was unable to boot into Debian, showing an error indicating no startup disks were present.

Startup Boot Repair

To repair the laptop without a hard reinstall of the operating system, I created an Ubuntu 20.04 LTS live-usb on a separate device. I used the boot-repair tool to fix my laptop’s boot issues.

  1. Plug the Ubuntu bootable USB into the MacBook. Press and hold Option (Alt) and select the EFI-Boot option with the external media symbol. When prompted with the Ubuntu installation screen, choose to Try Ubuntu.
  2. Once internet connection has been established, install the boot-repair tool:
    sudo su
    add-apt-repository ppa:yannubuntu/boot-repair
    apt-get update
    apt-get install -y boot-repair
    boot-repair
  3. If LUKS encrypted partitions are used:
    1. Ensure that the required packages are available on the live linux image.
      sudo apt-get update
      sudo apt-get install lvm2 cryptsetup
    2. Probe the required module and determine the encrypted drive.
      sudo modprobe dm-crypt
      sudo fdisk -l
    3. Mount the encrypted volume (in my case /dev/sda3):
      sudo cryptsetup luksOpen /dev/sda3 myvolume
    4. Ensure that the system is aware of the LVM entities.
      sudo vgscan
      sudo vgchange -ay
    5. Mount all remaining partitions.
      mkdir boot_efi && mount /dev/sda1 boot_efi
      mkdir boot && mount /dev/sda2 boot
  4. Run boot-repair. Without changing any settings, follow the prompted instructions and restart after the tool completes.
    • Note: If additional problems persist, it may be necessary to repeat the above steps, disabling Secure Boot.

You should now have a functional laptop again with the battery being detected by the operating system.

To promote battery health and extend its shelf life, be sure to properly calibrate your laptop battery.
Battery calibration is defined by charging until 100%, removing the power adapter and using the laptop normally until it powers off, then charging it up to 100% again.
The manufacturer’s pamphlet suggests performing this step every two/three months.

Remarks

It was disappointing to see how complicated this process became.
I do not expect the average user to be able to be able to remove a swollen lithium ion battery from the laptop, given the copious amounts of adhesive sticking the battery to the aluminum body frame.
Additionally, the usage of the crippled laptop while waiting for the new battery to arrive remained a difficult experience.
Even with manual throttling of CPU clock frequency, ambient temperatures and other energy demanding activities also meant that the laptop was prone to random power off events.
Installing the battery was not a simple plug-and-play event, requiring additional steps to enable battery recognition and needing a boot repair step (possibly due to the MacOSX recovery mode step, unclear if boot corruption was caused by NVRAM/PRAM/SMC reset steps).

It is unlikely that I will purchase another MacBook device in the future.
I do not have solid recommendations for laptop hardware purchases, with only a mediocre experience with the Dell XPS series.