After you have decided on the function of your machine, you need to consider carefully the sizes of the partitions you're going to create. If you are not careful, the partitions will be too small to store your information and may cause the computer to freeze when a partition runs outof available space and is unable to accommodate new data. Try to estimate future usage as best you can. It is very difficult and very dangerous to try to resize live partitions. Be careful not to undersize your partitions. Following are some general partition size ranges for a typical system:
Partition
Size ranges
root
250-500MB
boot
16MB
usr
300-700MB
var
Partition size depends on usage. The /var directory normally contains log, temporary, and lock files.
home
Partition size depends on usage. If the machine is used for user accounts, enough space needs to be allocated to hold the users' files.
Temp space
50-400M
swap
2-3 times the RAM installed in the machine
Red Hat Enterprise Linux 9 Administration
The ranges cited above are for small desktop to large server installations, and are not set in stone. In planning and sizing partitions, you have to take into account what you will be doing with the system. For example, on a system that just serves news or is a database server, it might be fine to have a relatively small root partition, which would contain any home directories, and a large /var partition. A separate /tmp partition is usually not a bad idea under any circumstance.
The following diagram illustrates typical partition sizes matched to machine function.
Determining the partition layout, size, and swap space necessary for the Machine
Redhat Partition Sizes
When planning a filesystem in Red Hat, or any other Linux-based operating system, there are several considerations to take into account regarding partition sizes.
These considerations may vary based on the use case, but here are some general tips:
/ (Root) Partition: The root partition contains all the files and directories that are not found in other partitions. It's recommended to have a size of at least 10 GB for the root partition, but if you plan on installing a lot of software, you might want to increase this size to 20 GB or more.
/home Partition: This partition is where personal user data files are stored. The size will depend on how much personal data you expect to store. If you're unsure, you could allocate most of your remaining disk space to /home.
/var Partition: This partition is often used to store log files, and in some cases, it is used for serving files over a network. If your system will be heavily used, or you expect to serve many files, you might want to allocate 15 GB or more to /var.
/boot Partition: This partition is used to store the bootloader and kernel files. It doesn't need to be very large - typically around 500 MB is more than enough.
Swap Partition: The swap partition is used as a 'backup' for the system's physical memory. It's generally recommended to set the swap size equal to the amount of RAM for systems with less than 2 GB of memory, and at least 2 GB for systems with more than 2 GB of memory. For systems with large amounts of RAM (e.g., 64 GB), the swap space can be less than the RAM size.
/tmp Partition: This partition is used for storing temporary files. Depending on the applications you are running, you might need to adjust the size. A general recommendation could be around 10 GB or more.
Remember, these are just general guidelines. The specific needs of your system may require different partition sizes. It's also worth mentioning that the use of LVM (Logical Volume Management) can provide more flexibility, as it allows you to resize partitions dynamically as needs chang
Planning Partition Size - Exercise
Before moving on to the next lesson, click the Exercise link below to check your understanding of planning partition size and layout Planning Partition Size - Exercise
The next lesson explains how to plan swap space.