.. include:: ../urls.rst .. _l5_troubleshooting_repairing_broken_installation: .. meta:: :keywords: broken byzantium pureos recover Repairing a broken installation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are a few options to recover data and attempt to recover the operating system. .. caution:: These instructions are relatively technical in nature and should only be performed by someone comfortable with technical instructions. Back up any files you need from your device. You can do this by booting Jumpdrive on the phone and copying your files to a Linux PC using the steps below: .. _l5_troubleshooting_repairing_broken_installation_back_up: Back up important files using Jumpdrive --------------------------------------- .. _l5_troubleshooting_repairing_broken_installation_back_up_download_jumpdrive: Download and extract Jumpdrive ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Follow these instructions on a Linux host computer: #. Download the `latest build `_ of Jumpdrive #. Open the **Files** app, and select **Downloads** on the left side bar #. Find ``purism-librem5.tar.xz`` and right-click it to show the menu #. Select **Extract Here** #. Open the new folder, **purism-librem5** #. Right-click in the blank space and select **Open in Terminal** #. In the terminal, run this command to install ``uuu``: .. code:: bash sudo apt install -y uuu #. If prompted for your password, type it and press Enter. Nothing will be shown while typing your password. For security reasons, just type it and press Enter. #. Leave the terminal open and proceed to the next steps. .. _l5_troubleshooting_repairing_broken_installation_back_up_flash_mode: Put the phone in flash mode ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. note:: This does not affect your stored data on the phone. #. Fully power off the phone. #. :ref:`Disable ` all :ref:`hardware killswitches `. #. :ref:`Remove the battery ` from the phone. #. Plug in the USB cable to your Linux PC. #. Hold the **volume-up** button on the phone. #. Plug in the USB cable to the phone. The notification LED should blink red. A green notification LED should not appear. #. :ref:`Reinsert the phone battery `. The notification LED will appear solid red. #. Release the **volume-up** button on the phone. .. _l5_troubleshooting_repairing_broken_installation_back_up_start_jumpdrive: Start Jumpdrive and open the Librem 5 disk on your PC ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. On your Linux PC, in the terminal you opened, run this command: .. code:: bash sudo ./boot-purism-librem5.sh #. Type your password if prompted and press Enter. Nothing will be shown while typing your password. For security reasons, just type it and press Enter. #. After a few seconds, the Librem 5 will show an image and say "Jumpdrive is running" #. Your PC will prompt for a passphrase to access the Librem 5. Enter the passphrase you use when booting the Librem 5, then click **Unlock**. .. seealso:: :ref:`Default phone password ` .. _l5_troubleshooting_repairing_broken_installation_back_up_retrieve_files: Retrieve Files ^^^^^^^^^^^^^^ #. Open **Files** or return to the window you opened in step 1. #. Look for the Librem 5 disk in the left sidebar. For Librem 5 and Librem 5 USA, you will see **31 GB Volume**. For Liberty Phone, you will see **127 GB Volume**. Select that volume. #. Open the **home** folder, then the **purism** folder. #. This is your home directory on the Librem 5. Locate any files you would like to save, and copy them to your PC. ``chroot`` into the Librem 5 installation and try repairing the installation. .. _l5_troubleshooting_repairing_broken_installation_repair: Try to repair your installation ------------------------------- .. _l5_troubleshooting_repairing_broken_installation_repair_terminal: Open a Terminal in the Librem 5 root ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. Use ``lsblk`` to see where the root and boot partitions are mounted. We mounted root above, GNOME probably mounted boot automatically already. On PureOS/Debian, it'll be something like ``/media//`` #. ``cd`` to the root partition. If you list with ``ls`` you should see ``bin``, ``dev``, ``boot``, ``etc`` and other directories. .. _l5_troubleshooting_repairing_broken_installation_repair_mount: Mount the boot and system directories needed for chroot ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. Bind-mount the boot partition. Use the location found above, and don't forget the ``.`` in ``./boot``. .. code:: bash sudo mount -o bind /media// ./boot sudo mount -o bind /dev ./dev sudo mount -o bind /sys ./sys sudo mount -o bind /proc ./proc .. _l5_troubleshooting_repairing_broken_installation_repair_chroot: ``chroot`` into the installation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. Install these PureOS/Debian packages if you don't already have them: .. code:: bash qemu qemu-user-static binfmt-support #. ``chroot`` into the phone OS while still in the Librem 5 root directory: .. code:: bash sudo chroot . .. _l5_troubleshooting_repairing_broken_installation_repair_check: Check for common problems ^^^^^^^^^^^^^^^^^^^^^^^^^ .. important:: Execute the following commands inside the chroot. #. Check if your boot partition is full. This will sometimes cause an update failure: .. code:: bash df -h /boot #. If it has less than 100 MB free space, try to remove dpkg backup initrds: .. code:: bash rm /boot/initrd*.dpkg-bak #. Check again: .. code:: bash `df -h /boot #. If it still has less than 100 MB free space, try to remove any old kernels. This may remove other unreferenced packages if any exist. .. code:: bash apt autoremove #. Try to repair any broken packages: .. code:: bash apt --fix-broken install .. _l5_troubleshooting_repairing_broken_installation_repair_cleanup: Clean up ^^^^^^^^ #. Exit the chroot: .. code:: bash exit #. While still working from within the chroot directory, unmount partitions from the chroot: .. code:: bash sudo umount ./{boot,dev,proc,sys} #. Close the terminal tab or window #. Unmount the Librem 5 using the eject button in GNOME Files #. Unplug the USB-C cable from the Librem 5 #. Hold the power button on the phone to power off #. Try to :ref:`power on the phone ` again