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:

Back up important files using Jumpdrive

Download and extract Jumpdrive

Follow these instructions on a Linux host computer:

  1. Download the latest build of Jumpdrive

  2. Open the Files app, and select Downloads on the left side bar

  3. Find purism-librem5.tar.xz and right-click it to show the menu

  4. Select Extract Here

  5. Open the new folder, purism-librem5

  6. Right-click in the blank space and select Open in Terminal

  7. In the terminal, run this command to install uuu:

    sudo apt install -y uuu
    
  8. 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.

  9. Leave the terminal open and proceed to the next steps.

Put the phone in flash mode

Note

This does not affect your stored data on the phone.

  1. Fully power off the phone.

  2. Disable all hardware killswitches.

  3. Remove the battery from the phone.

  4. Plug in the USB cable to your Linux PC.

  5. Hold the volume-up button on the phone.

  6. Plug in the USB cable to the phone. The notification LED should blink red. A green notification LED should not appear.

  7. Reinsert the phone battery. The notification LED will appear solid red.

  8. Release the volume-up button on the phone.

Start Jumpdrive and open the Librem 5 disk on your PC

  1. On your Linux PC, in the terminal you opened, run this command:

    sudo ./boot-purism-librem5.sh
    
  2. 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.

  3. After a few seconds, the Librem 5 will show an image and say “Jumpdrive is running”

  4. 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.

Retrieve Files

  1. Open Files or return to the window you opened in step 1.

  2. 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.

  3. Open the home folder, then the purism folder.

  4. 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.

Try to repair your installation

Open a Terminal in the Librem 5 root

  1. 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/<user>/<uuid>

  2. cd to the root partition. If you list with ls you should see bin, dev, boot, etc and other directories.

Mount the boot and system directories needed for chroot

  1. Bind-mount the boot partition. Use the location found above, and don’t forget the . in ./boot.

    sudo mount -o bind /media/<user>/<uuid> ./boot
    sudo mount -o bind /dev ./dev
    sudo mount -o bind /sys ./sys
    sudo mount -o bind /proc ./proc
    

chroot into the installation

  1. Install these PureOS/Debian packages if you don’t already have them:

    qemu qemu-user-static binfmt-support
    
  2. chroot into the phone OS while still in the Librem 5 root directory:

    sudo chroot .
    

Check for common problems

Important

Execute the following commands inside the chroot.

  1. Check if your boot partition is full. This will sometimes cause an update failure:

    df -h /boot
    
  2. If it has less than 100 MB free space, try to remove dpkg backup initrds:

    rm /boot/initrd*.dpkg-bak
    
  3. Check again:

    `df -h /boot
    
  4. 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.

    apt autoremove
    
  5. Try to repair any broken packages:

    apt --fix-broken install
    

Clean up

  1. Exit the chroot:

    exit
    
  2. While still working from within the chroot directory, unmount partitions from the chroot:

    sudo umount ./{boot,dev,proc,sys}
    
  3. Close the terminal tab or window

  4. Unmount the Librem 5 using the eject button in GNOME Files

  5. Unplug the USB-C cable from the Librem 5

  6. Hold the power button on the phone to power off

  7. Try to power on the phone again