Page MenuHomeSolus

Solus Installer does not align partitions to 4KiB boundaries for best practices
Open, HighPublic

Description

I was just playing around with Solus in a VM to see how it defaulted it partition setup (using the Plasma Testing ISO). What I noticed is that the installer doesn't follow modern best practices, and it will result in a partition layout that will hurt SSD performance and lifetimes. SSD partitions and modern 4K HDD should always have their sectors 4KiB aligned.

GParted, KDE Partition Manager, and Windows utilities default to aligning partitions to 2048 sectors (512 B/sec = 1 MiB boundaries). 1 MiB alignment will always be 4KiB aligned as well as for any potential issues with flash erase block sizes (which are higher than 4K).

I did an install from UEFI with ext4, and let it pick swap space, it resulted in this EFI partition

PartitionStart SectorEnd SectorSizeSize (MiB)4KiB Aligned1 MiB Aligned
EFI6410000631000000488.28YN
swap1000095881259478125003814.70NN
ext4881262610485740461039761421507696.01NN

The EFI partition is 4KiB aligned, but it doesn't match the default used for other programs. For some reason, the installer is leaving a 32 sector gap between the partitions, which then leaves all subsequent partitions misaligned. It would probably be better to just align all partitions to the 2048 sector/1MiB boundary.

jon.grossart renamed this task from Solus Installer does not align partitions to best practices boundaries to Solus Installer does not align partitions to 4KiB boundaries for best practices.
jon.grossart added a comment.EditedDec 5 2018, 7:08 AM

I just checked what happens if you have the installer resize a windows partition, and it does the same behavior. It leaves 32 sectors between the partitions, which causes the alignment to be off.

I don't know python at all or what that code would fix, but it seems like that installer is still trying to calculate stuff off the older geometry idea which isn't used for modern storage devices anymore.

I should also note if wasn't clear, this was tested with UEFI. I didn't test with MBR booting.

Edit: I just tested with MBR and the results are worse. It defaults to just a swap partition that started at sector 93 and then had the same 32 sector spacing between partitions. This would mean that no partition is 4k aligned.

Lorien added a subscriber: Lorien.Dec 5 2018, 10:26 AM

I was making a note for myself on how to fix it. You don't need to do anything :)

JoshStrobl triaged this task as High priority.
crom5 added a subscriber: crom5.Dec 6 2018, 2:36 PM

Asus and Lenovo SSD equipped laptops here. Important question: whatever fix arrives, will it require a new Solus installation or not? Thanks...

You can always fix partition errors yourself by moving partitions around (assuming the filesystems contained in them support it). But that's also going to copy everything in the partition around.

If you manually did the partitioning, you can set it up to avoid this as well if you're careful. I didn't test what alignment that provides. Or make sure you use a tool like fdisk/gdisk/GParted/KDE Partition Manager and will do the alignment for you.

Bugs like this might be a good reason to look at something like Calamares for the next version of the installer rather than maintaining all this logic in-house.

We have zero interest in using someone else's installer. Ours is overdue for an overhaul, but I have higher priority projects in my queue.