Linux CentOS WEB server partitioning scheme

  

Actual size resolution of partition type partitions

SWAP partition 2G (memory is 1G, generally 2 times of memory)

/1G-2G (minimum To 150–250MB)

/boot 32M-100M (boot partition, up to about 100M)

/opt 100M-1G (additional application)

/tmp 40M -1000M (Maximum can be set to about 1G, if you load ISO image file, it is set to 4G or so, generally not so much)

/home 2G-10G (about 100M per user, specific customization. User Directory.)

/usr 3G-10G (The most space-consuming part. At least 500M, the average loose server should be divided into 4-6G)

/usr/local 3G -15G (self installed program installed here)

/var >2G--All the remaining space of the hard disk (minimum 300M-500M, generally 2-3G, if you do the server, then give the rest of the space above it) )

1) The following partition and mount point for the 80G hard disk server: (This example is virtual in VM6.0 The proposed 80G hard disk, partition and mount point settings when installing Red Hat Linux9.0)

1, idle 80G SCSI hard disk.

2, first divide a 1G partition, hang The load point is: /

3, then divide a swap partition, which is 1-2 times the memory

4, divide a 100M partition, the mount point is: /boot

5, a partition is 1024M, the mount point is: /opt

6, a 4000M partition, the mount point is: /tmp

7, a 10G partition, The mount point is: /home

8, divided into a 20G partition, the mount point is: /usr/local

9, "Use all available space", divide one area, hang The load point is: /var

2) The partition and mount point made by the 160G hard disk as the server: (This example is the partition and mount point settings when the centos6.2 is installed on the physical hard disk. )

1. Two 1G swap partitions (memory is 2G)

2. Divide a 100M partition, mount point: /boot

3. A 40G partition, the mount point is: /usr

4. A 20G score The mount point is: /

5. Divide a 40G partition, the mount point is: /tmp

6. Divide a 10G partition, the mount point is: /home< Br>

7. The remaining partitions, the mount point is: /var

3) The percentage of server partitions

1. Two 1G swap partitions (2G in memory)

2. Divide a partition of about 100M, the mount point is: /boot

3.25% mount point is: /tmp

4.25%, mount point is: /Usr

5.12.5%, the mount point is: /

6.6.25%, the mount point is: /home

7. Remaining space, mount point For: /var

Knowledge point resolution: Linux partition is different from other operating system partitions. Its partition format is commonly used by Ext4 and Swap. Ext4 is used to store system files, and Swap is used as Linux. Swap partition (equivalent to virtual memory files in windows). So now we know that Linux requires at least two specialized partitions (Linux Native and Linux Swap). Because Linux cannot be installed on the Dos/Windows partition. Generally speaking, we will install one or more hard disk partitions of type "Linux Native", but each partition of Linux must specify a "mount point" to tell Linux at startup. Which directory to use for this directory. For a "Swap" partition, one is generally defined and it is not necessary to define a load point.

Below we have a preliminary understanding of <;Linux Native" and “Linux Swap”

*SWAP partition is a swap partition for temporarily storing data in LINUX. It mainly saves the unused data on the main memory, and then transfers it into the memory when needed, and the partition used as SWAP does not need to be specified. "Mout Point" (starting point), since it is a swap partition, we should of course give it a size, which is at least equal to the actual amount of memory on the system, in general it is one to two times the size of memory. In addition, you can create and use more than one swap partition, up to 16.

*Linux Native is the place to store system files, generally with EXT4 partition type, for Linux, there is a large choice, you can divide the system file into several areas (must explain The mount point) can also be mounted in the same partition (the mount point is “/”).

Q: The server is used as a web server, the hard disk is 2 500G, the operating system uses Linux, the web server uses Apache+mysql, how to partition

A: For data security reasons, it is recommended Make two disks into RAID1. Then partition on RAID1:

Suggest partition according to your disk capacity:

/boot 100M

/var is the dynamic storage of the system Directory, at least 20GB.

/home is the user's home directory, depending on how many users you have and how many user programs you decide. Give a 10GB-20GB.

/usr is used to install user applications, 20GB.

Someone is accustomed to using /opt to install the software, if you also want to install Apache, mysql here, give 30GB.

The rest are given /, and then create a directory on it.

However, it is recommended that you look at the LVM aspect of the stuff, making lvm can leave room for dynamic disk space adjustment in the future.

Q: Centos6 is a web server partitioning scheme, 2 1T hard drives (2T total), 4G memory. There is no need to do RAID, and there are more users uploading files, which is larger.

A: The first hard disk: 1TB: 8G swap, /boot 200MB /root free space

Second hard disk: 1TB: /all space

first Hard disk /root built FTP server, VSFTP can transfer files at will;

Apache+PHP+Mysql default should be on the second hard disk, not afraid of speed. All web data is on the second hard drive, and the system is separated from the data.

For reference.

The centos partitioning tool is fdisk, which does not support such a large partition. Therefore, the system is installed around 300G, and other systems are installed and then hanged.

The first set: swap ---8G

/boot ---100M

/---- 200G Here I look at the personal needs, I am used to hanging the root directory, Don't worry about the situation where a certain directory is not enough

The remaining part of the first disk and the second disk are divided into two areas, each of which is linked to a directory, when the data directory is used.

Copyright © Windows knowledge All Rights Reserved