NixOS/mobile-nixos

pine64-pinephone: boot.growPartition has no effect

queezle42 opened this issue · 3 comments

I have verified:

  • boot.growPartition is set to true (verified with nix eval)
  • system.config.boot.initrd.postDeviceCommands contains a call to growpart, so it should be called but seems to have no effect.
  • I have talked to multiple Pinephone owners who have the same problem.

growPartition = true is set in rootfs.nix which implies to me that it should work in mobile-nixos, but I also can't figure out where the postDeviceCommands are integrated into mobile-nixos.

Is this a feature that is currently not implemented, or is this a bug?

Is this a feature that is currently not implemented, or is this a bug?

Yes. Both.


#135 was about that, before disappearing (long story). #251 has a link to the archive page.

The gist of it is that this had incorrectly been added to the examples/demo configuration; it has no effect in Mobile NixOS because there is no implementation for it in our stage-1. Note that the filesystem will grow as needed.

For a long time this was totally hidden from me as a bug because Android-based devices do not resize partitions (and should not). Flashing the rootfs to the existing larger partition grew the filesystem as expected.

Though I'm thinking of adding support for it soon enough as I'm sure we'll be getting more and more Mobile NixOS users, and it's more convenient than having to manually expand the backing partition.

And as I noted in that issue:

Though, I'm not too comfortable with partitions resizing considering how bricky it can be to resize partitions on some devices. It might be best to implement it with a whitelist per device safeToRepartition.

Thanks for the clarification! This should probably be mentioned in the device-specific notes.

Workaround: Use cfdisk and resize2fs to grow the partition and fs.