0

I'm doing a clean install of CentOS 8 minimal, and by default it suggests these paritions:

swap swap 4G
/boot ext3 512M
/     ext4 2014G
/home ext4 all

(this is with a pair of 4TB NVMe drives in software RAID 1)

I understand the need/benefit of separate swap/boot/data partitions, but what's the reasoning to have two separate data partitions?

My gut instinct is to restructure it as

swap swap 4G
/boot ext3 512M
/     ext4 all

But I assume CentOS knows better than I do and there's a good reason for the separate /home partition.

This will be a webserver and database server. Traditionally I've stored web files in /var/www/sites, and database in /var/lib/mysql.

/home (as a directory, not a separate parition), in my experience, is essentially empty other than .bashrc, .vimrc etc, and occasionally a temporary landing place if I FTP files to the server.

Am I doing it wrong? confused

Thank you!

1
0

Why is home a separate partition? In case mistakes happen. You stated that your data dirs are normally that of /var/www and /var/lib/mysql. Many other people use their home directories to store important files, documents, code. Your use case is one of a production server where files in /home are not important. For a user using Linux or CentOS as a desktop, a separate /home folder means is very important.

But how does a separate /home partition keep me safe? When something goes wrong and a will require a reinstall of the OS. The setup wizard may detect an existing /home folder and will map that /home folder back into the OS. So every other partition will be wipped and reinstalled, but your files will be safe.

Just like ext4 is important for keeping your filesystem safe. /home partitions keeps your files safe.

4
  • Thanks @Arlion. So given this is for a production web/database server, rather than a personal desktop PC... what partitions would you go with? And would you store web/DB stuff somewhere other than those default directories? As for ext4, I assume you're referring to the ext3 boot partition? The CentOS installer gave that as the default suggestion, I assumed it was for good reason - something like the BIOS expecting ext3 and not being able to access ext4 until the kernel had booted, etc. You think the boot partition should be changed to ext4 then? Thank you! – Codemonkey Nov 10 '20 at 15:03
  • 1
    I am a purist, in that the default dirs are where things should go. Keeping things standard means the next person after me will need to spend less time figuring out how things work. As for production servers, it is clear that you are not required to maintain any SOX/PCI compliance. Required practice in a SOX compliance environment require seperate partitions for /var, /var/log, /tmp (in tempfs), /home, /opt, /usr. – Arlion Nov 10 '20 at 15:08
  • I removed my claims about ext3, I'm not sure how CentOS 8 handles boot partitions that are not fat. – Arlion Nov 10 '20 at 15:10
  • I've not heard of SOX (I'm in the UK, maybe it's a US-only thing), but I'm certainly not keeping any credit card numbers - all ecommerce is handled through PayPal. Given what you said earlier about "The setup wizard may detect an existing /home folder and will map that /home folder back into the OS. So every other partition will be wipped and reinstalled, but your files will be safe." would you be creating a separate partition for /var/mysql/lib and /var/www? – Codemonkey Nov 10 '20 at 15:28
0

In common, for workstations it try to separate human actions with server actions. It's not a rare case when human behavior lead to overfilling of a working partition, for example you build software and it run out of space. In this case processes will be able at least collect logs and keep their vital temporary data to function. This is also a good point of separating human and server data to ease migration.

For servers, you can keep your mail in /home, keeping queues in /var. If your mail will overfill the /home partition your mail server will just return temporary errors having no problems to function, just no space to save mail, but if it will be just / partition - it will not be able even to log what happening and likely it will crash. When you will log next day - you will find crashed software and nothing in logs. It even can be a problem to log on, because /var is vital for other services like ssh and systemd.

In more conservative environment like BSD not only /home is separated - /usr /var and /tmp are usually placed on different partitions.

0

For me the main reason is that the majority of users who don't know enough to examine a partition table themselves are going to be home/desktop users rather than server administrators. For these people, if something goes catastrophically wrong with the operating system, they can essentially get back (with a bit of work) to exactly where they were before the failure by reinstalling everything they had installed before.

Once personal pictures, documents etc are lost, they're gone forever. You can maybe make similar, but it'll never be the one you lost.

A separate home partition makes it easy to reinstall an operating system without losing the things that are irreplaceable.

0

In a short, if you're running out of space because of any application on /home, your machine will still work and accepts SSH connections if you have it on a different partition.

The same concern applies when you install a specific service like:

  • MySQL, create a different partition like /var/db/mysql
  • A proxy/cache application, create different partitions like /cache

so if this service creates any amount of data beyond the expected, this will be stopped by the partition size and prevent your entire system stop working.

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.