Partition Scheme of UbuntuLinux System

Source: Internet
Author: User
Article Title: UbuntuLinux system partitioning solution. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

  I. Linux partition Concept

First, I would like to introduce the partition concept in linux, but it hurts me from the beginning. In Linux, it is stipulated that each hard disk device can have a maximum of four primary partitions (including the extended partition). Any extended partition must occupy one primary Partition Number, that is, in a hard disk, there are a maximum of four primary and extended partitions. For earlier DOS and Windows (versions earlier than Windows 2000), the system recognizes only one primary partition. You can add a logical drive letter (logical partition) to the extended partition, further refine the partition.

A primary partition is used by a computer to start the operating system. Therefore, the boot of each operating system, or a boot program, should be stored in the primary partition. This is the biggest difference between primary and extended partitions and logical partitions. This is the best example when we specify the bootloader for Linux installation and boot on the primary partition.

Linux requires that the primary partition (or extended partition) occupies the first four numbers from 1 to 16. Taking the first IDE hard disk as an example, the primary partition (or extended partition) occupies hda1, hda2, hda3, and hda4, while the logical partition occupies 12 numbers from hda5 to hda16. Therefore, each Hard Disk in Linux has a total of 16 partitions.

For logical partitions, Linux requires that they must be built on extended partitions (also in DOS and Windows systems), rather than on the primary partition. Therefore, we can see that the extended partition provides a more flexible partition mode, but it cannot be used as a boot for the operating system.

I used to be unfamiliar with these concepts and made a lot of detours in partitioning. So what is a good partition solution? I think this is my opinion. In principle, it is best to mount two partitions/AND/home separately, because home can be regarded as my document in windows. If you have more personal data, home must be larger. /It doesn't matter if it is small. It is said that at least 2 GB, and I have never tried it. Others such as/tmp and/var because there are a lot of active files, to avoid the impact of their file fragments on other areas, it is best for them to mount a zone. Finally,/opt mainly installs large software. If there are extra partitions, you can mount one for it.

  Ii. Start partitioning

OK. In this case, we will first split it into a m primary partition and mount boot. All the files required for grub startup are in the/B o t directory. In this way, even if the working partition has a problem, as long as the partition is no problem, it can also be started. Therefore, the best way is to divide the root file into a single partition. Generally, the size is up to 64 MB, and I gave 100 MB for insurance.

All the subsequent partitions exist in the form of extended partitions, which have many logical partitions.

First, create an swap partition, which is twice or twice the memory size. If your memory is 1 GB like mine, it would be 1 GB. In fact, it is basically not that big. Change the partition format to linux-swap.

Create a partition as large as possible for/usr, because most of the system software is stored here, including graphic interface programs such as X Server. I divided 20 GB.

Next, create a mount partition for/home. Considering that I have many work documents and the source code and programs are often put here, I gave 10 Gb.

For other methods such as tmp and var, you do not need to consider a single user's work machine. Of course, I don't know if my machine will have server applications in the future. I still allocated 2 GB space to var.

All other spaces are mounted /. Although generally 2G is enough, it is more beneficial.

Note: many problems may occur if you use the built-in Installation Tool partition on the ubuntu CD. If you encounter any problems, we recommend two methods:

1. In the live CD environment, use sudo fdisk/dev/xxx directly on the terminal.

To partition, then w save and reboot, and then enter the Installation tool. When you manually edit the registry, it recognizes the partition table you edited. You do not need to modify it and go to the next step.

2. You can also use the fdisk of livecd to divide the zone and use the livecd on the disk.

Install the installer program in the command line. However, this installer only requires you to mount/and swap. What about other partitions? You can split the points first, or after installing the system. What if I mount other partitions to the desired directory? For example. If you want/

Mount home/user to the new sda8 partition. You can do this:

First, mount/dev/sda8 to/mnt/sda8. If you do not have this directory, mkdir is your own.

Then, cp-R/home/user/*/mnt/sda8/user, and cp-R/home/user/. */mnt/sda8/user

Finally, modify/etc/fstab and add a/dev/sda8/home ext3 defaults 0 2 (the parameter is determined by yourself.

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.