Linux partitioning scheme

Source: Internet
Author: User
Tags web hosting ide hard drive

Hard disk space for Linux systems: 500G.

Requires implementing the following Linux partitions:
The/var partition must be large (whether Postfix mail, lamp Web server, etc.).
Preferably above 400G. The specific/boot as long as 100M is enough.

Partitioning scheme:
HDD 500G Linux Learning, HTTP //linux.it.net.cn

Scenarios for 1,linux Server partitioning:

Actual size of partition type partition
/1g-2g (Minimum 150–250MB)
/boot 32m-100m (boot partition up to 100M or so)
/OPT 100m-1g (Additional application)
/tmp 40m-1000m (maximum can be set to about 1G, if the load ISO image file is set to about 4G bar
, usually not so much)
/Home 2g-10g (about 100M per user, specific custom. User directory. )
/usr 3g-10g (the most space-consuming part.) At least about 500M, generally loose server to
Points to 4-6g)
/usr/local 3g-15g (self-installed program installed here)
/var >2g– hdd remaining space (minimum 300m-500m, general 2-3g, server
Space is divided into it)

2,linux Desktop Partitioning scheme

/1G
/boot 32M
/opt 100M
/tmp 50M
/Home 1g-10g
/usr 3g-6g
/usr/local 3g-5g
/var 500M or more

The most economical partitioning scheme (server not recommended):
File directory min. General post-Installation size 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 it is a server, you will have to divide the rest of the space after the other partition to/var
is divided into the largest partition. HTTP Server directory/var/www,postfix server/var/mail.


It is usually in the/var directory.

Attached: A partial description of the Debian Official installation Guide.

Catalog 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 libraries and kernel modules
Media for moving media mount points
MNT is used to temporarily mount file systems
Proc Virtual directory for System Information (2.4 and 2.6 cores)
Root root User's directory
Sbin Basic System Command execution file
SYS System Information virtual directory (2.6 cores)
TMP temp File
usr Second level directory
var constantly 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. A typical root partition requires 150–250MB size space.
/usr: contains all user programs (/usr/bin), library files (/usr/lib), Documents (/usr/share/doc), and so on. This is the most space-consuming part of the file system. You need to provide at least 500MB of disk space. The total capacity will grow depending on the number and type of packages you want to install. A loose workstation or server installation should require 4–6GB.
/var: all mutable data, such as newsgroup articles, e-mails, websites, databases, cache of package systems, etc., will be put into this directory. The size of this directory depends on the purpose of your computer, but for most people, it will be used primarily as a management tool for package systems. If you are ready to do a full installation at once, including all Debian-provided programs, the 2 or 3GB space below/var should suffice. If you are ready to install (that is, install the service programs and tools, then the Text Processing tool, then X, ...), you are ready to 300–500 MB. If the hard disk space is tight and you are not ready for the master version of the system upgrade, you can prepare it for 30 or 40MB size.


/tmp: The temporary data created by the program is mostly stored in this directory. Usually 40–100 MB should be sufficient. Some applications-including archive handlers, CD/DVD authoring tools, and multimedia software-may temporarily save image files using/tmp. If you want to use these programs, you should adjust the size of the/tmp directory accordingly.
/home: Each user will place his private data in a subdirectory of this directory. The size depends on how many users will use the system, and what files are placed in their directory. Depending on the purpose of the plan, 100MB space should be prepared for each user, but should be adjusted to your needs. If you plan to save a lot of multimedia files (Pictures, MP3, movies) in your home directory, you should prepare more space.
My server's actual division and 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
The directory in which messages are stored for postfix mail is:/var/mail
IT network, http://www.it.net.cn#df-th
File system type capacity used% mount point available
/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 method or the method I mentioned above is better!

Linux Partitioning

What is a hard disk partition and what is partition used for?
The partition is the "paragraph" of the hard disk. The Windows partition has its own drive letter (c:,d: And so on), and these partitions look like a separate hard disk.

The simplest case is to use the entire hard disk as a unique partition. This is basically the case if you purchase a machine that already has Windows installed. IT network, http://www.it.net.cn

