Reflashing my L5... from my other L5

I want to put a direct image of my daily L5 (L5 A) to the one I just got back from repair (L5 B).
I have a live boot of Ubuntu but it won’t let me install git or uuu.
I successfully reflashed it using my L5 (A) but I want to use the image I made of my L5 (A).
I tried using Jumpdrive but it wouldn’t work.
Anyone have any ideas on how to do this?

1 Like

Could you please explain more what you did and more specifically how it failed?

2 Likes

I ran Jumpdrive on L5 A (old) and connected it as detailed here but L5 B did nothing and uuu said failed in the terminal on L5 A.

1 Like

My idea for how to reflash a L5 that I didn’t try yet but have been meaning to try and might try soon:

  1. buy small SD card (needs at least 8 GB)
  2. put the SD card in the L5
  3. scrape the L5 flash script from purism to get the URL of the img file you want to flash
  4. use the dd command to write the img onto the unmounted SD card, causing it to be a bootable L5 image
  5. boot the SD card in the L5 by holding volume down
  6. while SD card is running on L5, the eMMC of the L5 should not be mounted probably, so it should be possible to use dd to image it onto an external drive or something if you want a backup (maybe use a USB-C hub and an old USB 3.0 big hard drive to store the extra backup that’s literally made with dd if=/my/eMMC/device of=/file/on/the/usb3/storage
  7. use dd if=/user/purism/Downloads/my-librem5-flash.img of=/my/eMMC/device to get fresh install of PureOS on L5
  8. use dd if=/file/on/the/usb3/storage of=/my/eMMC/device to flash the backup onto the L5 device

Now, I invented the above process as something to try using only the basic understanding that dd writes anything from anything to anything. And people are always talking about uuu and ubuntu and all this stuff, and i just wonder, is that even necessary? Can I do the above steps to flash a librem 5 using only itself ? I still never tried but maybe I will try at some point

Also, would it be possible to add a step before step 8 where you remove the SD card and external hard drive, and put them into the new L5 (making sure to only remove SD card when L5 is unpowered and probably when battery is removed, due to the reported issues with shorts while tray moves in and out) and then on the new L5 flash that one with the image file from the external hard drive?

3 Likes

Yes. Using uuu is simply less cumbersome.

You could even skip the whole SD card thing and just boot the phone from initramfs stored on eMMC.

3 Likes

What version of Ubuntu? Can you elaborate on “won’t let me install”?

You will of course need to resolve that before you can use Jumpdrive, which is probably the recommended way of imaging the eMMC drive of one Librem 5 to another.

I would suggest doing the phones one at a time i.e. Jumpdrive with the source phone to make a disk image onto the host computer - which may be tricky if you insist on using a live boot; then Jumpdrive with the destination phone to restore the disk image. Rather than try to connect both phones to your host computer simultaneously (which would in theory allow you to image directly from one phone to the other).

Also, if you want to be fussy, making a direct image could cause some issues.

  • This is going to mean that (assuming that the source phone uses LUKS) the two phones have the same disk encryption master key and the same LUKS key slot passphrase, which is not great security. It is possible to fix that but it does involve a bit of mucking around.
  • The overlying file systems will have the same UUIDs for the corresponding partitions. Again, it is possible to fix that.
  • It is my assumption that the source phone uses DHCP, which is fine, but otherwise if the source phone has a static IP address then that will need fixing on the destination phone.
  • Probably other things that I missed.
2 Likes

So my basic question would be: how do I flash my image to my L5 B using only my L5 A

It’s the only thing I’ve got.

22.04

uuu package not found

I have the image on an SD card. But my live boot of Ubuntu doesn’t have enough space (on a 64 GB drive??) to use gnome-disks to write the image.

1 Like

Refer: Possible to make/save Librem 5 distro + data as an image file? - #51 by irvinewade

(I can assure you that Ubuntu 22.04 regular boot, not live boot, does work fine with the Librem 5 for reflash or Jumpdrive, for example. Even with a live boot, you will get there in the end.)

I probably have a deficit of information regarding your exact environment … but … my suggestion would be to use a separate portable drive attached to the host computer (can be a flash drive if that’s all you have or, yes, even an SD card if that’s all you have), with the only requirement being that it needs to be able to hold an image of the source phone’s eMMC drive (about 32 GB).

So you probably need an approx. 32 GB drive for the live boot and an approx. 64 GB drive for the source phone’s eMMC drive image.

If you are super-desperate … dd piped through gzip would reduce the disk space requirement on the host computer for holding the disk image. (That’s what I do for holding my Librem 5 backups on the host computer. The only disadvantage is that then you can’t directly look at any files inside the backup from the host computer.)

I can’t really comment much on what gnome-disks might be trying to do. Perhaps it is trying to use
/tmp for something.

I think the live boot environment uses overlayfs (or something equivalent to that) in order to allow you to make temporary modifications to the read-only live boot. (That’s why sudo apt install something works at all in the live boot environment.) I have no idea how much disk space it allocates for that but clearly it is not an unlimited amount of space and multi-GB files may just be too much.

If you really get stuck, you can always install Ubuntu from the live boot to a portable drive (of any type) and then boot the portable drive. In that case the single portable drive needs to have enough space for Ubuntu plus the disk image.

1 Like

Exactly the same way as if your L5 A was a normal PC. There’s one problem you may encounter though - using a USB-C to USB-C cable one of the phones will become USB host and other will be USB device and it may turn out that you got it the other way around than what you want. It’s possible to switch, but I’d have to look it up in the datasheets. This can be entirely avoided by using a USB-C to A adapter and then a USB-A to C cable, as that forces the device on the adapter side to become the host.

Make sure both L5’s batteries are fully charged before attempting it. Charging one L5 from the other is a pretty stupid way to waste energy :wink:

Ubuntu 22.04 has the package available: Ubuntu – Details of package uuu in jammy

Did you do sudo apt update before trying to install it?

1 Like

(See link in previous post. The required repo is not configured by default in the Ubuntu live boot environment.)

1 Like

But the problem is… I don’t know how. :laughing:
I know how to re-flash the regular way but I don’t know how to use my own image.

@irvinewade Thank you for your help. I will look into and try your suggestions. :+1:

1 Like