Nixos infect, boot part just 100mb

Just used nixos-infect on a Ubuntu vm on oracle cloud. Before nixos the boot partition is 1gig but after the partition is just 100mb, this makes it problematic when updating kernels.

Before infect:

ubuntu@amd1:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 49G 0 part /
├─sda14 8:14 0 4M 0 part
├─sda15 8:15 0 106M 0 part /boot/efi
└─sda16 259:0 0 913M 0 part /boot
ubuntu@amd1:~$

This is after nixos infect:

Looks like the infect uses the boot/efi as boot?

Any pointers or help is appreaciated.

Ps sorry for mixing image and text in the examples.

Best regards

Yeah, nixos-infect will use EFI boot if supported.

As nixos-infect does not re-partition your drive, but reuses the existing partitions, there seems to be no easy solution to this, unless Oracle allows you to customize the partition layout.

You can try nixos-anywhere which seems to integrate with Disko to allow for re-partitioning.

Otherwise, you could try to generate a VM image, instead of converting an existing machine, e.g. with nixos-generators. Seems like Oracle does support it, but has a bunch of requirements, including, strangely, legacy BIOS boot.

NixOS didn’t change your partition sizes. The old OS was just using two separate partitions while your new NixOS configuration is only using one of them. You can configure NixOS to use the 99M partition for the boot loader and the 923M partition for kernels and stuff. You can configure the smaller one to be mounted e.g. at /efi and then set boot.efiSysMountPoint = "/efi"; and then configure the larger one to be mounted at /boot. With grub, that should be all you need. With systemd-boot (which is the boot loader I recommend in the first place), you need to additionally change the GPT type code for the /boot partition to the XBOOTLDR type and then set boot.loader.systemd-boot.xbootldrMountPoint = "/boot";

Ah i see!
Im thinking maybe i can use cloud init to partition the disk.

If this works cloud init can both partition disk and run the infect script, which would be nice.

Gonna check out the image generators, sound more stable and reproducible!

Thanks for the pointers!

Will try this! Thanks!