maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   jolla 1 boot loop loop that doesn't recover by using recovery menu (https://talk.maemo.org/showthread.php?t=100273)

vilva 2018-03-27 11:16

jolla 1 boot loop loop that doesn't recover by using recovery menu
 
Used the recovery menu to run the restore factory settings script,
but it didn't fix the boot loop. It also reverted back to recovery
menu v0.1, so I can't check if the btrfs fix option had helped
and also the shell option is not visible.

I believe the boot loop was initially caused by pulling off the
battery too early during shutdown. So I would assume
it is still some kind of file system data corruption issue.

Can I somehow still get a shell or have other tricks available
to try to recover it.

Amboss 2018-03-27 14:33

Re: jolla 1 boot loop loop that doesn't recover by using recovery menu
 
I have had a similar problem last year (and then every 2 months). I could only fix it externally as the btrfs version used by Jolla 1 is somewhat aged. For me it killed the folder with timezone data and some files which I could reproduce from factory@. There were also some cache files broken, but this is not needed anyway.

If you're lucky the factory reset script didn't break too much data. You need an sdcard 16GB+ and a linux machine.

I took some parts of this guide, except I didn't have a "working phone" for step 1 and 2.

What I did is:
Code:

## lines starting with @laptop are done on linux machine
## lines starting with / are done in recovery mode shell (option 4)

## on laptop
### format sd card to ext4 for large file support
### note UUID before if you want the same in optional last step
@laptop ~ $ sudo mkfs.ext4 /dev/mmcblk0p1

## after inserting sd card to Jolla
### this mounts memory card and copies the whole partition to an image file, take some time (~10 min)
/ # mkdir sd
/ # mount /dev/mmcblk1p1 /sd
/ # dd if=/dev/mmcblk0p28 of=/sd/kaputt_20180124.img
/ # umount /sd

## on laptop
### moving sd card to linux machine, for me it gets automounted on /media/myUserName/UUID_of_sd_card
@laptop ~ $ sudo dd if=/dev/zero of=/media/<user>/<UUID>/new-jolla-20180124.img count=28831711
### this is somewhat different from the link above, newer version of btrfs need also "skinny-metadata" deactivated to work on Jolla
@laptop ~ $ sudo mkfs.btrfs --label sailfish --nodesize 4096 --features ^extref,^skinny-metadata /media/<user>/<UUID>/new-jolla-20180124.img
@laptop ~ $ sudo mount -o loop,subvolid=0 /media/<user>/<UUID>/new-jolla-20180124.img /mnt/tmp/
@laptop ~ $ sudo btrfs subvolume create /mnt/tmp/factory-@
@laptop ~ $ sudo btrfs subvolume create /mnt/tmp/factory-@home
@laptop ~ $ sudo btrfs subvolume create /mnt/tmp/@
@laptop ~ $ sudo btrfs subvolume create /mnt/tmp/@home
### terminal should be put in "endless" mode before the next step
### these options are needed to copy all symlinks etc. it will also list symlinks in terminal
### it shows errors for files which could not be recovered, which you need to fix afterwards
### the broken image is not to be mounted at this time
@laptop ~ $ sudo btrfs restore -sxmSio /media/<user>/<UUID>/kaputt_20180124.img /mnt/tmp/
### from here it is like step 5 onwards
@laptop ~ $ sudo btrfs subvol list /mnt/tmp/
@laptop ~ $ sudo btrfs subvol set-default 259 /mnt/tmp/
@laptop ~ $ sudo btrfs-show-super /media/<user>/<UUID>/new-jolla-20180124.img
@laptop ~ $ sudo umount /mnt/tmp
### I varied step 6 by assigning the original UUID of the jolla image to the new image instead of altering /etc/fstab
@laptop ~ $ sudo btrfstune -U <UUID_jolla> /media/<user>/<UUID>/new-jolla-20180124.img

## back on phone
### if you didn't shut down the phone in between /sd is still there
/ # mkdir sd
/ # mount /dev/mmcblk1p1 /sd
/ # dd if=/sd/new-jolla-20180124.img of=/dev/mmcblk0p28
/ # reboot

## back on laptop
## I you need your sd card (like I did) you need to revert it to fat32
## it needs to unmounted, the option sets the original UUID which you wrote down in the first step
@laptop ~ $ sudo mkdosfs -i 12345678 /dev/mmcblk0p1


nieldk 2018-03-28 05:50

Re: jolla 1 boot loop loop that doesn't recover by using recovery menu
 
He can’t enter recovery it seems, so he needs another way to boot a recovery .
For a way to do so, see here (this is what some of us did, before Jolla implemented a recovery mode)

https://wiki.merproject.org/wiki/Sailfish/Backup_Device

Amboss 2018-03-28 07:53

Re: jolla 1 boot loop loop that doesn't recover by using recovery menu
 
ooh, must have missed that vilva has no shell anymore

anyway are you sure, your link's instructions still works? There is a bold lettered note that it won't work after 1.0.25?

nieldk 2018-03-28 08:46

Re: jolla 1 boot loop loop that doesn't recover by using recovery menu
 
Quote:

Originally Posted by Amboss (Post 1542757)
ooh, must have missed that he vilva has no shell anymore

anyway are you sure, your link's instructions still works? There is a bold lettered note that it won't work after 1.0.25?

No, I didnt try. But I remember that (at least before 1.0.2.5) you could fastboot oem unlock. So, perhaps it can work

Amboss 2018-03-28 08:57

Re: jolla 1 boot loop loop that doesn't recover by using recovery menu
 
Nope, this is something I had been looking for as well 2 weeks ago. bootloader can only be unlocked from recovery and if that is not working, well ... hen-and-egg?

nieldk 2018-03-28 19:13

Re: jolla 1 boot loop loop that doesn't recover by using recovery menu
 
Quote:

Originally Posted by Amboss (Post 1542762)
Nope, this is something I had been looking for as well 2 weeks ago. bootloader can only be unlocked from recovery and if that is not working, well ... hen-and-egg?

Boot loader is unlocked with fastboot (if bootloader is allowing it)
I did in early days, but yes, it is possibly changed in newer SFOS versions.
You can check by entering fastboot
Can’t recall if it’s vol-up or vol-down while power on from turned of phone.

Amboss 2018-03-29 16:11

Re: jolla 1 boot loop loop that doesn't recover by using recovery menu
 
if I try sudo fastboot -i 2931 oem unlock it just stated "permission denied" - so no unlock from fastboot


All times are GMT. The time now is 13:45.

vBulletin® Version 3.8.8