Linux CentOS WEB server partitioning solution

Source: Internet
Author: User
Tags centos

Actual size resolution of partition type partition

Swap partition 2G (memory is 1G, generally twice times the memory)

/1g-2g (Minimum 150–250MB)

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

/OPT 100m-1g (Additional application)

/tmp 40m-1000m (maximum can be set to 1G or so, if the load ISO image file is set to 4G or so, generally not so many)

/home 2g-10g (100M per user, specific custom. User directory. )

/usr 3g-10g (the most space-consuming part.) At least 500M or so, the general loose server to be divided into 4-6g)

/usr/local 3g-15g (installed from the installer)

/var >2g--Hard Drive the rest of the space (at least 300m-500m, the general 2-3g, do the server to the rest of the space is divided to it)

1 The following partitions and mount points for the server with a 80G hard disk: (This example is the virtual 80G hard drive in VM6.0, the partition and mount point settings when Red Hat Linux9.0 is installed)

1, free 80G SCSI hard drive.

2, first divided into a 1G partition, mount point for:/

3, another swap partition, is 1-2 times the memory

4, divided into a 100M partition, mount point for:/boot

5, divided into one partition for 1024M, Mount point for:/opt

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

7, divided into a 10G partition, mount point for:/home

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

9, "Use all available space" divided into one area, the mount point is:/var

2 below the 160G hard disk for the server to do the partition and mount point: (This example is the physical machine hard disk, the installation of centos6.2 when the partition and mount point settings)

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

2. Divided into one 100M partition, mount point is:/boot

3. Divided into one 40G partition, mount point is:/usr

4. Divided into 20G partitions, mount point is:/

5. Divided into one 40G partition, mount point is:/tmp

6. Divided into one 10G partition, mount point is:/home

7. Remaining partitions, mount points are:/var

3% of server partitions

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

2. Divided into a 100M or so partition, mount point is:/boot

3.25% mount point is:/tmp

4.25%, Mount point is:/usr

5.12.5%, Mount point is:/

6.6.25%, Mount point is:/home

7. Remaining space, Mount point is:/var

Knowledge Point parsing: Linux partitions are different from other operating system partitions, and its partition format commonly has EXT4 and swap two kinds, EXT4 is used to store system files, swap is a Linux swap partition (equivalent to the virtual memory file in Windows). Now we can know that Linux requires at least two dedicated partitions (Linux Native (local) and Linux swap). Because Linux cannot be installed on the dos/windows partition. In general, we install one or more hard disk partitions of Linux Native on Linux, but each partition in Linux has to specify a mount point to tell Linux which directory to use when starting up. For a "Swap" partition, the general definition is one and it is not necessary to define the mount point.

Let's start with a preliminary understanding of "Linux Native" and "Linux Swap".

The *swap partition is the switched partition of the Linux temporary storage data, which mainly saves the data temporarily from the main memory, and then redeployment the memory when needed, and the partition used as swap does not need to specify "Mout point" (Mount), since it is used as a swap partition, We should certainly give it a size that is at least equal to the amount of actual memory on the system, which, in general, is one to twice times the size of memory. Alternatively, you can create and use more than one swap partition, up to 16.

*linux native is where the system files are stored, generally used EXT4 partition type, for Linux, there is a larger choice, you can put the system file in several areas to install (must be described mount point), can also be installed in the same partition (mount point is "/").

Q: Server to do Web server, hard disk is 2 500G, operating system with Linux,web server with Apache+mysql, how to partition

A: For data security considerations, it is recommended that you make two disks into RAID1. Then partition on the RAID1:

According to your disk capacity suggest partitioning:

/boot 100M

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

/home is the user's home directory, see how many users you have and how much the user program decides. Give it to a 10GB-20GB.

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

Some people are 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 the directory is created above.

However, it is recommended that you look at the LVM aspect, make LVM can be for the dynamic adjustment of disk space to leave room.

Q: CENTOS6 do Web server partitioning scheme, 2 1T hard drive (total 2T), 4G memory. Do not have to do raid, there are more users upload files, larger.

A: The first hard disk: 1tb:8g swap,/boot 200mb/root remaining space

Second hard drive: 1TB:/All Space

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

Apache+php+mysql default should be on the second hard drive, not afraid of impact speed. All web data is on the 2nd hard drive, and the system is separated from the data.

For reference.

CentOS Zoning tool is Fdisk, does not support such a large partition, so the row 300G to come out to install the system, other systems installed and then hang themselves.

First disk: Swap---8G

/boot---100M

/----200G here to see personal needs, I used to hang the root directory, do not worry about a directory is not enough to use the situation

The rest of the first set and the second disk are divided into 2 districts, each with a directory, when the data directory used.

Related Article

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.