Open chayleaf opened 2 years ago
If you need to change the partitions before installing NixOS, why not emergency-kexec instead of nixos-infect? :)
(One might have to change the modules a bit, but you get an in-memory NixOS and all the block devices are writable.)
- Resize the vm2 efi partition by moving the ext partition further and recreating the efi partition (optional, the default of 100mb is just barely enough), btrfs-convert the vm2 root partition. Dont forget to label the new partitions properly (UEFI and cloud-root or something like that)
Could you elaborate on this one? I end up with a disk that isnt bootable when I try to resize it. I am roughly following this: https://superuser.com/questions/1230741/how-to-resize-the-efi-system-partition
And I end up with the following diff from blkid
:
Before (working):
/dev/sda1: UUID="B022-8CF1" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="c0954268-e4e2-409c-a9f4-de31d8b5e89a SEC_TYPE="msdos"
After
/dev/sda1: UUID="FC00-0B91" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="281e1ab9-cf5d-4c9e-8438-4260c6b0f29d"
Any tips @pavlukivan?
Interesting, mine is:
/dev/sda15: LABEL_FATBOOT="UEFI" LABEL="UEFI" UUID="78FD-AD17" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="6adc9979-75db-a447-b6dd-7878d792f77b"
Perhaps they updated the Ubuntu image? Try using an older one if you're using the latest one, or try using a newer one if you're using an old one.
I can at least see your volume has a different PARTLABEL and no SEC_TYPE, maybe it has something to do with that. EFI is always a bit finicky, try making it be as similar to the old partition as possible I guess... @kradalby
Thanks @pavlukivan, I actually managed yesterday, but I didn't have time to post an update. I'll try to remember when I get back, I have a nice set of commands now (I used them with the Oracle 8 image).
ah, that's why I recommended to use the Ubuntu image instead, it has a simpler partition table
Understandable, I used the Oracle image because it had "almost" the layout I wanted, I just wanted to expand the ESP.
My working cloud-init file for Oracle Linux 8.5 to NixOS with a larger (1gb) ESP:
https://gist.github.com/kradalby/0957a5d4fbb9018d0b700b118f5c5341
Important things to keep in mind:
With that in mind, rough operation order:
There's some leeway for errors (for example, the VM booted up even when I didn't mark the EFI partition type as EFI) but it still took me around 15 hours of trial and error to end up with this order