--- Title: Black screen at boot on my PinePhone Date: 2023-01-13 09:33:00 Summary: My phone was no longer booting… --- OK so today my [PinePhone](https://fr.wikipedia.org/wiki/PinePhone) does no longer boot, it goes like this: - Press power button to boot it, - type rootfs passphrase (I use full disk encryption), - Mobian "spash screen" for a short time, - black screen, and that's it. 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](https://mobian-project.org/), 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: - Press power button, - type rootfs passphrase again, - press a volume button to get rid of the Mobian splash to see logs ```text The root filesystem on /dev/mapper/calamares_crypt requires a manual fsck ``` OK! Looks easy, but without a keyboard? Let's mount the [eMMC](https://en.wikipedia.org/wiki/MultiMediaCard#eMMC) over USB! As my phone boots using [Tow-Boot](https://tow-boot.org/) it's easy: - Shut it down (~8s on the power button). - Plug it to laptop with a USB-C cable. - Make it enter "USB Mass Storage mode" (by holding the volume up button at startup before and during the second vibration). - Instantly my laptop sees it and udisks auto mounts it, gnome asks for main partition passphrase to mount it too, nice! - Boom, it disappears... and on `journalctl -e` I see `usb 1-5: device descriptor read/64, error -71` ... `I/O error, dev sda` ... 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. - Rebooting phone in USB mass storage mode again, but this time without giving my passphrase to avoid automount: it needs an fsck anyway. - I can browse `/media/mdk/boot` and see no read error in `sudo journalctl -f`. - `sudo fdisk -l /dev/sda` sees ~30GiB and both partitions. I use encryption so to fsck the root partition, I have to use `cryptsetup` first: ```bash $ 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?