If you want to install more operating systems on your machine, you will need more partitions. You cannot install Linux in this separate partition. If you want to install both Windows Me and Windows2000, you will need two partitions. The reason is that the operating system is not used in principle with different file systems. If several operating systems support the same file system, it is often necessary to avoid having the same system directory under one partition and installing them on different disk partitions.

Under Linux it is different, and it has more partitions-for example, the root partition "/" and the Swap Partition "swap". Linux Learning, HTTP //linux.it.net.cn

Tip: Make it clearer: When you install Linux, you don't consider how much space is available under the Windows partition because space Linux under the Windows partition is not available. You need to create a new partition outside of the Windows partition.
Partition type
There are three types of hard disk partitions: Primary partition, extended partition, and logical partition. IT network, http://www.it.net.cn

There can be up to four primary partitions on a single drive. You can create an additional extension partition to replace one of the four primary partitions, and then you can create more logical partitions under the extended partition.

An extended partition is simply a "container" of logical partitions. Only primary and logical partitions are actually stored for data.
Tip: Windows9x/me with a partition program Fdisk can only define one primary partition. That is, under windows9x/me you can only define up to one primary partition, one extended partition and more logical partitions under the extended partition. If you want to use more primary partitions, you must partition them under Linux.
Partitioning and formatting
Each operating system has its own to change the hard disk partition under the windows9x/m is very famous fdisk, in Windows NT/2000/XP with a very convenient graphical interface tool, His location is slightly different under various versions of Windows (for example, under 2000 Control Panel-Administrative Tools-Computer Management-Disk Management). Partitioning under Linux can either use Fdisk or a graphical interface program with the same functionality.

Each primary and logical partition is stored back with an additional information that identifies the file system. The operating system (Windows or Linux, etc.) can be easily identified and confirmed by this information, which partition should be used. Unrecognized operating system partitions will be ignored.

By partitioning, of course, no file system can be generated. After partitioning, only the disk space on the hard disk is reserved and cannot be used directly. After this, the partition must be formatted. Under Windows, you can do this through the File menu or the Fomate program under Explorer, which is done by MKE2FS in most cases under Linux.

Tip: Linux supports different file systems. The most widely used is ext2. Ext2 is built with the MKE2FS program we mentioned above. Linux certainly also supports ReiserFS file system Linux learning, HTTP //linux.it.net.cn

Note: Any disk partitioning or resizing can be done without the previous data being lost. Be sure to back up the data once before partitioning.
Name of the partition under Dos/windows
Partitions that are used by the operating system under Windows are represented by a disk character. A: and B: reserved for the floppy drive, and the primary and logical partitions on the other disks will be sorted from C: start. (The extended partition does not have any drive characters and is not visible.) I also can't see the Linux partition under my indowsx)

If a machine has a lot of hard disks, optical drives, floppy drives, etc., the name of the disk partition will be confusing. In this case, the primary partition and logical partition on the first hard disk will get the name letter first, then the second block, the third block, and so on. For example, if you have three hard drives, each with a primary partition and two logical partitions, the first hard drive will be named C:,f:,g: the second block is d:,h:,i: and the third block is e:,j:,k:.

Under WINDOWSNT/2000/XP, you can change the names of these systems automatically named. For example, you can name an optical drive X, so that when you add a new partition, his or her title will not change.

The partition of the unfamiliar file system will not be named and is not visible in most programs (such as the Resource manager). , these partitions will only be displayed under the Disk partitioning tool (Computer Management-command interpreter under fdisk,win2000 under Windows9x/me).
The name of the partition under Linux
Partition naming under Linux will be clearer and more detailed than under Windows, but the resulting name is not easy to remember. Unlike the drive letter under Windows, Linux typically uses device-name (Device-name). A typical hard drive (such as an IDE hard disk) will be named with/DEV/HDXY. x indicates the hard disk (A is the first hard disk, B is the second hard disk, and so on), Y is the number of the partition (starting at 0, and so on). The SCSI drive will be named with/DEV/SDXY. The optical drive (either IDE type or SCSI) is named as the hard disk.

Tip: The IDE (Integrated circuit device) and SCSI (small computer system interface) are the two most popular systems currently connected to a computer's hard drive, optical drive, or floppy drive. SCSI is faster than IDE, but the same price is more expensive. SCSI can typically be used with file servers and database servers. Linux supports both systems (of course, you can have both IDE and SCSI devices on a single machine)

