After ~18 monts of moderate use, my Jolla appears to be dying. (As well as the entire Jolla itself, but this is a separate story.) First, some spontaneous errors come, e.g. portions of text are replaced by garbage, or color palette in particular apps is skewed. Then the system crashes, and after a long reboot it come up in a pure factory state. Looks like flash memory is being corrupted, and reset to factory state on the next reboot. Load all the updates, install the apps, make my personal settings again from the ground up. But this is not for long - the same thing repeates again in a couple of days.

As other parts are still working properly, is't there some easy way to redirect the rootfs partition to the SD card? E.g. by editing some text or hex files (in Developer Mode, of course)? So that the bootloader would recognize a blank card as "corrupt", restore the factory roofs to it, and continue using it from that point on.

Or would it be possible to dd the flash partition to SD card, and then chroot to it once - right after restart (while the system is running properly)?

Comments

An interesting Idea would be to use BTRFS. Since there are so many partitions and all the hassle with LVM, this is not going to be funny (if done for all 28 partitions).
One could make a 14G partition on the SDcard, add it to the BTRFS volume on the internal storage as btrfs-raid1 and voila - BTRFS would be self-healing, even with broken internal flash.

1 Answer

My Jolla C has broken its internal flash memory that is /dev/mmcblk0p28. Sometimes it had fallen into recovery mode and i had to reset to factory state. And it always had iowait more than 30% with typical 50 - 75 %. Jolla C has
LVM not btrfs, i don`t know how it is suitable for Jolla 1.

Step 0. Read and understand all text below.

Step 1. Make sure you have backup and you can restore everything you need.

Variant 2. If you have working Jolla C, you can activate recovery mode. Then plug usb to PC and telnet 10.42.66.66 . At the Jolla choose option 3 - shell and do:

dd if=/dev/mmcblk0p28 of=/dev/mmcblk1

Then turn the phone off and take SD card out.

Step 3. At this point you have full copy of internal flash memory at your SD card. And SD card is not installed in Jolla. Now it's time to destroy lvm volumes and groups on internal flash. Run Jolla into recovery mode, telnet it and choose 3 - shell.

Step 4. Turn off Jolla, insert SD card, run into recovery mode, connect by telnet, choose 3 - shell, type lvm to get into its shell and observe its state:

pvscan
vgscan
lvscan

You should get the same output as it was before step 1 except name of physical device which is mmcblk1 now. Almost everything is ready, even option 4 - check filesystem in recovery menu will work, but phone will not boot. We need to include internal flash memory in virtual group type in lvm shell:

pvcreate /dev/mmcblk0p28
vgextend sailfish /dev/mmcblk0p28
exit

Exit shell, choose reboot at recovery menu.
Now phone should normally boot SailfishOS and work fine.