The method of CentOS system hard disk to establish partition

Source: Internet
Author: User
Tags centos web hosting

(1)/boot partition (not required): The/boot partition is used to boot the system, which contains the kernel of the operating system and the files to be used during the startup of the system.
The size of the partition is typically 100MB.

(2) Swap partition: The function of swap is to act as virtual memory, which is usually about twice times the size of physical memory (when the physical memory is greater than 512MB, the swap partition is 512MB).
For example, the physical memory is 128MB, then the size of the swap partition should be 256MB.

(3)/(root) partition: The remaining space CentOS most of the system files and user files are stored on the/(root) partition, so the partition must be large enough, general requirements greater than 5GB.

If the hard disk space more than twice times memory to swap,
Depending on the function, the system partition is not the same.
For example: If the mail server, then/var will be more points of capacity;
If it is a file server, then/home will be more points;
If you play the desktop, then the/swap+/is good.

Example:

The hard drive is 160G and the memory is 1G.

Zoning principles are:

Swap 2G: Generally this format is one-fold larger than memory.
/5G ext3 format.
/boot give 100M this is the usual practice and I don't usually do that

/home 20G ext3

Format

/var 20G:EXT3
/usr 20g:ext3
/ftp the rest: ext3

Formatting

To use these partitions, you first need to format the newly created partitions to be used to create the file system

Use command mkfs-t Ext3/dev/sda3
Mkfs-t EXT3/DEV/SDA4
Mkfs-t Ext3/dev/sda5
Mkfs-t Ext3/dev/sda6

CentOS Zoning Scheme


1 The most basic zoning scheme:

/: The recommended size is above 5GB.
Swap: Swap partition, recommended size is 1~2 times of physical memory.

(2) Advanced partitioning scheme:
/boot: Used to store programs related to Linux system startup, such as boot loader, and so on, the recommended size is 100MB.
/: The Linux system root directory, all the directories are hanging under this directory, the recommended size of more than 5GB.
/home: For ordinary users of the data, is the normal user's host directory, the recommended size for the remaining space.
Swap: Implements virtual memory, the recommended size is 1~2 times of physical memory.

(3) Advanced Partitioning programme:
/boot: Used to store programs related to Linux system startup, such as boot loader, and so on, the recommended size is 100MB.
/usr: used to store applications in the Linux system, with more data and recommendations than 3GB.
/var: Used to store frequently changing data and log files in Linux systems, more than 1GB is recommended.
/home: For ordinary users of the data, is the normal user's host directory, the recommended size for the remaining space.
/: The Linux system root directory, all the directories are hanging under this directory, the recommended size of more than 5GB.
/tmp: The temporary disk is in a separate partition to avoid the system's stability when the file system is stuffed. The recommended size is above 500MB.
Swap: Implements virtual memory, the recommended size is 1~2 times of physical memory.


here is my partitioning scheme:

Hard Drive 500G

Scenarios for server partitions:

Actual size of partition type partition

/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 ISO mirrored file is set to 4G or so)
, generally not so much)
/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
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, General 2-3g, do the rest of the server
The space is divided to it)
Desktop Partition Scheme
/1G
/boot 32M
/opt 100M
/tmp 50M
/home 1g-10g
/usr 3g-6g
/usr/local 3g-5g
/var more than 500M
The most economical partitioning scheme (not recommended by the server):
Minimum file directory size after installation CentOS5.2
/150m-250m 500m-2g (378M)
/boot 32m-100m 64M (13M)
/opt 30m-100m 50M (19M)
/tmp 40-100m 50M (37M)
/home 100m-5g 1G (483M)
/usr >500m 4-6g 2.5G (2.0G)
/usr/local 500M 2-5g 2G (1.2G)
/var 300-500m 2-3G 500M (296M)
/var directory, if the server, according to the above the rest of the partition after the space is all to/var
is divided into the largest partition. HTTP Server directory/var/www,postfix server/var/mail.
are generally in the/var directory.

Attached: Part of the official Debian Installation Guide.

Directory content
Bin Basic Command Execution file
Static link file for boot boot loader
Dev device files
ETC host-specific system configuration
Home User Directory
LIB Basic shared library and kernel modules
Media for mounting points for mobile media
MNT is used to temporarily mount the file system
Virtual directories for proc System Information (2.4 and 2.6 cores)
Directory of root root user
Sbin Basic System Command execution file
SYS System Information virtual directory (2.6 kernel)
TMP temp File
usr Second level directory
var's ever-changing data
Data provided by the SRV system for service
Opt-Attached application packages
The root partition/must always physically contain/etc,/bin,/sbin,/lib, and/dev, otherwise you will not be able to start the system. Typical of
The root partition requires 150–250MB size space.
/usr: Contains all the user programs (/usr/bin), library files (/usr/lib), Documents (/usr/share/doc), and so on. This is a file.
The most space-consuming part of the system. You need to provide at least 500MB of disk space. Total capacity will be based on the number of packages you want to install
and type of growth. A loose workstation or server installation should require 4–6GB.
/var: All variable data, such as newsgroup articles, emails, web sites, databases, caching of package systems, and so on, will be placed
This directory. The size of this directory depends on the purpose of your computer, but for most people it will be used primarily for package system
Tools. If you are ready to do a full installation at once, including all Debian-provided programs,/var 2 or 3GB below
The space should be sufficient. If you are ready to install one at a (that is, install the service programs and tools, then the Text Processing tool, and then
Is X, ...), you are ready to 300–500 MB on the line. If the hard disk space is very tight and not ready for the master version of the system upgrade, you can
Think it's ready for 30 or 40MB sizes.
/tmp: Most of the temporary data created by the program is stored in this directory. Usually 40–100 MB should be sufficient. Some applications-including attribution
File handlers, CD/DVD making tools, and multimedia software-you may use/TMP to temporarily save image files. If you want to use this
Programs, you should adjust the size of the/tmp directory accordingly.
/home: Each user will place his private data in the subdirectory of this directory. The size depends on how many users will be using the system,
And what files are placed in their directories. Depending on the purpose of the plan, 100MB space should be prepared for each user, but
Adjust according to your requirements. If you plan to save a large number of multimedia files (Pictures, MP3, movies) in the home directory, prepare for more
of space.
The actual division of my server and the actual use of the size, has not actually put into use. So the/var directory doesn't use that much.
The directory of general web hosting pages is/var/www
Postfix messages are stored in the directory:/var/mail

The code is as follows Copy Code
#df-th
File system type capacity used available% mount point
/DEV/HDB2 ext3 11G 315M 9.4G 4%/
/DEV/HDB10 ext3 10G 157M 9.3G 2%/opt
/DEV/HDB9 ext3 11G 158M 9.5G 2%/home
/DEV/HDB8 ext3 11G 158M 9.5G 2%/tmp
/DEV/HDB7 ext3 11G 2.5G 7.3G 26%/usr
/DEV/HDB6 ext3 16G 3.2G 12G 22%/usr/local
/DEV/HDB5 ext3 417G 340M 395G 1%/var
/DEV/HDB1 ext2 104M 7.3M 91M 8%/boot
Tmpfs tmpfs 1.1G 0 1.1G 0%/dev/shm

So the actual division or the method I mentioned above is better!

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.