Xperia 10 III - recovery does not recover [Help please]

[WARNING] Root file system unaccessible, bypassing device lock check.

This error probably means that something’s wrong with your partition(s).
Can you mount rootfs manually?

/ # ls /rootfs # (should be empty, then)
/ # mount /dev/mapper/sailfish-root /rootfs

If mount unsuccessful, I recommend to run recovery’s option 4) Perform file system check.

Ehm… no.

Type the number of the desired action and press [Enter]: 
3 

If you continue, this may void your warranty. Are you really SURE? [y/N] [y/N] y
  2 logical volume(s) in volume group "sailfish" now active
[WARNING] Root file system unaccessible, bypassing device lock check.
/ # ls /rootfs/
apex          dev           linkerconfig  metadata      odm           run           tmp           vendor
config        home          lost+found    mnt           proc          sys           var
/ # 

Oh, by the way, when I run option 4) I get

Type the number of the desired action and press [Enter]: 
4
  2 logical volume(s) in volume group "sailfish" now active
e2fsck 1.45.4 (23-Sep-2019)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
root: 70/320000 files (0.0% non-contiguous), 38026/1280000 blocks
Opening encrypted filesystem, you will be prompted for your security code.
Enter passphrase for /dev/sailfish/home: 
No key available with this passphrase.

So, shall I start to give up any hopes?

Will see:

/ # mount | grep rootfs

So…

/ # mount | grep rootfs
rootfs on / type rootfs (rw,size=2139728k,nr_inodes=534932)
/dev/sailfish/root on /rootfs type ext4 (rw,relatime)
none on /rootfs/dev type devtmpfs (rw,relatime,size=2139728k,nr_inodes=534932,mode=755)
proc on /rootfs/proc type proc (rw,relatime)
/ #

This looks like Android’s rootfs, not Sailfish, yet still incomplete. Such as an aborted attempt to flash Android on top, however over the userdata partition, which shouldn’t happen. Would be interesting to see:

find-mmc-bypartlabel userdata
lvm lvdisplay
ls -l /rootfs
ls -l /rootfs/var/log # (if exists)

Thank you.

/ # find-mmc-bypartlabel userdata
/dev/sda79
/ # lvm lvdisplay
  --- Logical volume ---
  LV Path                /dev/sailfish/root
  LV Name                root
  VG Name                sailfish
  LV UUID                g0qeAk-LUcR-FK9C-3N0o-9K0n-sC6R-OoJZmp
  LV Write Access        read/write
  LV Creation host, time SailfishSDK, 2022-05-11 11:44:48 +0000
  LV Status              available
  # open                 1
  LV Size                4.88 GiB
  Current LE             1250
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     1024
  Block device           253:0
   
  --- Logical volume ---
  LV Path                /dev/sailfish/home
  LV Name                home
  VG Name                sailfish
  LV UUID                vOtW2k-pesk-cP7b-NBPP-N0Fc-eX06-andjvc
  LV Write Access        read/write
  LV Creation host, time SailfishSDK, 2022-05-11 11:44:48 +0000
  LV Status              available
  # open                 0
  LV Size                <99.53 GiB
  Current LE             25479
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     1024
  Block device           253:1
/ # ls -l /rootfs
drwxr-xr-x    2 root     root          4096 Apr 25  2022 apex
drwxr-xr-x    2 root     root          4096 Oct 23  2021 config
drwxr-xr-x   10 root     root          7660 Jan 31 04:01 dev
drwxr-xr-x    2 root     root          4096 May 11  2022 home
drwxr-xr-x    3 root     root          4096 Oct 23  2021 linkerconfig
drwx------    2 root     root          4096 Jan 28 10:55 lost+found
drwxr-xr-x    2 root     root          4096 Oct 23  2021 metadata
drwxr-xr-x    3 root     root          4096 Jul 12  2022 mnt
drwxr-xr-x    2 root     root          4096 Oct 23  2021 odm
dr-xr-xr-x  477 root     root             0 Jan  1  1970 proc
drwxr-xr-x   15 root     root          4096 Dec  7 07:52 run
drwxr-xr-x    2 root     root          4096 May 11  2022 sys
drwxrwxrwt    2 root     root          4096 May 21  2022 tmp
drwxr-xr-x    4 root     root          4096 Jul 12  2022 var
drwxr-xr-x    5 root     root          4096 Jul 12  2022 vendor
/ # ls -l /rootfs/var/
drwxr-xr-x    3 root     root          4096 Jul 12  2022 cache
drwxrwxrwt    2 root     root          4096 Jul 12  2022 tmp

How were you reinstalling the MyBackup app? By removing/adding it, to newer version?

Try to mount your home without encryption:

mount /dev/sailfish/home /rootfs/home

Also this is interesting:

df -h /rootfs
ls -l /var/cache /var/tmp

