It appears that your phone has been flashed with an image file of Byzantium w/ LUKS encyption, but, for what ever reason the LUKS partition has not been resized to fill the entire disk after flashing.
There are a couple of ways to resize, if you are familiar with fdisk
I would use that as it has the advantage of being able to work on live disks so no reboot would be required. Perhaps the easiest option is to use sfdisk
from a root shell, the process is as follows…
-
From the terminal, get to a root shell by entering…
sudo -i
-
Resize the main partition to fill the entire disk space…
echo ,+ | sfdisk --no-reread --no-tell-kernel /dev/mmcblk0 -N 2
-
Remove the “filesystem resized marker file”…
rm /etc/resize_rootfs-resized
-
Exit from root shell…
exit
-
Reboot phone
Notes:
-
sudo -i
will prompt for your password. -
sfdisk
will resize/enlarge the partition by changing the “End” sector value, after executing the command you will be shown the old partition table and the new partition table, the only difference between old and new you should see will be in the “End”, “Sectors” and “Size” values of the second partition. If anything doesn’t look right within the partition table then it will most likely need to be addressed before rebooting. -
If after executing
rm
it errors with “No such file” or similar then you will have to manually resize the LUKS container withsudo cryptsetup resize /dev/mapper/crypt_root
and resize the main filesystem withsudo resize2fs /dev/mapper/crypt_root
which, if required, should be done after rebooting.
For your three questions:
-
Your phone has been flashed with an image, it may have been re-encrypted at the factory, see the issue Change encryption key before flashing for more information. You would need to contact Purism and ask if that was done or not. It is probably best to assume not.
-
The instructions just resize to enlarge the partition, no programs or data you have installed should be lost but there is always an element of risk, so take backups of anything important.
-
The process enlarges the partition, the LUKS container and the underlying filesystem.