I got excited with what I heard about NixOS, so I want to try it. However, I have run into an issue with partitioning. When I am following the manual, for UEFI partitioning, using parted, I end up with the following warning:
Warning: You requested a partition from 1000kB to 512MB (…)
The closest location we can manage is 1000kB to 412MB (…)
Is this still acceptable to you?
If I enter “Yes” here I am warned with:
Warning: The resulting partition is not properly aligned for best performance: 1953s % 2048s != 0s.
Any suggestion on what I should do in this situation?
it would probably work fine, honestly, but the “correct” fix is to align the partition start the way it says
kB in parted is decimal kilobytes, so you asked it to start at 1,000,000 bytes. sectors are 512 bytes, so doing the arithmetic I verify that you asked it to start at 1953 sectors and a little bit, which is what it’s telling you.
2048 sectors is 1024 kibibytes (binary “kilobytes”). the way I normally specify quantities like that is by writing 1024KiB (instead of 1000kB as you wrote), which is notation that parted understands, so in your place I’d do that.
it does waste a bit of space. it’s not significant by today’s standards, but still… anyway, while I haven’t run benchmarks or anything and it would depend on your hardware, I would guess that you’re more likely to notice the time cost of not aligning it properly than the space cost of aligning it. so I’d align it.
it might be helpful also to know what size your disk is and what other partitions you’re putting on it, if you feel like sharing. it’s a bit weird that it’s a hundred megs smaller than you seem to expect.
And, it was the last command that threw this warning:
Warning: You requested a partition from 1000kB to 512MB (sectors 1953..1000000).
The closest location we can manage is from 1000kB to 412MB (sectors 1953..804863).
Is this still acceptable to you?
When I opened my drive in cfdisk I could easily see start and end block for the remaining boot partition. So, I used those values for the final partition command. Then it ran without any warnings.
After I had installed the OS, and rebooted, no boot partition was found. So, I had to start from scratch again. This time the numbers of the boot partition made a lot more sense. I do not know what I did wrong the first time.
Below is how I ended up partitioning my drive. I used cfdisk to find start and end sector for the boot partition. Maybe, this time, it would have worked using the command parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB. I forgot testing that.
Really wish parted just had a --auto-align like toggle… I’m not really concerned about losing a sector worth of information. However, having a command fail on me because of slight alignment issues is infuriating.
there’s definitely lots of valid ways to partition things. I like parted because I talked with the maintainer a long time ago and I appreciated the things he said about reliability in low-level tools like this (since anything operating at this level has potential to corrupt things). the other tools are all also fine though, it’s very rare to hear of a problem with any of them in practice. it’s just slightly different styles, an entirely personal decision at the end of the day.