Recovery shell for Librem 5

Hello,

I recently tried to add a microsd card to my Librem 5 as the /home partition and botched the entry in fstab and now the phone won’t boot at all. I believe I just need to correct (or remove) the entry, but when the phone boots, I see a few errors relating to the failure to mount the device, like:

[ TIME ] Time out waiting for device SOME-UUID.
[DEPEND] Dependency failed for SOME-UUID.
[DEPEND] Dependency failed for /home.
[DEPEND] Dependency failed for Local File Systems.

It does continue on and stops after:

[  OK  ] Reached target Host and Network Name Lookups.

At this point, it is completely unresponsive to any keyboard/mouse/touchscreen action other than the power button or pressing ctrl, alt, delete, which reboots the phone. As I mentioned before, I believe all I need to do is correct the fstab, but I don’t know how to access it. I tried the first suggestion in the video here, but the device never shows up in /dev and I’m not up for the second suggestion involving soldering since I’d rather flash the phone and start from scratch.

In short, is there anyway to access the phone’s filesystem so I can make the correction or do I need to start over?

There is something called Jumpdrive that could be useful for this, maybe. I never tried it myself but it was discussed for example in this thread: Librem5 (Evergreen) serial console
where it seems like someone succeeded in doing something similar to what you need.

2 Likes

Jumpdrive is exactly the tool to use here. It exports eMMC as a USB mass storage, so you can mount it and make any changes you wish. It also runs a telnet server over USB network, so you can use its shell to apply changes too.

3 Likes

Ahhhh! Thanks so much to both of you! This let me do exactly what I wanted. Had a small hiccup, which I assume was the orientation of the USB-C connection, but following the steps allowed me to connect just fine. I was able to edit fstab as desired and things are back to normal. Thanks again!!

1 Like

Would you care to link to the steps you used? I’m in a similar situation here.

Which part are you struggling with?

Anyway, an outline of what’s involved is:

  • download onto a host computer Jumpdrive and associated scripts and other files
  • ensure you have the uuu command on your host computer (use which uuu to verify)
  • you want your Librem 5 connected to the host computer via USB and the Librem 5 in serial download mode (same physical process as used when re/flashing the Librem 5)
  • run the script on the host computer
  • that will load Jumpdrive over the USB connection from the host computer to the Librem 5 and the Librem 5 will boot Jumpdrive
  • the Librem 5 now exposes itself over USB as one or two disk drives (USB mass storage device class) - that’s one for the eMMC drive and, if you have a µSD card installed in the Librem 5, another for the µSD card (will show up as /dev/sdx and in turn for each partition as /dev/sdxn) - and the Librem 5 exposes itself over USB as a network device
  • mount the correct partition on the host computer OR telnet into the Librem 5
  • fix up what needs to be fixed up

Depending on exactly what is broken and what needs to happen to fix it you make the choice between

  • telnet into the Librem 5, mount the appropriate partition on the Librem 5, and fix things directly on the Librem 5 v.
  • mount the Librem 5’s partition on the host computer and fix things on the host computer

Jumpdrive allows both of those possibilities. However only do one or the other (not both).

In either case “mount” is a bit more complex if you need to work on an encrypted partition, but just the standard LUKS stuff.

1 Like