... | ... | @@ -61,104 +61,61 @@ GPS: Seems to work internally but user interfaces in PureOS are still missing (e |
|
|
|
|
|
Related Mobian issue and workaround: <https://gitlab.com/mobian1/issues/-/issues/440#note_1018769896>
|
|
|
|
|
|
[Reflashing the Librem 5](https://developer.puri.sm/Librem5/Development_Environment/Phone/Troubleshooting/Reflashing_the_Phone.html) may end up creating a root partition that does not use up the entire eMMC storage, usually with only 4GB with the rest being unallocated free space when this happens. You can use the "Disks" app on the Librem 5 to check; select the "31 GB Disk" option when the app opens and it is usually listed as "Partition 2".
|
|
|
[Reflashing the Librem 5](https://developer.puri.sm/Librem5/Development_Environment/Phone/Troubleshooting/Reflashing_the_Phone.html) may end up creating a root partition that does not use up the entire eMMC storage, usually with only 4GB with the rest being unallocated free space when this happens.
|
|
|
|
|
|
You can use the "Disks" app on the Librem 5 to check; select the "31 GB Disk" option when the app opens and it is usually listed as "Partition 2"; alternatively, you can use `df -h` to see and look for the line that says `/` in the "Mounted on" column.
|
|
|
|
|
|
This limited storage space can cause errors when attempting to install additional apps from the PureOS Store because there would not be enough space to install the apps or any system updates.
|
|
|
|
|
|
If the root partition isn't using all of the eMMC storage, these steps will resize the partition to use the remaining free space.
|
|
|
If the root partition isn't using all of the eMMC storage, these steps will resize the partition to use the entire eMMC capacity.
|
|
|
|
|
|
**Warning**: Before starting to resize a volume or its partition, a backup should be created. Follow these steps at your own risk!
|
|
|
|
|
|
1. Enter [flash mode](https://source.puri.sm/Librem5/community-wiki/-/wikis/Tips-&-Tricks#flash-mode) on the Librem 5.
|
|
|
2. Use [Jumpdrive](https://github.com/dreemurrs-embedded/Jumpdrive) to mount the Librem 5 as a USB disk. You may be prompted to unlock the LUKS partition. Ignore the prompt and leave it unmounted. You won't be able to resize the partition if it is being used.
|
|
|
3. On the host machine, open up a terminal and check to see which device is the Librem 5 using `lsblk`. In this example, `/dev/sdd` is the Librem 5; keep this path in mind for the following steps (If the Librem 5 is mounted at `/dev/sdb` or any other letter, `sdX`, use that instead). The LUKS volume, which is `/dev/sdd2` here, should not be unlocked yet. If it is, run `sudo cryptsetup close /dev/sdd2 <mount_name>` where `<mount_name>` is the name that the LUKS partition is mounted to.
|
|
|
|
|
|
```
|
|
|
$ lsblk
|
|
|
...
|
|
|
sdd 8:48 1 29.1G 0 disk
|
|
|
├─sdd1 8:49 1 465M 0 part /media/myuser/099d2c54-15c3-4354-963f-8d8d5c6a93a5
|
|
|
└─sdd2 8:50 1 3.7G 0 part
|
|
|
```
|
|
|
1. From the Librem 5, open up the Terminal app.
|
|
|
|
|
|
4. Use `parted` to resize the LUKS partition. You can install `parted` with `sudo apt install parted` if you don't have it.
|
|
|
2. Check to see the total size of the root partition by entering `df -h`. If the partition is only about 4 GB, then you have this issue.
|
|
|
|
|
|
```
|
|
|
$ sudo parted /dev/sdd
|
|
|
GNU Parted 3.4
|
|
|
Using /dev/sdd
|
|
|
```sh
|
|
|
$ df -h
|
|
|
Filesystem Size Used Avail Use% Mounted on
|
|
|
/dev/dm-0 3.6G 3.4G 54M 99% /
|
|
|
overlay 3.6G 3.4G 54M 99% /usr/lb/firmware
|
|
|
```
|
|
|
|
|
|
1. Inside `parted` run `print` just to make sure you are using the proper device. You should see two primary partitions:
|
|
|
3. Use GNU Parted to resize the root partition. The following command will enter an interactive prompt.
|
|
|
|
|
|
```
|
|
|
(parted) print
|
|
|
Model: JumpDrive eMMC (scsi)
|
|
|
Disk /dev/sdd: 31.3GB
|
|
|
Sector size (logical/physical): 512B/512B
|
|
|
Partition Table: msdos
|
|
|
1 5243kB 493MB 488MB primary ext2 boot
|
|
|
2 493MB 4499MB 4007MB primary
|
|
|
```sh
|
|
|
$ sudo parted /dev/mmcblk0
|
|
|
```
|
|
|
|
|
|
2. Enlarge the 2nd to 100% capacity.
|
|
|
4. Enter the following lines while in the GNU Parted prompt to resize the partition.
|
|
|
|
|
|
```sh
|
|
|
resizepart 2 30.5GB
|
|
|
quit
|
|
|
```
|
|
|
(parted) resizepart 2 100%
|
|
|
```
|
|
|
|
|
|
3. Print to see if the partition expanded correctly and then quit the program.
|
|
|
|
|
|
```
|
|
|
(parted) print
|
|
|
Model: JumpDrive eMMC (scsi)
|
|
|
Disk Flags:
|
|
|
This will look like the following in the terminal app:
|
|
|
|
|
|
Number Start End Size Type File system Flags
|
|
|
1 5243kB 493MB 488MB primary ext2 boot
|
|
|
2 493MB 31.3GB 30.8GB primary
|
|
|
```sh
|
|
|
(parted) resizepart 2 30.5GB
|
|
|
(parted) quit
|
|
|
Information: You may need to update /etc/fstab.
|
|
|
```
|
|
|
|
|
|
5. If you’re using an encrypted device run the following command – you will be asked for your encryption password. The encrypted LUKS volume is not automatically resized from the previous steps. To resize the LUKS encrypted volume, the encrypted volume needs to be opened. To open the volume, the "open" command is used. The "librem5_crypt" volume name is arbitrary and you can name it anything else such as "l5lv" if you wish. The LUKS password is "123456" by default.
|
|
|
|
|
|
```
|
|
|
$ sudo cryptsetup open /dev/sdd2 librem5_crypt
|
|
|
Enter passphrase for /dev/sdd2: <PASSWORD>
|
|
|
```
|
|
|
|
|
|
6. The resize command takes the volume name as specified while opening the volume in the previous step. The command will not show any output without the `-v` option.
|
|
|
5. If the disk is encrypted, run the 3 following commands:
|
|
|
|
|
|
```sh
|
|
|
sudo cryptsetup resize /dev/mapper/crypt_root
|
|
|
sudo resize2fs /dev/mapper/crypt_root
|
|
|
```
|
|
|
$ sudo cryptsetup resize librem5_crypt -v
|
|
|
No usable token is available.
|
|
|
Enter passphrase for /dev/sdd2:
|
|
|
Key slot 0 unlocked.
|
|
|
Command successful.
|
|
|
```
|
|
|
|
|
|
7. Finally, the file system needs to be expanded to the new size. The `e2fsck` tool must be run before `resize2fs` or else `resize2fs` will return an error `Please run 'e2fsck -f /dev/mapper/librem5_crypt' first.`.
|
|
|
|
|
|
```
|
|
|
$ sudo e2fsck -f /dev/mapper/librem5_crypt
|
|
|
e2fsck 1.46.5 (30-Dec-2021)
|
|
|
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
|
|
|
/dev/mapper/librem5_crypt: 97714/243840 files (0.2% non-contiguous), 749235/974080 blocks
|
|
|
```
|
|
|
6. Reboot the device.
|
|
|
|
|
|
```
|
|
|
$ sudo resize2fs -p /dev/mapper/librem5_crypt
|
|
|
resize2fs 1.46.5 (30-Dec-2021)
|
|
|
Resizing the filesystem on /dev/mapper/librem5_crypt to 7509504 (4k) blocks.
|
|
|
The filesystem on /dev/mapper/librem5_crypt is now 7509504 (4k) blocks long.
|
|
|
```sh
|
|
|
sudo reboot
|
|
|
```
|
|
|
|
|
|
8. The Librem 5 should be safely removed from the host computer before booting up the Librem 5 and you should now see the root partition use up all of the available eMMC space.
|
|
|
7. After the Librem 5 has rebooted, open up the Terminal app and check the partition size again with `df -h` to confirm that the root partition has a capacity of around 31 GB.
|
|
|
|
|
|
## General
|
|
|
|
... | ... | |