Julien Palard

Python Developer and Trainer

Black screen at boot on my PinePhone

OK so today my PinePhone does no longer boot, it goes like this:

My first bet was a graphical issue due to a recent upgrade ("sweet" memories of Ubuntu failing to start its X server after almost any upgrade...) so I try to ssh to it first... "no route to host", damned! It don't have its IP yet so it failed before network setup.

But it's a PinePhone, and it runs Mobian, a Debian for mobiles, so I'm not in the dark, let's read the boot logs first before going down the rabbit hole of connecting a UART on the jack port to debug it over serial:

The root filesystem on /dev/mapper/calamares_crypt requires a manual fsck

OK!

Looks easy, but without a keyboard? Let's mount the eMMC over USB!

As my phone boots using Tow-Boot it's easy:

At this point I think there's just two options: either my USB-C cable was badly plugged, or my eMMC is dead. I vote for the USB-C cable issue and try again.

I use encryption so to fsck the root partition, I have to use cryptsetup first:

$ sudo cryptsetup open /dev/sda2 mobian  # it asks for my passphrase
$ file /dev/mapper/mobian  # That's the unencrypted view of my partition
/dev/mapper/mobian: symbolic link to ../dm-0
$ sudo fdisk -l /dev/mapper/mobian  # Just out of curiosity
Disk /dev/mapper/mobian : 28.47 GiB, 30574379008 octets, 59715584 secteurs
$ sudo fsck /dev/mapper/mobian  # Running fsck manually!
fsck from util-linux 2.38.1
e2fsck 1.46.6-rc1 (12-Sep-2022)
root contains a file system with errors, check forced.
[many many errors]
$ sudo mount /dev/mapper/mobian /mnt  # To check if it works
$ ls /mnt  # Yeah!
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
$ sudo umount /mnt
$ sudo cryptsetup close mobian

It looks OK, let's reboot the phone...

It works!!!

I know, your grandma would not be able to do fix it that way (mine neither), but I'm still very happy to be able to fix my phone myself when it has issues.

What would people do when a phone does no longer boot? Buy another?