... | ... | @@ -57,9 +57,13 @@ GPS: Seems to work internally but user interfaces in PureOS are still missing (e |
|
|
|
|
|
`Phosh` now acts as a `geoclue` agent so applications like `GNOME maps` and `Pure Maps` can use use location services with the internet connection to show your location on the maps; see: <https://puri.sm/posts/librem-5-news-summary-april-2021/>
|
|
|
|
|
|
### Reflashing with LUKS Doesn't Use the Entire eMMC Storage
|
|
|
### Reflashing Doesn't Use the Entire eMMC Storage - "Root partition is not enlarged"
|
|
|
|
|
|
[Reflashing the Librem 5](https://developer.puri.sm/Librem5/Development_Environment/Phone/Troubleshooting/Reflashing_the_Phone.html) with the `--variant luks` option (`$ ./scripts/librem5-flash-image --variant luks`) may end up creating a root (LUKS) partition with only 4GB with the rest being unallocated free space. 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". 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 them.
|
|
|
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".
|
|
|
|
|
|
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.
|
|
|
|
... | ... | @@ -67,82 +71,88 @@ If the root partition isn't using all of the eMMC storage, these steps will resi |
|
|
|
|
|
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, 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.
|
|
|
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/hostuser/099d2c54-15c3-4354-963f-8d8d5c6a93a5
|
|
|
├─sdd1 8:49 1 465M 0 part /media/myuser/099d2c54-15c3-4354-963f-8d8d5c6a93a5
|
|
|
└─sdd2 8:50 1 3.7G 0 part
|
|
|
```
|
|
|
|
|
|
4. Use `parted` to resize the LUKS partition. The lines with `(parted)` are the prompt prefixes within the `parted` tool.
|
|
|
|
|
|
The partition number should be the one that contains the LUKS partition (Partition 1 here is the boot partition, which is not the same).
|
|
|
|
|
|
The `End? [----MB]?` prompt is asking where to end the partition, not specifically how large to make the partition directly. The total size would be the ending location (31.3GB) minus the starting location (493MB).
|
|
|
|
|
|
The use of `print` within the `parted` tool are optional but are shown here for verbosity.
|
|
|
4. Use `parted` to resize the LUKS partition. You can install `parted` with `sudo apt install parted` if you don't have it.
|
|
|
|
|
|
```
|
|
|
$ sudo parted /dev/sdd
|
|
|
GNU Parted 3.4
|
|
|
Using /dev/sdd
|
|
|
(parted) print
|
|
|
Model: JumpDriv e 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
|
|
|
(parted) resizepart
|
|
|
Partition number? 2
|
|
|
End? [4499MB]? 31.3GB
|
|
|
(parted) print
|
|
|
Model: JumpDriv e eMMC (scsi)
|
|
|
Disk Flags:
|
|
|
|
|
|
Number Start End Size Type File system Flags
|
|
|
1 5243kB 493MB 488MB primary ext2 boot
|
|
|
2 493MB 31.3GB 30.8GB primary
|
|
|
|
|
|
(parted) q
|
|
|
Information: You may need to update /etc/fstab.
|
|
|
```
|
|
|
|
|
|
5. The encrypted LUKS volume is not automatically resized. To resize the LUKS encrypted volume, the encrypted volume needs to be opened. To open the volume, the "open" command is used. The "sdd2_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.
|
|
|
1. Inside `parted` run `print` just to make sure you are using the proper device. You should see two primary partitions:
|
|
|
|
|
|
```
|
|
|
(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
|
|
|
```
|
|
|
|
|
|
2. Enlarge the 2nd to 100% capacity.
|
|
|
|
|
|
```
|
|
|
(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:
|
|
|
|
|
|
Number Start End Size Type File system Flags
|
|
|
1 5243kB 493MB 488MB primary ext2 boot
|
|
|
2 493MB 31.3GB 30.8GB primary
|
|
|
(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 sdd2_crypt
|
|
|
$ 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.
|
|
|
|
|
|
```
|
|
|
$ sudo cryptsetup resize sdd2_crypt -v
|
|
|
$ 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/sdd2_crypt' first.".
|
|
|
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/sdd2_crypt
|
|
|
$ 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/sdd2_crypt: 97714/243840 files (0.2% non-contiguous), 749235/974080 blocks
|
|
|
$ sudo resize2fs -p /dev/mapper/l5lv
|
|
|
/dev/mapper/librem5_crypt: 97714/243840 files (0.2% non-contiguous), 749235/974080 blocks
|
|
|
$ sudo resize2fs -p /dev/mapper/librem5_crypt
|
|
|
resize2fs 1.46.5 (30-Dec-2021)
|
|
|
Resizing the filesystem on /dev/mapper/l5lv to 7509504 (4k) blocks.
|
|
|
The filesystem on /dev/mapper/l5lv is now 7509504 (4k) blocks long.
|
|
|
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.
|
|
|
```
|
|
|
|
|
|
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.
|
... | ... | |