answered
2018-09-10 12:44:17 +0200
A lot of tips gathered over the years.
It might look a bit scary at first glance, because it's written from the perspective of a hardcore linux geek (lots of command-line stuff). You don't need to understand everything to enjoy sailfish, but it helps a tiny bit and I'm leaving it here as a future reference.
Jump straight to my answer to questions 3./4./5. if you're not into hard-core linux stuff.
The only critical take-home message is :
- do not run filesystem checks (
fsck
): your Jolla 1 works completely differently from everything else.
The signle best tip would be :
1. Regarding the backup
Yes, full dump do work. You can do one using plain stupid dd if=/dev/mmcblk0p28 of=
...
For such dump, I would suggest booting into recovery mode (holding the volume button, and then using a laptop to telnet
into the command line). So the partition isn't currently mounted during backup time.
The file system used on the Jolla 1 is "BTRFS" a Linux specific filesystem with a few modern features (mostly checksum, and snapshotting), and a peculiar way of organising storage : it's Copy-on-Write (CoW - like ZFS, and not too dissimilar from log-structured like F2FS, UDF, etc.) it never overwrites data, it always writes a new copy and then updates the pointers. (Meaning it's also gentler on flash).
Good tip : The guys at Jolla haven't followed the then latest recommendation regarding BTRFS on flash and there's a way to claim some extra free space. ( <- been using this on my Jolla 1 for years, and more recently on my Xperia's SD card).
Important tip : never ever run a filesystem check (fsck
) and don't use the filesystem recovery feature of the recovery mode telnet
menu. Remember the CoW thing above ? If the system crashed, there's always an older version of you data on it. Sometime simply mounting with -o recovery
is enough. At worse, dump the current state on a SD card, and use a laptop with linux to run btrfs restore
to salvage all the files from the broken filesystem. ( <- been there, done that). If you "just want to check if everything is okay" see scrubbing below. Never run fsck
on BTRFS.
Presonnal experience : Already tested such backup in real, my Jolla 1 motherboard eventually burned due to a short from a broken USB connector, I used such a dd
backup that I had done not long before the accident to move my stuff to a second-hand motherboard.
2. Regarding factory reset
It simply leverage a feature of the BTRFS filesystem : snapshots (Because the filesystem is CoW, it's entirely possible to keep a different divergent copy of the filesystem without any performance penalty).
The Jolla 1 has 4 subvolumes on its BTRFS partition :
@
: the root system used by sailfish, this one is mounted on /
@home
: the user data used by sailfish, this one is mounted on /home
factory-@
: a snapshot that is a copy of how @
looked in your pristine phone. factory-@home
: a snapshot too, this time of @home
When you ask a factory reset, sailfish will simply delete the @
and @home
subvolumes, and make new snapshot out of the pristine factory-
... ones.
Now speaking about BTRFS features, two things that are useful to do (three for a very weird case) :
scrubbing : Remember above when I said that BTRFS has checksums ? You can use the command btrfs scrub start /
to do a check of the whole filesystem : control if the data still matches the checksum (nothing got corrupted due to flash memory failure - e.g. beware of cheap sd card) and if everything looks okay (do NOT use fsck
for that).
You can then use btrfs scrub status /
to get an info of how the scrubbing is going. I have no idea if someone as bothered to make a nice UI for that.
Might be useful to run scrubbing once weekly to monthly.
balancing : BTRFS has a weird way to allocate storage in chunks (it has its own space allocation system. Like system such as ZFS. These have something like "their own LVM built-in"). You might run out of space (the filesystem needs a new chunk for metadata to continue, but all the chunks have been allocated for data and there's no free chunk left). There is a way to force "clean up" of old chunk which aren't full (e.g.: by repacking the data into 1 single full chunk). This is done by rebalancing.
the guys Jolla have written a nice command-line tool : btrfs-balancer
, you can run it with btrfs-balancer balance
. For UI : the system updater will automatically run it before updating, and on openrepos you can find GUI tools to run it from the push of a simple button (or even as a scheduled job).
the normal cli way to run balancing is btrfs balance start -v -dusage=60 -musage=60 /
. (the 60
means : repack chunks that currently are only 60% used - i.e.: lots of space wasted). If you don't even have enough space for that you can start with number 0
(first try to de-allocate empty chunk) and progressively increase from that ( <- that's what the tool written by Jolla's guys does automatically).
It's useful to perform this before any huge amount of writing ( <- Jolla's system updater does this automatically for you before any major update).
defragmentation : This is more a desktop thing, and barely happens on a Jolla. But putting the info here.
This has nothing to do with harddisk defragging, but is linked to CoW. Because it never overwrites, but only makes a new copy of the data and updates pointer, if you have a giant big file that is written randomly all over the place , this file might end-up looking as giant labyrinth of tons of updates all over the place all pointing to each other. Just traversing this giant maze of pointers until you reach the bit of a file you need will take some hit on the ressources (specially on a meager CPU like a smartphone).
On a smartphone it might happen if you decide to download torrents of movies (tons of random writes all-over the place as chunks are fetched from teh swarm). On a desktop it might happen frequently on a virtual machine's virtual disk (it's advised to turn CoW off on such instance) and some databases (Though some Android app could be using SQLite for storage, this will very seldom grow to the point it is a giant fragmented file).
Just run btrfs filesystem defrag -v
{your torrented .MP4 file} once your download finished and it will rewrite the file into a bunch continuous extent instead the giant mess of pointers it has become by now.
3. 4. 5. Customisation
Sailfish is a bit different culture regarding customisation.
For once, the maker (Jolla) isn't as much obsessed with making you unable to dig into your own device as most Android device makers. So you don't need a whole custom ROM to make some more advanced use of it (as opposed to LineageOS, etc.). You can straight play with your current Jolla as-is.
(Though there exist entirely different systems like Nemo mobile which also use the same Mer core (full blown GNU/Linux base) as Sailfish, but uses an entirely diffent Glacier UX user interface instead of Jolla's lipstick. As it uses the same Mer core it should be possible to switch by doing package installs instead of reflashing a ROM).
(There might also be a couple of Ubuntu Touch attempts)
(Overall I wouldn't count too much of such OS replacements : not a big enough community, you'll probably run into problems and be on your own. Better stick to Sailfish and TJC / TMO for advice from us fellow users)
Also, because Jolla is using Qt, and specifically applications written in QML (a markup language written in human-readable text, and Javascript for scripting, also human readable) - it means that most of the application (Even the not yet officially opensource) are actually as easy to hack as if they where HTML+Javscript webapps.
(The two above point might remind you of Palm/HP's webOS if you were into that community at some point of time).
Instead next to the official Jolla shop, there's a vibrant community of users making tons of interesting apps : openrepos.
The crown jewel among such comunity apps in my option is the navigation stack : OSM Scout Sever - running you own OpenStreetMaps server on your phone to have offline maps available for any other maps (including even sports tracker). And Pure Maps a map software that leverage the former and has a decent turn-by-turn navigation with voice.
Also, of note is a peculiar application (and corresponding infrastructure) : Patchmanager 2.0 (There's also an upcoming v3.0 but currently it's still in beta).
Patchmanager 2.0 allows you to drastically alter the aspect of most apps and interface using simple patches (remember when I said that QML uses editable text instead of opaque binaries ?).
There's a catalog of patch which is directly available from within the Manager, and there's also patches in RPM packages on openrepos.
It might do something really cosmetic (like return the Sailfish 1.x-style pulley menu graphics on more recent Sailfish versions ) or much more advanced stuff that modifies the way your system works.
To install packages :
- from the command line, the official builtin tool is
pkcon
- from the command line a nice (better in my opinion) tool that you can install (using
pkcon refresh; pkcon install zypper
) is OpenSUSE's zypper
. - from the GUI Storeman is the currently best tool you can install. (Warning: Warehouse DOESN'T work with newer versions of Sailfish anymore).
2) (and in somehowe even 1)) In case of a factory reset your Jolla1 will run the first Version of SFOS. And you'll have to walk through all versions till the actual one.
4) You can switch on developer mode. Go to open repos and search for patches. Write patches by yourselve. By working with Linux, you can change anything in root and modifie what ever you want as long as you know what you are doing.
5) You can use the command line via ssh from your Computer
dirksche ( 2018-09-10 07:26:32 +0200 )edit