Some suggestions for partitioning the Linux operating system reasonably

Source: Internet
Author: User

For Linux users of different levels at different stages, a reasonable partitioning scheme is provided for your reference.

I. Linux cainiao

For such linux users, they are often curious about linux. I just heard that this system has no perceptual knowledge of this system. In this case, the purpose of installing linux is usually to satisfy curiosity or disagree (just like me ). What Can linux bring to them? What is its use? They have no clear goals. Maybe we just installed it today and tomorrow we will think that linux is a waste of hard-to-use, so they ran to their beloved Windows system.

They want to taste it and will not give up their favorite Windows immediately. Therefore, there is no need to spend a lot of time thinking about how to divide hard disk partitions into reasonable and efficient linux systems. For these users, you only need to meet the following two requirements:

1,Windows must be retained in any way, and the original system cannot be damaged during partitioning.

2,Ensure that linux can be installed and run.

Therefore, the original partition cannot be damaged to re-partition the entire hard disk. Therefore, the common solution is to use the existing Windows partition to install the linux system. Generally, the last disk in windows, that is, the last partition, is used to install the linux system.

Assume that there are six partitions in Windows: C, D, E, F, G, and H. We recommend that you use the last partition as the root partition for linux installation. Linux installation requires about 5 GB of Space (the popular Redhat8 Redhat9 ). Don't be surprised why linux consumes so much space. In fact, the linux system itself is not big and can be customized flexibly, as small as a few MB, linux systems with different purposes and performance can be installed in a space of several GB. The reason for the full installation of 5g space is that in addition to the basic system, the 5g also includes a variety of databases, OFFICE suites, various applications, and various server programs, various desktop managers, etc. If you spend tens of dollars to buy a linux system, you don't have to spend any more money on regular software. Is it necessary to install all these 5g items?

For beginners, if hard disk space is not tight, I suggest you install them all, in the future, we will not encounter various annoying dynamic library dependency problems when installing other software or the problem of not finding the commands we can see on the teaching material, beginners do not know how to install software that they did not install during system installation. This will waste a lot of time taking a lot of detours. For me, the first time I installed linux, I installed Redhat7. 1. Because there is not much space (not to mention Microsoft Windows), I only allocated 1 GB of space for linux. I don't understand the result, during installation, the system finds that the default installation space is insufficient, and the KDE and GNOME are removed without knowing what KDE is, what GNOME is, and what X is, only one X. When I input the startx command in a book, the screen only shows a black X with a gray background and an xterm with a pop-up prompt, I don't know how to do it. I randomly typed a DOS command dir in xterm, and I got a blind hat and ran into a dead mouse. I really output some information. Finally, we had to split a relatively large area and then install KDE and GNOME.

Therefore, it is recommended that beginners install everything when installing it for the first time to avoid various problems. linux is not like Windows. It is very flexible, but it is also very troublesome because of this, if you do not have a certain understanding of it, it is difficult to control it, so in order to avoid trouble, we recommend that you install all the things, choose all at the time of installation. If the hard disk space is relatively tight, at least install the default things of the installer, it is estimated that less than 2 GB of space will be consumed. You can also choose the workstation installation method directly without selecting "Custom. In the future, I will have a certain understanding of the system, understand my own needs, and understand what I want, when it is unnecessary for you, you can re-partition and select Software Installation based on your needs. The specific partitioning scheme is as follows:

In Windows, delete the last disk with a partition tool. If the last disk space is too small, delete the last two. After deletion, there will be more space on the hard disk, and you can start to install the system. Generally, two partitions are required for linux installation. One is to install the system file and partition (/), one is the swap partition (swap) of the virtual memory, which is different from that of Windows. Therefore, we can use the partition tool in Windows to create two partitions in the new space. One is the first root partition and the other is the exchange partition, swap partitions do not need to be large. According to the official statement, the virtual memory should be twice the actual memory size, or select a greater value between 32 m and actual memory, this is for old machines with very few memory. However, in actual applications, it is a waste to double the actual memory size. For example, if I have 160 MB of memory and MB of swap partitions, swap will only use 3 ~ 5 M. Even when using VMware and other software with paid memory, the consumption of swap is only 60 M, so it is 100 ~ The m swap is enough. If you have M memory, do you really want to split it into 1g swap partitions?

Note: If the swap partition size is less than twice the memory size, the installer will have a warning. You only need to ignore the warning and continue the installation, in some versions of linux, when the swap partition is twice the actual memory, the installer will not be able to pass, such as TURBO linux 6. 0 in this case, you can temporarily split a large partition. After the partition is installed, delete the partition and drag a small partition. If you find that the swap partition is not enough after installation, you can create a swap file manually. This will be explained later.

After differentiation, do not rush to format it. linux has its own file system. Most versions of linux cannot be installed on Windows FAT or NTFS partitions. So all you need to do is restart the system, start the computer, and put it into the installation disc. The installer will help you format the two partitions you split. The installation details are not covered in the scope of this article. It is clear to buy any introductory material.

Ii. Linux Users

For these linux users, they have learned basic linux operations, how to install software, and common linux commands, I also understand the basic structure of the linux System and the meaning of various directories in the linux and file systems, and know the things that I need on the CD, which are not used for the rest of your life. So I thought about how to customize the system to divide the partition size and number reasonably. Next I would like to list my current hard disk division and give these linux advanced users a partition solution that I think is more reasonable.

Below is my hard disk partition (I have two hard disks, but the system is mainly installed in the first one, the second is only used to copy data, and the experimental system is installed)

     
      

Disk /dev/hda: 255 heads, 63 sectors, 2491 cylinders

Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System

/dev/hda1 * 1 392 3148708+ 83 Linux

/dev/hda2 393 589 1582402+ 83 Linux

/dev/hda3 590 981 3148740 7 HPFS/NTFS

/dev/hda4 982 2491 12129075 f Win95 Ext''d (LBA)

/dev/hda5 982 1504 4200966 83 Linux

/dev/hda6 1505 2027 4200966 b Win95 FAT32

/dev/hda7 2028 2289 2104483+ 83 Linux

/dev/hda8 2290 2420 1052226 83 Linux

/dev/hda9 2421 2471 409626 83 Linux

/dev/hda10 2472 2491 160618+ 82 Linux swap

Disk /dev/hdb: 128 heads, 63 sectors, 1023 cylinders

Units = cylinders of 8064 * 512 bytes

Device Boot Start End Blocks Id System

/dev/hdb1 * 1 520 2096608+ b Win95 FAT32

/dev/hdb2 521 910 1572480 83 Linux

/dev/hdb3 911 986 306432 83 Linux

/dev/hdb4 987 1023 149184 83 Linux

[root@gucuiwen root]#

Mounting points and space usage:

     
      

[root@gucuiwen root]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/hda1 3.0G 2.0G 839M 71% /

/dev/hda2 1.5G 990M 531M 66% /mnt/hda2

/dev/hda5 3.9G 2.8G 986M 75% /mnt/hda5

/dev/hda6 4.0G 1.6G 2.4G 40% /mnt/hda6

/dev/hda7 2.0G 1.2G 745M 62% /home

/dev/hda8 1011M 176M 784M 19% /mnt/hda8

/dev/hdb1 2.0G 1.8G 207M 90% /mnt/hdb1

/dev/hdb2 1.5G 185M 1.1G 14% /mnt/hdb2

none 125M 0 124M 0% /dev/shm

/dev/hda9 387M 180M 188M 49% /var

I split the first hard disk into three primary partitions, so that multiple systems are not affected when they are installed. As to why we need to divide three primary partitions, I have already said in <fully Install multiple systems using multiple primary partitions>. There are many advantages. See: http://go.6to23.com/gucuiwen/linux

Although my hard disk only has 2OG, I divided it into nine partitions, which is also a choice for management convenience after multiple partitions. First, install linux's heel (/) in the first primary partition hda1. The partition size is 3 GB, which includes:

     
      /boot/bin/dev/etc/lib/sbin/usr
     

There are also empty directories and mount points:

     
      /opt/mnt/initrd/var/home/proc/misc
     

Because everything in/boot/bin/dev/etc/lib/sbin is relatively small, there is no need to separate partitions and mount them. In fact, it is not good to mount these directories separately, key information and files during system startup should be stored in these directories, but only mounted/partitioned at the beginning of the system startup. Therefore, if one of these directories fails to be mounted, the system will not start properly. For example, the/etc directory stores the hardware configuration information of the system software, including the configuration information of the mount point partition type of the partition, which needs to be read when the system starts, if/etc is placed on a small partition separately, where can I read the mounting point information of the partition when the system starts? Similar/sbin/dev must be placed on the Root partition.

Only the system kernel and boot tools are stored in/boot. In some cases, to solve the problem that some old motherboard does not support large hard disks, separate the content of/boot in a Small Partition within 1024 cylinder of the hard disk. However, most of the current motherboard does not have this problem. In addition, the content in/usr is generally not changed frequently. Therefore, I also put it in the/directory. It can be seen that the size of all files does not change frequently and will not cause the file system to break everything in/partition.

In addition, I have allocated 2 GB of space to Store Pictures, materials, and software I have downloaded at ordinary times. Mounted to the/home directory, the partition is not moved when the system is reinstalled. Even if the partition is formatted, only the/partition,/var and swap partitions can be retained, when installing the system, attach it to the system.

Related Articles]

  • General host partition and directory Configuration
  • Advanced Tutorial: Recommended hard disk partitioning for Linux
  • Hard Disk partitioning and Grub boot settings for multiple operating systems

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.