I had Books (I rarely close that one), Storeman, and Chum GUI open; I was looking for apps that were on both sides, to see if I could delete any repositories from Storeman. I saw that MyBackup was still Storeman’s version (if you use Chum, you have surely seen that apps installed through it have a version name that’s longer than Storeman’s, with a .jolla-something ending). I don’t remember if I clicked on the icon then, or if I pulled the menu in Storeman, to uninstall. Then I did something (as swiping from side, or from top, or similar) which I don’t remember precisely, and I found myself with a frozen screen with the top menu half way down (but without the icons, IIRC) a loop circle, and a wrong clock (that, I remember because for some reason I checked the time, and from 18:xx that was the actual time, clock was displaying 16:yy).

By the way:

/ # mount /dev/sailfish/home /rootfs/home/
/ # ls /rootfs/home/
lost+found
/ # df -h /rootfs/
Filesystem                Size      Used Available Use% Mounted on
/dev/sailfish/root        4.7G      6.0M      4.7G   0% /rootfs
/ # ls -l /var/cache/
/ # 
/ # ls -l /var/
drwxr-xr-x    2 root     root            40 Apr 25  2022 cache
drwxr-xr-x    2 root     root            40 Apr 25  2022 log
drwxr-xr-x    2 root     root           100 Feb  1 03:36 run
-rw-r--r--    1 root     root            44 Feb  1 03:36 udhcpd.leases

Had you received an ‘OS update is available’ message before this?

Sounds like it could have been caused by the ‘os update check sets ssu re’ issue.

Nope, no message about OS updates.

I’ve investigated MyBackup uninstall scriptlet and sadly it did the damage by removing everything on your device. @slava is the author and I hope they could find the easiest way to solve this in the app:
This line of code on busybox shell evaluates to:
rm -fr /
for every user on the system that does not have actual home dir (smoke test: u=nobody; eval echo ~$u/some/path)
On GNU Bash it evaluates as author intended, but Sailfish doesn’t use GNU Bash, it uses busybox…
rm -fr //.local/share/openrepos-mybackup

The fact that you were able to mount your sailfish/home, means that you hopefully disabled user data encryption when you first installed Sailfish OS.
To try and undelete your files, you could cross-compile this and deploy it into your recovery via sd card: http://extundelete.sourceforge.net/

2 Likes

Ouch :open_mouth:

When I wrote that scriptlet Sailfish OS was still using bash and of course I tested it and it worked. Replacing bash with busybox is such a great way to randomly break things.

Thanks for the tip. I’m not using the latest Sailifish OS on my daily phone and would never notice that myself.

I’ll find a syntax that would work both busybox and bash. Until then, don’t uninstall MyBackup🙂

Upgrade is going to be safe, that script only runs on uninstall.

UPD. Actually, my daily phone where I tested it, already has bash replaced with busybox (albeit an older version) and that uninstall script works there just fine. Looks like we’ve stumbled upon a recently introduced feature (probably a bug) in busybox

MyBackup version 1.0.6 should fix the rm -fr / problem. Update is safe, it doesn’t run the uninstall script.

Well, I have no words @seaMeeGo to thank you for all you went through trying to help.

As a matter of a fact I did a fresh reinstall just in the morning before your message (couldn’t keep the phone lying there anymore); in fact I came back here because, while reinstalling all the apps, I saw slava’s comment in the app description and thought about letting you know. Now I understand it was because of your intervention.

“Luckily”, I did actually encrypt my phone (I am very sure about it), so I think there was no way to recover things.

BTW, @slava, since we are here please allow myself to ask you if you think it would be possible to have something like an incremental backup but only saving files from a given point (previous backup, or date) onwards. That is: I do a given backup on day 1, then when I do a new backup on day X only the new files get copied even if I removed the old files from the destination.

No, that won’t fit into Sailfish OS backup architecture.

First, when the backup unit gets invoked, it’s not told what was in the previous backup or whether it exists at all. It’s simply not part of the interface.

If that’s not enough, backup only keeps the last two tarballs and automatically removes the older ones, assuming that those are all full backups. There’s nothing a backup unit can do about that.

Is there a known way to back up email database?
I like having a copy of emails on the phone ( downloaded as POP3).
Currently emails are not included in the backed up content ( or that’s not working if it makes a difference :slight_smile: ) .

Add ~/.qmf directory to MyBackup.

Add ~/.qmf directory to MyBackup.
That includes ~/.qmf in the archieve in MyBackup/data/users/100000/files/.qmf

Restoring in another device doesn’t work though: ~/.qmf is not created.
I restored .qmf from the tar, but messages don’t display.

It seems that:

  • the accounts restored from bkp don’t preserve their IDs
  • mail db has a dependency on the account ID

I will try to figure out what is easier (or at least achievable)

  • adjust mail db to refer to the new account IDs ( several tables involved, related to folders, messages…)
  • adjust the accounts db so that my email account matches the id it had on the old phone where the mail backup was taken.

I would love to have /var/lib/bluetooth backed up to be able to restore Bluetooth pairings. Is there a way to add folders outside of /home/defaultuser/ to MyBackup?

AFAICT the backup process is running under the current user account with privileged egid, meaning that even if system directories could be copied to the backup (i.e. if they are readable by the user) they couldn’t be restored from the backup. That’s why I restricted the choice to the directories under the user home.

1 Like