4

I have 32Gb RAM and this web server using Nginx and Web Application with MySQL database.

I plan to partition my SSD hard drive into /boot/efi, swap, /, and /home. If considering the beginning of my disk is faster than its end, how shall I arrange the order of my partitions?

  1. Should / (root) be as close to the front as possible, because there is the running OS?

  2. Should swap also be as close to the front as possible, because swapping back and forth with main memory should be fast?

  3. Does efi need to be near the front or not?

  4. How about /home?

  5. Which one is the correct orders option 1 or 2?

    1. The correct order for the size of the partition from smallest to largest. Example:

      1. /dev/sda1=/boot/efi = 1-2Gb
      2. /dev/sda2=Swap = 8 GB
      3. /dev/sda3=/(root) = 50Gb
      4. /dev/sda4=/home = 100Gb (without /home recomended or not?)
    2. Largest to smallest:

      1. /dev/sda1=/home = 100Gb (without /home recomended or not?)
      2. /dev/sda2=/(root) = 50Gb
      3. /dev/sda3=swap=8Gb
      4. /dev/sda4=/boot/efi = 1-2Gb
4
  • 5
    Why do you think the beginning is faster than the end if it's an SSD? Does it explicitly advertise using SLC for the beginning of the disk?
    – forest
    Jan 14, 2023 at 5:28
  • 4
    Typically only spinning disks are faster in one section vs. another. Unless you have a hybrid SSD, it should be uniform speed.
    – user10489
    Jan 14, 2023 at 5:37
  • Each user may have different requirements, so they generally do not like opinions. I prefer to have ESP first & swap partition last as I never change those. I use 300 to 500MB for ESP & 4GB for swap. But I have over 4GB of RAM, so never have used swap with my specific use of system. I prefer /home inside / but then large data partition. Both /home & data partition get regularly backed up, but only a few files in / get backed up(usually by copying into /home folder when edited).
    – oldfred
    Jan 14, 2023 at 16:16
  • Unless this you have special requirements (such as a web server), you don't actually need any swap capabilities, especially on a desktop PC with plenty of RAM. Jan 15, 2023 at 15:32

2 Answers 2

8

It doesn't matter

In practice, putting the EFI partition first is recommended since it is unlikely to be harmed by partition shifting and resizing activities. However, putting the EFI at the end of the disk or anywhere else can work almost as well in most cases. The rest of the partitions simply don't matter.

The kernel only needs to know where it should look to find mount points /root (/dev/sda3 in your case).

The speed is the same on the entire disk.

1

A SSD is the same speed all over. They're circuit boards, not spinning disks so the old advice is now obsolete.

If this is a production system, you should consider a separate /var/log and a separate /var/lib/mysql partition.

Since its getting a bit chopped up, rather than using separate partitions, consider LVM and leave some spare/unallocated so if a volume approaches full you can enlarge one without downtime.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .