Ubuntu Server hard disk partition installation Solution

Source: Internet
Author: User

Core tips:

If you want to install only one Ubuntu operating system on your hard disk, we recommend that you use a "/", "swap", and "/home" three-zone solution:

/: 10 GB-15 GB.
Swap: the physical memory is less than or equal to 512 MB. We recommend that you allocate a swap with two times the actual physical memory capacity. The physical memory is greater than 512 MB. We recommend that you allocate swap with physical memory and other capacity.
/Home: // all remaining space except swap.
You need to manually partition, rather than manually arrange it by the system. Before installation, you need to learn some basic knowledge:

Basic Linux partition knowledge

The development of Linux is changing with each passing day. The old Linux documents may mislead readers about Linux.

Ubuntu has removed the mechanism for distinguishing hard disks of different types with hd and sd. Instead, it uses sda to represent the first hard disk in the computer.
In Linux, the number X in/dev/sdaX is limited, and the maximum Partition Number is 16. Therefore, the primary and extended partition numbers occupy 1 ~ 4. logical partitions occupy 5 ~ 16. Even if your hard disk only has one primary partition (for example,/dev/sda1) and one extended partition (/dev/sda2), the remaining two primary partition numbers are:/dev/sda3, dev/sda4 is not allocated to the logical partition either. The first logical partition must start with/dev/sda5.

File System

Linux supports many different types of file systems. Linux can read and write FAT16/32 and NTFS partitions.
Common Linux file systems include ext3, ReiserFS, XFS, and JFS.
We usually use ext3 as the default file system.
We use Ubuntu as a desktop system. In most cases, the performance of the file system is not a major concern. Maybe you will see a lot of negative comments on ext3, but ext3 is the oldest and the most tested Linux file system, so it is correct to choose it.
Ubuntu uses the ext3 File System by default.

Maximum partition size: ext3 is 4 TB, and ReiseFS is 16 TB. In Windows, the maximum partition of FAT32 is 32 GB, while in Linux, FAT32 supports up to 2 TB.
Maximum file size: ext3 is 2 GB-4 GB, ReiseFS is 8 TB, and FAT32 is 4 GB.

Partition type

1./partition. Used to store system files.
2. swap, that is, swap partition, is also a file system. It serves as the virtual memory of Linux.
In Windows, the virtual memory is a file: pagefile. sys; in Linux, the virtual memory needs to use independent partitions. This is said to improve the performance of the virtual memory.
3./boot: contains the kernel of the operating system and the files needed to start the system.
In many old tutorials, users will mount an independent partition of about mb in the/boot directory, we recommend that you put the/boot file in front of the hard disk, that is, before the 1024 cylinder. As a matter of fact, this is what Lilo cannot guide the operating system kernel after 1024 cylinders. Of course, it is also said that the benefit of independent mounting/boot is that multiple Linux instances can share one/boot.
In fact, no matter which of the above reasons, there is no need to separate the/boot partition. First, Grub can boot the Linux kernel after the 1024 cylinder. Second, even if multiple Linux systems are installed, the/boot is completely available. Because the size of the/boot directory is usually very small, about 20 MB, a MB partition is undoubtedly a waste, and the hard disk is also fragmented, not convenient to manage. In addition, if two Linux systems share one/boot, every time the kernel is upgraded, Grub configuration files may conflict with each other, causing unnecessary trouble. In addition, the non-independent/boot partition only occupies about 20 mb of space in the root directory, and does not affect the use of the root directory.
But it is worth noting that as the hard disk capacity increases, the Linux kernel cannot be guided to appear again, which is also known as the 137GB limitation. Unfortunately, Grub cannot boot the Linux kernel in the shard after GB. If you do not encounter such a situation, you should consider attaching/boot to an independent partition located in front of 137GB, or simply moving the Linux partition forward, place the partition where the root directory is located before GB.
4./usr/local: the place where the software is stored in Linux.
We recommend that you use the/opt,/usr or/usr/local independent tutorial, which is basically very old. When we use Ubuntu, we usually use the software package manager of the system to install the software, and seldom compile and install the software by ourselves. However, we recommend that you use an earlier version for independent/usr,/opt,/usr/local, instead of re-compiling the software when reinstalling the system. However, for most common users, this suggestion is usually meaningless.
5./var: System Log Record Partition.
6./tmp partition, used to store temporary files.
We recommend that you set/var and/tmp independent tutorials to be server-oriented. Because high-load servers usually generate many log files and temporary files, these files are often changed. Therefore, separating/var and/tmp is conducive to improving server performance. However, we use Ubuntu as a desktop, and even some users never care about system logs, so there is no need to independently Mount partitions for/var and/tmp.
7./home: the location of the user's home directory.
This may be the only directory worthy of independent partitioning. /Home is the place where the user folder is located. A user may store a large amount of File Information in/home/user. If the user mounts/home independently, the system can be reinstalled immediately even if Ubuntu is killed for no reason, obtain your own documents. Therefore,/home is the only directory that can consider independent Mount partitions.
In some old tutorials, we recommend that you install Linux in the primary partition or mount a primary partition under/boot. In fact, this is not required. All Linux partitions can be in logical partitions. Therefore, do not mislead these old tutorials. Do not waste limited primary partitions. install Linux in logical partitions with peace of mind.

1. Select "free space ).
2. Click "New partition" to create a partition ).
3. Type for the newpartition (select the Type of the new partition): Primary (Primary partition) (separately install Ubuntu to the new disk,/select Primary for the partition, select the Logical partition for other partitions. If the dual-system is installed and Windows is installed, select Primary or Logical for the/partition type, and select Logical partition for other partitions .)
4. input the size of the New partition (in MB) after the New partition size in megabytes ).
5. Location for the new partition: select the Location of the new partition (if you want the new partition to be created at the beginning or end of the available space, you can select "start" by default ).
6. Select the file system to Use after "Use. Ubuntu uses the ext3 File System by default.
7. Select a Mount point after the Mount point.
8. Click "OK" to confirm.
PS:
We recommend that you first split/and swap, and then allocate all the remaining space to/home.

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.