Repairing a broken installation¶
There are a few options to recover data and attempt to recover the OS.
Note
These instructions are relatively technical in nature and should only be performed by someone comfortable with technical instructions.
Back up whatever files you need from your device. You can do this by booting Jumpdrive on the Librem 5 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:
Download the latest build
Open the Files app, and select Downloads on the left side bar
Find
purism-librem5.tar.xz
and right-click it to show the menuSelect 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:
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.
Put the Librem 5 in flash mode¶
Note
This does not affect your stored data on the Librem 5.
Fully power off the Librem 5
Turn off all hardware kill switches on the Librem 5(move all to the “bottom” position toward the bottom of the phone)
Remove the battery from the Librem 5
Plug in the USB cable to your Linux PC
Hold the volume-up button on the Librem 5
Plug in the USB cable to the Librem 5. The red light should blink, and you should not see the green light
Reinsert the Librem 5 battery. The red light will become solid
Release the volume-up button on the Librem 5
Start Jumpdrive and open the Librem 5 disk on your PC¶
On your Linux PC, in the terminal you opened, run this command:
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. The default is 123456. Then click Unlock.
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.
You can chroot
into the Librem 5 installation and try repairing the installation.
I’ve included some repair steps that might help, but you might need to look around to see what the actual problem is and improvise.
Try to repair your installation¶
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/<user>/<uuid>
cd
to the root partition. If you list withls
you should seebin
,dev
,boot
,etc
and other directories.
Mount the boot and system directories needed for chroot¶
Bind-mount the boot partition:
sudo mount -o bind /media/<user>/<uuid> ./boot
(use the location found above, and don’t forget the.
in./boot
sudo mount -o bind /dev ./dev
sudo mount -o bind /sys ./sys
sudo mount -o bind /proc ./proc
chroot
into the installation¶
Install these PureOS/Debian packages if you don’t already have them:
qemu qemu-user-static binfmt-support
chroot
into the phone OS while still in the Librem 5 root directory:sudo chroot .
Check for common problems¶
Important
Be sure to execute these commands inside the chroot
Check if your boot partition is full:
df -h /boot
(we’ve seen this cause a failure to update)If it has less than 100 MB free space, try to remove dpkg backup initrds:
rm /boot/initrd*.dpkg-bak
Check again:
df -h /boot
If it still has less than 100 MB free space, try to remove any old kernels:
apt autoremove
(this may remove other unreferenced packages if you have any)Try to repair any broken packages:
apt --fix-broken install
Clean up¶
Exit the chroot:
exit
Unmount partitions from the chroot (in the chroot directory):
sudo umount ./{boot,dev,proc,sys}
Close the terminal
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 Librem 5 to shut off
Try to power on the Librem 5 again