[CentOS] Physical position of swap partition on the disk

Mon Nov 30 07:35:22 UTC 2020
Nicolas Kovacs <info at microlinux.fr>

Hi,

Here's a question to the fine-tuning gurus.

Yesterday while installing a fresh CentOS server, I wondered how big of a deal
the physical position of the swap partition on the disk is.

Here's an example of a simple MBR partitioning scheme on a legacy BIOS machine
with a 60 GB SSD:

  * /dev/sda1: 500 MB /boot ext2
  * /dev/sda2: 4 GB swap
  * /dev/sda3: 55 GB / ext4

In the old (Slackware) days, I created the partitions manually using fdisk.

Now when I do something similar in Anaconda, I have to reason in terms of mount
points. So in a similar order I create the /boot partition, the swap partition
and the root partition.

What happens here is that Anaconda will always invert the root and swap
partitions and put the swap partition at the end of the disk. So my setup looks
like this:

  * /dev/sda1: 500 MB /boot ext2
  * /dev/sda2: 55 GB / ext4
  * /dev/sda3: 4 GB swap

I'd be curious to know what's the reason behind this, and if this kind of
configuration detail is really significant.

Cheers,

Niki

-- 
Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Site : https://www.microlinux.fr
Blog : https://blog.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32
Mob. : 06 51 80 12 12