The very first things to setup

Hi, today I got my new Jolla Phone :smiley: but still fear to switch it on :frowning:.

There are some things to setup that are best done very early in the process and I would like to “get them right”.

One thing I know how to do, that should be done early, is to change the username (if one decides to do so): How to switch from defaultuser to nemo - General - Sailfish OS Forum (thanks to nephros).

Another thing, I’m currently puzzled about is disk partitioning and encryption. Per default (I suppose, it’s still the same in current 5.1), there is usually a small unencrypted root disk (/) and a large encrypted user data disk (/home). I think LUKS is used for encryption and the encryption key for the user disk is encrypted by the security code one enters at boot.

I’d like to have a strong disk encryption, so I’d like to use like a 20 character base58 password or similar. However, I don’t want to have to enter it on each unlock. I wonder, if it is it possible to somehow use a strong security code for disk encryption but a much weaker unlock code (like 6 digits)? Is it possible to shutdown the phone on too many false unlock tries (like 10) to forget the strong security code and lock up the user disk again? Has anyone an idea?

I also think about repartitioning the main disk, but I’m not quite sure, how. I added a 1 TB sdcard and it is supposed to stay. I wonder, if I should consider it only “external storage” and write all essential data on the internal memory, or if it is a good idea to e.g. mount the whole external sdcard straight to /home to ensure “unlimited space” for user data. What could go wrong?

Btw., Sailfish OS - Auto-mount encrypted memory card at boot | dt.iki.fi already describes how to automatically unlock an encrypted external disk where the cryptographic key is securely stored on the manually unlocked /home partition (if the LUKS password is strong enough, thanks to ohnonot)

Also, I need some more space on the root partition. I want to install the nix package manager which download lots of files into /nix/store/ and I probably want to encrypt it, too, since I constantly mess up with flakes and copy some unintended secrets into the store. Also, I consider extra encrypted mount points for /var and /tmp “for security” (they might contain “sensitive logs” or similar), not really because it’s necessary, but just “to do it right”. Or is it even possible to encrypt whole of / and just leave something like a /boot/ partition unencripted, which even might just ask on a text terminal for the disk encryption password?

Has anyone an idea how I should partition my disk(s) and setup encryption in best possible way (or can tell me, that it’s not possible what I try and I should just set it up “normally”)?

Does anyone know about more Items that should be done early during setup, since they might be harder later on (on a full phone with lots of apps and documents)?

Best regards,
erdbas

3 Likes

there’s a guide to resizing partitions and externalizing files and directories linked here.

2 Likes

The things you are trying are quite advanced, and some of them are untested or unsupported.

Not exacly “The very first things to setup” - far from it.

That being said:

That is correct.

You can do this.

You can not do this.
Modifications of the system components to enable it may be possible, but out of the box this is not possible to configure.

Sounds like a terrible idea to me.

I don’t know nix, but I’d recommend placing /nix/store instead on e.g. /home/nix/store. That way you get your encryption, have less problems with storage space on /, without any modifications to the system.
Alternatively, your SD Card sounds like a good place for a third-party OS packages if that is supported.

Leave it at the defaults, that’s already the “best way possible”.

1 Like

Hello, thank you for the answers and confirming some bad ideas, so I can put them aside.

I think, I then go with an easy security password and a strong sdcard password, that I have to enter manually on each boot, once. Leaving the /home disk basically unencrypted (for practical purpose).