SSD sector alignment

Continuing the discussion from How to increase the life of SSD.

How do I know if EndeavourOS was installed on a partition that is sector aligned?

I did a manual partition install and don’t know if I did it right in terms of sector alignment or not.

As far as I know, Calamares uses kpmcore as the back end for creating partitions during the installation. Kpmcore uses fdisk to do the partitioning. If you look at the man page for fdisk, the CHS referencing is deprecated and ever since version 2.17 of util-linux (package that contains fdisk), fdisk gets the sector size from the kernel and specifying the sector size manually is not recommended. This applies to auto and manual partitioning within Calamares.

It all boils down to you don’t have any control over the sector alignment within the installer. If you want total control of the sector size and alignment, you need to do your partitioning before running the installer and use something like fdisk, parted, gfdisk (or similar tools). Sectors alignment usually will begin at 512Kb, 1024Kb, 2048Kb, and 4096Kb. So if the first partition created begins at one of those positions, the sectors are aligned.

If some one knows better, please chime in. :slight_smile:

1 Like

Thanks @eznix! If I understand well what you just said, I shouldn’t worry about sector alignment because that’s taken care of by the installation media regardless of whether you use manual or automatic partitioning. If I remember correctly, I used gparted from the installation media to resize the old partition and create the new one where EndeavourOS was installed.

1 Like

As noted above by eznix, you should be fine.

However, if you want to be sure, parted can do a check; run:

sudo parted /dev/sda align-check optimal

(replace sda with the appropriate disk indentifier if necessary)

You will be prompted to check individual partitions. You should get a return of “aligned.”

Stagger_Lee:sudo parted /dev/sda align-check optimal
Partition number? 1                                                       
1 aligned
Stagger_Lee:sudo parted /dev/sda align-check optimal
Partition number? 2                                                       
2 aligned

You could specify the partition at the end of the command, if you prefer:

sudo parted /dev/sda align-check optimal 1

Stagger_Lee:sudo parted /dev/sda align-check optimal 1    
1 aligned
Stagger_Lee:sudo parted /dev/sda align-check optimal 2
2 aligned

Excellent! Thank you very much @Stagger_Lee!

Indeed the output of that command was aligned for the 3 partitions I have in the disk. That’s reassuring!


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.