0

I got a 1.5TB datacenter-grade SAS SSD, and I am now installing a new install of CentOS 7 on it (CentOS 7 will be changed to CloudLinux later).

I am setting up the partition scheme and I have plenty of space to work with. My server has 256GB of RAM, so I'm not going to make SWAP 1.5x that obviously.

A lot of web activity from a huge amount of users simultaneously will be happening on this drive.

Here is what I came up with. What would you change?

/boot – 2 GB
/ = 25 GB
/tmp = 10 GB
Swap = 16 GB **
/home = remaining storage

Redhat recommends (at least) 4GB SWAP for a system with 64GB of RAM (source). So their recommendation comes to 1/16th for a system with large ram.

enter image description here

** Maybe they would also recommend 4GB SWAP for 256GB RAM, but I didn't see that, so the calculation of 256GB RAM / 16 = 16GB SWAP. If you have another recommendation, I would like to hear it.

1

2 Answers 2

1

Here is what I came up with. What would you change?

my recommendation would be to do like this

/boot           1gb  (or 2gb would be fine)
/boot/efi     100mb  (or 200mb would be fine)
/              max   (remaining space of your N tb ssd)

here is why I say this, take it fwiw

  • Been running work servers since RHEL 7.6, now on 7.9, over last ~5 years: my 1gb /boot partition currently at 44% full and my 100mb /boot/efi is 11%. Based on this I see no good reason to make them any larger.
    • caveat: if you're not doing EFI and doing the old BIOS way and do not have a boot/efi partition, then with everything lumped under just /boot I don't have any data or experience to tell you what to expect over time for that way vs like I do for EFI; so go with 2gb, 4gb at most; you won't miss < 10gb on a 1.5tb ssd
  • question for the ages: do we still need to make a swap disk partition when you have > ~64gb of RAM? My servers have 512gb and larger of RAM, I never make a swap disk partition and never had a problem. Same regarding my 32gb home pc with rhel/centos 7+ linux, no disk swap partition and never a problem.
  • at least in RHEL 7 storage admin guide chapter 15 states 8gb to 64gb swap = 1.5 x ram; > 64gb ram swap = at least 4gb.
    • wtf does at least mean? better make it 500gb to be safe ! ?
    • yes, I hate disk swap partitions. Someone (redhat?) provide evidence detailing how, when, why disk swap is beneficial when you have 256gb of RAM.

for partitioning out your disk:

  • /home or /var/log/audit or /opt or anything else is first subjective. But the big problem with doing this is you shortchange yourself in the long run, if you decide for /home for example just 25gb out of a 1000gb disk, you'll fill /home and wish you did it 50gb, and then wish it was 100gb, and so on. I've experienced this, when the mentality was *we have to partition out /home and /var and /opt and /usr. Well how big do we make each and guarantee there's never a problem. This is just a stupid mentality.
  • the only pro of partitioning out I am aware of is if you know you want to take advantage of some mount level option, such as noexec for example. Otherwise you typically do more harm than good
  • can anyone provide a good reason other than mount level options for partitioning out a disk? If not then why do it and set yourself up for failure.
  • you said making / just 25gb. This is not good, do NOT do that.
  • just have / as the entire disk minus the boot partitions and that way you'll never run out of space because of not having being able to predict what folders would have grown in size however they have... /home, /opt, /usr, /var.
  • the /tmp folder : do systemctl enable tmp.mount to use RAM (i.e. tmpfs) rather than disk; better performance. Otherwise let /tmp just fall under the mounting of / and then there is nothing to worry about until you exceed the physical size limitation of the disk.
  • nothing worse than doing df -h and some folder on a separate partition at 99% full and being a show stopper and also seeing on the same disk however many other partitions at whatever size less than 50% full and not being helpful or useful. This is wasteful and mismanagement, and not the kind of principles you should be configuring by and operating on.
0

For anything server-sized, you Really don't want to rely on static partitioning. Assuming this is a server from the last 15 years, it has UEFI boot – so, the partitions you need to make your operating system boot are:

  1. a vfat /boot/EFI partition
  2. the rest

And this gives you immense freedom; just, in your setup¹ step, make a GPT partition table, and two partitions:

  1. 8 GB /boot/EFI
  2. the rest LVM physical volume

That's it. Create logical volumes within that physical volume as needed – the good thing is that you can always have as many or as few as you want, have them in arbitrary order, don't need to shrink and move partitions later on, get snapshot abilities… at negligible performance downsides (haven't been able to measure any downside).

You would probably start with a / that's maybe 40 GB in size, and a home that fits what you think you need in the near future. You can, without any problem, increase the size of both volumes as needed later on. If you're using an online-resizable file system on these, like XFS for example, that even works while you're using them.


¹ while you're at it, don't start with centos7… that's already old, and you're not gaining anything.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.