Answer three questions before deploying a Linux System

Source: Internet
Author: User
Before deploying a Linux system, answer three questions: general Linux technology-Linux technology and application information. For more information, see the following. From: IT expert network spike_zheng

Linux is more and more popular with enterprises because of its free and stable system. With the strengthening of Microsoft's operating system piracy, Linux has been gradually popularized in enterprises. However, it is not easy to make good use of the Linux system. In terms of system security, it is a test for many system administrators. The author personally believes that the system administrator must answer three questions before deploying the Linux system. Then start to deploy the Linux system, which may achieve better results. After all, if the base is not ready, it will cause great trouble in subsequent management.

The first question: what is the disk quota for each user?

Linux is a typical multi-user operating system. Therefore, in some cases, you need to set a disk quota for each user to prevent a user from storing too many files, consuming most of the hard disk space, and thus adversely affecting other users. For example, I have previously deployed a file server on Linux. At that time, the company had eight departments. For the sake of security, the author sets a user for each department. Department employees log on to the file server using their own user accounts and passwords to read and store files. In this case, the author sets a disk quota for each account. In this case, employees in other departments cannot save files because a user consumes most of the hard disk space.

In Linux, the disk quota is a technology that limits the disk space or the number of files that can be created by users or groups. However, in actual work, we usually only limit the user's capacity, but not the number of files that can be created. In Linux, the quota is set for partitions. Therefore, the administrator needs to add different partitions to the directories that require the quota. For example, if the system administrator assumes a file server, each user's file is stored in the share directory. If the Administrator maps the directory to an independent partition, the administrator can separately limit the disk space that each user can occupy. I will elaborate on how to configure the disk quota in future articles. If you are interested in this, please follow my subsequent articles.

When there are a large number of users, it is a good way to limit the disk. For example, if the mailbox server system is deployed on Linux, the disk quota can be used to limit the space occupied by each user's email. This can effectively avoid the failure to reject emails because the mailbox server is full due to too many users. Therefore, the first question to be answered before the system administrator deploys a Linux system is whether the disk quota is required. If necessary, set the disk quota for each user or group.

The second question: How should I arrange primary partitions, extended partitions, and logical partitions?

In Linux (other operating systems have similar rules), disk partitions can be roughly divided into three categories: primary partitions, extended partitions, and logical partitions. When deploying the system, the Linux system administrator must make a reasonable plan for the three partitions. Otherwise, valuable hard disk space will be wasted.

Generally, a hard disk can be divided into up to four primary partitions. Because the partition table size on the hard disk is only 64 Bytes, you need to use 16 Bytes to store the partition information when splitting a partition. Due to the size limit of the partition table, the hard disk can be allocated to four primary partitions. If a hard disk has 120 GB, and the Administrator divides four primary partitions, the space of each primary partition is 20 GB. In total, 80 GB space is used. The remaining 40 Gb space on this hard disk will be unusable. This obviously wastes hard disk space.

To break through the limit of up to four primary partitions, Linux introduces the concept of extended partitions. That is, the administrator can set a primary partition as an extended partition (note that only one extended partition can be used) for expansion. Multiple logical partitions can be created under extended partitions. That is to say, extended partitions cannot be directly used. They must be subdivided into logical partitions to store data. Generally, the start position and end position of a logical partition are recorded in the first sector of each logical partition. This is also called an extended partition table. In an extended partition, the system administrator can create multiple logical partitions based on the actual situation and cut an extended partition into multiple regions for use.

Therefore, with the help of extended partitions and logical partitions, a hard disk can be divided into six, seven, or more partitions. As mentioned in the first question, sometimes the disk quota needs to correspond to different partitions for different users or applications. In addition, I also want to talk about the planning of a user's main directory, which also requires an independent partition. Therefore, before deploying the system, the system administrator needs to consider whether the system can be divided into several zones. Therefore, how to plan the hard disk partition space is the second question that the system administrator needs to answer before deploying the Linux system.

Third question: How do I plan the user's home directory?

In Linux, the/home directory is a special directory. The system user files are stored in this directory. Note: Linux systems are generally divided into two types of users. First, the root user is the default Administrator of the system. Due to its special identity, the system usually arranges a/root directory to store its data. Second, a common user, that is, the user created by the root user. Sometimes out of security needs, the system administrator often does not need a root account to maintain applications on the system. If you need to install the mailbox server or database server. We recommend that you create two users, one for the mailbox server and the other for the database server. Even though the two servers are managed by the same administrator, it is necessary to create different users in Linux to manage different services. In this case, the files created by these two different users are stored in the home directory. The system will create different paths for the two users in this directory respectively.

What Should System Administrators consider when considering this directory planning?

If you need to consider the needs of user data backup and restoration. In Linux, administrators can back up important data based on partitions. At this point, if the home directory is mapped to an additional independent partition, if the user's data is important, you can back up the independent partition. In this case, you can avoid backing up the data of the entire operating system. You only need to back up an independent partition, And the backup efficiency will be much higher.

Consider the directory size if necessary. Because this directory is used to store user data, its size changes dynamically. Therefore, when you start partitioning, you need to consider providing a large space for this directory. Otherwise, it will be troublesome to increase the space in the future if the space is insufficient. Sometimes you need to back up the files in this directory before formatting the partition to adjust the size. This work is time-consuming. Therefore, when deploying a Linux system, the system administrator needs to set a proper size for the directory to avoid storing User Files in other directories due to insufficient space.

In addition, you also need to consider whether to save the user-generated data in this directory. Sometimes, due to special needs, you may reset the directory for storing user data. For example, you need to deploy a database system in the operating system. In this case, it is not recommended to store the data in the database in the home directory. In my opinion, you can set another directory, such as the/dba directory. Then, grant the user the permission to manage the directory (such as write and program execution permissions ). It is a good idea to manage data generated by applications such as databases through an independent level-1 directory. Therefore, not all user data is stored in the Home directory. For this reason, the system administrator also needs to consider which data should be stored in the Home directory and which should be stored independently. The author's opinion is that the files manually created by the user are placed in the home Directory, which is more appropriate. For some server-level data, it is best to create an independent directory for storage, including application software and related data files.

Therefore, I believe that the third question that the system administrator must ask before deploying a Linux system is how to plan the home directory. This issue should be considered from the perspective of user file backup and space capacity.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.