CentOS WEB Server partitioning solution, centosweb

Source: Internet
Author: User

CentOS WEB Server partitioning solution, centosweb

Parsing the actual size of a partition
SWAP partition 2 GB (memory is 1 GB, usually 2 times of memory)
/1G-2G (minimum 150-250 MB)
/Boot 32 M-100 M (boot partition, up to M)
/Opt 100 M-1G (Additional Application)
/Tmp 40 M-1000 M (the maximum value can be set to around 1 GB. If you load an ISO image file, set it to around 4 GB. Generally, this is not necessary)
/Home 2G-10G (about MB for each user. User directory .)
/Usr 3G-10G (space-consuming part. At least MB, usually 4-6 GB for loose servers)
/Usr/local 3G-15G (self-installation program installed here)
/Var> 2 GB -- the remaining disk space (at least 300 MB-500 mb, generally 2-3 GB. If the server is used, allocate the remaining space to it)

1) The following is the partition and mount point of the 80 GB hard disk as the server: (this example is the virtual 80 GB hard disk in VM6.0, And the partition and mount point settings are made when Red Hat Linux9.0 is installed)
1. Idle 80 gb scsi hard drive.

2. Divide the partition into 1 GB. The mount point is :/
3. Another swap partition is 1-2 times the memory.
4. Split a m partition with the mount point:/boot
5. Split the partition into 1024 M, and the mount point is:/opt
6. a m partition. The mount point is/tmp.
7. A 10 Gb partition with the mount point:/home
8. A 20 GB partition. The mount point is/usr/local.
9. "Use all available space" is divided into one zone. The mount point is/var.

2) The following partition and mount point with a GB hard disk as the server: (this example is the partition and mount point settings when centos is installed on the hard disk of the physical machine)
1. Two 1 GB swap partitions (2 GB memory)
2. Split a m partition with the mount point:/boot
3. A 40 Gb partition. The mount point is/usr.
4. A 20 GB partition with the mount point :/
5. A 40 Gb partition with the mount point of/tmp
6. A 10 Gb partition with the mount point:/home
7. Remaining partitions. mount point:/var
3) server partition percentage
1. Two 1 GB swap partitions (2 GB memory)
2. Divide the partition into around mb. The mount point is/boot.
3.25% mount point:/tmp
4.25%, mount point:/usr
5.12.5%, mount point :/
6.6.25%, mount point:/home
7. remaining space. mount point:/var

Knowledge Point Analysis: Linux partitions are different from other operating system partitions. The partition formats are Ext4 and Swap. Ext4 is used to store system files, swap serves as the Swap partition for Linux (equivalent to a virtual memory file in windows ). Now we can know that Linux requires at least two dedicated partitions (Linux Native (local) and Linux Swap (switch )). Linux cannot be installed in the Dos/Windows partition. In general, one or more hard disk partitions of the "Linux Native" type are installed in Linux. However, a "Mount Point" must be specified for each partition in Linux ), tell Linux which directory to use when it is started. A "Swap" partition is generally defined and does not need to define a load point.
Next we will first have a preliminary understanding of "Linux Native" and "Linux Swap.
* The SWAP partition is the SWAP partition for LINUX to temporarily store data, which is mainly used to store the data temporarily not used in the primary memory and re-transfer it into the memory as needed, you do not need to specify the "Mout Point" (loading Point) for the partition used as the SWAP. Since it is used as the SWAP partition, we should specify the size for it, it must at least be equal to the actual amount of memory on the system. Generally, it is one to two times the size of memory. In addition, you can create and use more than 16 swap partitions.
* Linux Native stores system files. It generally uses the EXT4 partition type. For Linux, there is a lot of room for choice, system files can be installed in several zones (the mount point must be described), or in the same partition (the mount point is "/").


Centos6 implements the web Server partitioning solution, with 2 1 TB hard disks (2 TB in total) and 4 GB memory.

First Hard Disk: 1 TB: 8 GB swap,/boot 200 MB/root available space
Second Hard Disk: 1 TB:/all space

Create an FTP server on the first hard disk/root, and transfer files at will using VSFTP;
Apache + PHP + Mysql should be on the second hard disk by default, without fear of affecting the speed. All web data is stored on 2nd hard disks, and the system and data are separated.
For reference.

How to partition CentOS in CentOS

When using CentOS, we need to consider the system mount partition. For the systems we usually use, we do not have to consider the partition situation, you can use the default; however, if we want to install an ECS instance or create a server, we must carefully consider partitioning.
Here we have three solutions to introduce CentOS partitions: 1. The first type/: ensure that more than 5 GB.
Swap: This is generally the physical memory of 1 ~ 2 times.
2. Type 2/boot: store the programs related to CentOS startup, about MB.
/: Root directory of the CentOS system. All directories are mounted under this Directory, which must be 5 Gb or more.
/Home: stores the data of common users, which is the home directory of common users. The recommended size is the remaining space.
Swap: 1 ~ of the physical memory ~ 2 times.
3. Type 3/boot: store the programs related to CentOS startup, about MB.
/Usr: used to store applications in the CentOS system. There is a large amount of related data. We recommend that you store more than 3 GB of data.
/Var: used to store frequently-changing data and log files in Linux. It is recommended that the value be larger than 1 GB.
/Home: stores the data of common users, which is the home directory of common users. The recommended size is the remaining space.
/: Root directory of the CentOS system. All directories are mounted under this Directory, which must be 5 Gb or more.
/Tmp: place the temporary disk in an independent partition to avoid affecting the system stability when the file system is full. The recommended size is more than MB.
Swap: 1 ~ of the physical memory ~ 2 times.

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.