The IDE hard drive and the optical drive device will be internally connected to differentiate the zone. /dev/hda represents the first device (master) of the first IDE channel, and/DEV/HDB represents the second device (slave) of the first IDE channel. By this principle,/DEV/HDC and/DEV/HDD are the master and slave devices for the second IDE channel. The two devices, named/dev/had and/dev/hdc, are theoretically equally possible and do not use/dev/hdb here. (In this case, the device is connected as master on both the first and second IDE channels)

The SCSI hard drive or optical drive device relies on the ID number of the device, regardless of the missing ID number. For example, the ID number of three SCSI devices is 0,2,5, the device name is/DEV/SDA,/DEV/SDB,/DEV/SDC respectively. If you add a device with an ID number of 3 now, the device will be named/DEV/SDC and the device with ID number 5 will be called/DEV/SDD.

The partition's number does not depend on the name of the IDE or SCSI device, the number 1 to 4-bit primary partition, or the extended partition reservation, which is used to name the logical partition starting at 5. For this reason, there are often number bugs. (such as 1,2,5,6, where 3 and 4 are number holes) For example: the first hard disk's primary partition is HDA1, the extended partition is Hda2, and a logical partition under the extended partition is HDA5.

Here are some examples to help you understand.
Linux Learning, HTTP //linux.it.net.cn

Dev/hda represents the entire IDE hard drive
/DEV/HDA1 represents the first primary partition of the first IDE hard disk
/DEV/HDA2 represents the extended partition of the first IDE hard disk
/DEV/HDA5 represents the first logical partition of the first IDE hard disk
/DEV/HDA8 represents the fourth logical partition of the first IDE hard disk
/DEV/HDB represents a second IDE hard disk
/DEV/HDB1 represents the first primary partition of the second IDE hard disk
/DEV/SDA represents the first SCSI hard disk
/DEV/SDA1 represents the first primary partition of the first SCSI hard disk
/DEV/SDD3 represents the third primary partition of a fourth SCSI hard disk

Linux Web Server Partitioning scheme

The biggest application of Linux server in the Web server, many friends in the first installation of Linux server, the first thought is how to partition, a reasonable partition can save you a lot of trouble, especially in the case of personal server rarely add hardware, The initial partitioning scheme is reasonable and directly determines whether you will be able to maintain your server in the future, because depending on your hardware configuration is different, so the specific plan of the partition is different.

Different hardware configurations divide your own partitions proportionally according to the explanations explained.

Partition considerations In fact there are many, for example, your server has a few hard disks, need to install what software, mainly said that the Web server, swap partition, as a swap partition is recommended to use twice times the memory, but because the memory capacity is significantly large, so separate too much is not necessary, For example, my memory is 2G, that is enough to plan 2G swap partition, of course, 1G of memory I also like to use 1G swap, in addition to the Web server, several separate directories need to be partitioned:/var/tmp/usr/home, where the/var and/temb partitions are data changes frequently, The former has a lot of system logs, there are some versions of Linux put the web directory here, it is important to note that the latter for some major stations have a large number of temporary files and fragments, some large sites and multi-drive server to the two-bit with a separate hard drive is also possible./home Directory let alone Most of the distributions now require this as large as possible, others like to have/boot separate partition,/usr directory installed most of the software, so consider the size of the software installation to partition.

Here is my single-drive partitioning scheme, for reference only:
Linux Learning, HTTP //linux.it.net.cn

/(128MB)
/boot (100MB)
Swap 2G (2G RAM)
/tmp (2G)
/var (2G)
/usr (10G)
/home (all remaining space)

Above average scheme My station is basically able to meet the demand, according to your actual configuration note the above several partitions for reasonable adjustment on it, welcome to say a message about their own server partition scheme. IT network, http://www.it.net.cn

Linux Partitioning scheme:
Create three partitions
1,/boot partition storage kernel and boot program
Space allocation: 100M type: ext3

2./swap Swap partition virtual memory
Space allocation: Twice times of physical memory Linux Learning,/http/linux.it.net.cn

3./root partition to store all files
Space size: At least 3 G type: ext3
(/equivalent to c:\> in Windows) Linux Learning,/HTTP //linux.it.net.cn

(Editor: IT)

Linux partitioning scheme

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.