CentOS build lamp server environment hard disk partition scheme sharing

Time:2021-9-11

CentOS is one of the Linux distributions. It is compiled from the source code released by Red Hat Enterprise Linux according to the open source regulations. Due to the same source code, some servers requiring high stability use CentOS instead of the commercial version of Red Hat Enterprise Linux. The difference between the two is that CentOS does not contain closed source software.

In the process of using Linux as a server, we often feel confused about how to allocate the partitions in the hard disk more reasonably. In particular, friends who have just started to contact Linux have no bottom in mind about the reasonable allocation of partitions in the hard disk space in the server. Now we list the following schemes for everyone to learn! Of course, you can also make more reasonable decisions according to your own needs!

/Boot 100MB kernel and boot file

Mount point: select “/ boot”
File system type: use the default ext4 log file system
Size: enter the allocated size in MB
Other size options: select fixed size.

Swap swap space is generally twice the server memory

/ 10G

Mount point: select “/”
File system type: use the default ext4 log file system
Size: enter the allocated size in MB
Other size options: select fixed size.

/Usr is at least 5g, and the whole Linux system is basically installed here. I like 10g

Mount point: select “/ usr”
File system type: use the default ext4 log file system
Size: enter the allocated size in MB
Other size options: select fixed size.

/Usr / loacl / 5 to 10 g is enough (don’t install Oracle here, otherwise it won’t be enough to play, ha ha) we are used to putting the things compiled and installed by lamp here (this is the power of habit, and the official recommends that we install the / opt directory)
It’s mainly for PHP websites,
/Home doesn’t have to be separated
All the remaining space is used for PHP websites (for example, mount in / usr / local / apache2 / HtDocs /)

Large number of visits, pay attention to clean up temporary files in time, and click / tmp
Note the log file

Summary: hard disk partition is often a problem that needs to be considered when the server is officially put into use, so the later use needs to be considered in the process of early planning! This article will give you a clearer understanding of the formal production environment of the server.

CentOS hard disk partition scheme II

It is a very important step to partition the hard disk when installing the Linux system on the computer. Several partition schemes are introduced below.

(1) Option 1
/: the recommended size is more than 5GB.
Swap: swap partition. The recommended size is 1 ~ 2 times of physical memory.

(2) Option 2
/Boot: used to store programs related to Linux system startup, such as boot loader. The recommended size is 100MB.
/: the root directory of the Linux system. All directories are hung under this directory. The recommended size is more than 5GB.
/Home: store the data of ordinary users. It is the host directory of ordinary users. The recommended size is the remaining space.
Swap: implement virtual memory. The recommended size is 1 ~ 2 times of physical memory.

(3) Option 3
/Boot: used to store programs related to Linux system startup, such as boot loader. The recommended size is 100MB.
/Usr: it is used to store applications in Linux system. There are many related data. It is recommended to be greater than 3gb.
/Var: used to store frequently changing data and log files in Linux system. It is recommended to be greater than 1GB.
/Home: store the data of ordinary users. It is the host directory of ordinary users. The recommended size is the remaining space.
/: the root directory of the Linux system. All directories are hung under this directory. The recommended size is more than 5GB.
/TMP: put the temporary disk in a separate partition to avoid affecting the stability of the system when the file system is full. The recommended size is more than 500MB.
Swap: implement virtual memory. The recommended size is 1 ~ 2 times of physical memory.

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]