Plan the partitions of the Linux operating system in advance
The partition planning of the Linux operating system is different from that of the Microsoft operating system. The latter's partition planning has little impact on its performance. However, the partition planning for Linux is different, which has a great impact on the server performance. In fact, I like to compare the partitions in the Linux operating system to the tablespace planning in the Oracle database. The two of them are similar. The quality of the plan will directly affect the running performance. However, you only need to make some adjustments during deployment, which has a significant impact on subsequent performance.
For example, if I use the Linux operating system as a server, I will consider placing some special directories on different partitions, which will improve the performance and security of subsequent servers. For example, you can place the/tmp directory and the/home directory in different partitions. For example, you can also place the/var and/usr directories in different partitions.
If the hardware conditions permit, it is best to place the/var directory on an independent partition. These directories have their special purposes and are frequently used. If they are placed separately, the data reading efficiency can be improved, and the competition between them in space can be reduced.
In addition, pay special attention to swap partitions. In Linux, swap partitions are like virtual memory in Windows. However, there is a big difference between the two in subsequent adjustments. For example, in Windows, if the virtual memory is insufficient, you can adjust it in the System Properties and Advanced tab. Even if the virtual memory is adjusted subsequently, the execution performance of the subsequent added space is the same as that of the original space.
In the Linux operating system, if the virtual space is insufficient, the performance of the application may be affected, or even the installation of the application. In this case, the adjustment process is much more troublesome than that of the Windows operating system. If you need to reinstall the operating system or partition a region from the hard disk as a swap partition.
However, if you divide a piece of space on the hard disk as virtual memory afterwards, the execution efficiency of the space added later will not be as good as the space specified during the installation process. Therefore, unless this Linux server is in use, we recommend that you reinstall it to increase the number of swap partitions. Therefore, it is best to plan related Partitions between installation and deployment of Linux servers. The main consideration is to store those directories on different paths, and set the swap partition space.
Generally, an experienced system administrator can reasonably plan the partition based on the application services to be deployed in the future. This is also a big difference between senior System Engineers and cainiao system administrators. Because the primary system administrator may only use the default configuration in the operating system. It is also feasible to directly use this default configuration, but the subsequent server performance will be affected. It is difficult to adjust the partition settings later. However, even if it is adjusted, its performance is not expected to be good. Therefore, it is necessary to plan partitions in advance.
Disable unnecessary services in Linux
Like Windows systems, many services are started after installation. Some of these services are required by the operating system or applications. However, some do not need to be started. If it is started, it will bring some security risks to the operating system. After deploying the Linux operating system, the system administrator needs to view the services it runs. Disable unnecessary services as needed. Therefore, the system administrator must be able to determine which services are necessary and which services can be turned off. At this time, the system administrator can refer to some application instructions and make judgments based on his work experience.
We have finished introducing the maintenance knowledge of Linux system security. I hope you have mastered it. Please also introduce the maintenance knowledge of Linux server security that we have previously introduced to you, to enhance the knowledge of Linux system security.