[CentOS] Physical position of swap partition on the disk

Mon Nov 30 14:22:45 UTC 2020
Walter H. <Walter.H at mathemainzel.info>

On 30.11.2020 13:55, Jonathan Billings wrote:
> On Nov 30, 2020, at 02:35, Nicolas Kovacs <info at microlinux.fr> wrote:
>>   * /dev/sda1: 500 MB /boot ext2
>>   * /dev/sda2: 55 GB / ext4
>>   * /dev/sda3: 4 GB swap
>> Now, SSDs don’t have the same physical characteristics, so it doesn’t matter. Also, cloud storage and virtual machines don’t even have real hardware.
without hardware neither cloud storage nor virtual machines;
>> The partitioning is handled by different code starting in el7, and this seems to be the logic built in.  I feel like it was written to assume that root and swap are on LVM.  When it comes to resizing file systems, it might make sense to put the root ext4 at the end of the disk, so it is actually counterproductive to put swap at the end.

is there a rule that says that the order of the partitions in the 
partition table corresponds to the order of them itself on disk?


keep in mind, that the order on disk can be something different then the 
order in the partition table;