Illustration of the Ubuntu manual Partitioning Method

Source: Internet
Author: User

Illustration of the Ubuntu manual Partitioning Method

Recently, an ORACLE Server was installed with a Ubuntu server version Linux. Here I have reproduced a well-written Ubuntu manual partitioning process, hoping to help more friends.
If you just want to use Ubuntu, you can do this:
1) if you directly use the entire hard disk to install Ubuntu, there is no data to be saved on the machine, or you have backed up the data, you can select "Wizard-entire hard disk" When partitioning ubuntu"
2) if you are using a dual system and you have poured out a blank space in Windows (delete a disk directly in disk management ). You can directly select "wizard -- use the maximum continuous free space" When partitioning ubuntu ".
If you want to better understand the partition and implement self-customization, take a look at the following content to learn about the concept of the file system and mount point and then based on your actual needs.
I. File System
What is a file system?
The file system is the method and data structure used by the operating system to clarify the files on the disk or partition; that is, the method to organize files on the disk. It also refers to the disk or partition used to store files, or the type of file system. Therefore, it can be said that "I have two file systems" means that he has two partitions, one storage file, or he uses "extended File System", which means the types of file systems.
The difference between a disk or partition and the file system it includes is very important. A few programs (including the program that generates the file system for the most reason) directly operate on the disk or the original sector of the partition; this may damage an existing file system. Most programs operate on file systems and cannot work on different file systems.
Before a partition or disk can be used as a file system, you need to initialize it and write the record data structure to the disk. This process is called creating a file system.
Most UNIX file system types have similar generic structures, even if some details change. Its central concept is superblock, I node inode, data block, directory block, and indirect block indirection block. A super block includes the overall information of the file system, such as the size (the exact information depends on the file system ). The I node contains all information about a file except the name. The name and the number of I nodes exist in the directory. The directory entries include the file name and the number of I nodes of the file. The I node contains the number of data blocks used to store file data. I nodes only have a small number of data blocks. If more data blocks are required, the pointer space directed to the data blocks is dynamically allocated. These dynamically allocated blocks are indirect blocks. in order to locate the data blocks, this name indicates that it must first find the numbers of the indirect blocks.
UNIX file systems generally allow hole (using lseek; read the manual) in files, meaning that the file system pretends that a special position in a file is only 0 bytes, but the actual disk space is not reserved for the location of the file (this means that the file will use less disk space ). This often happens to small binary files, such as Linux shared libraries, databases, and other special cases. (A hole is implemented by a special value stored in an indirect block or I node as a data block address. This special address indicates that no data block is allocated for this part of the file, that is, the file contains a hole .)
Holes are useful. In the author's system, a simple measurement tool is displayed in the disk space used by MB, saving about 4 MB due to holes. In this system, there are relatively few programs and no database files.
Ii. mount point
In Linux, partitions must be mounted to the mount point in the form of a file system, just as partitions in windows must also be formatted as drive letters in FAT32 or NTFS format. At least one/partition is required for Linux (you must enable the startup option. It seems that no prompt is prompted during the direct partitioning during the installation process, so you don't have to worry about it ), generally, there will be a swap partition (this is similar to the virtual memory in windows, but it is more professional than that, and it is directly made into a partition form, in addition, there are swap files in Linux .), Of course, if your memory is large enough, you can avoid swap partitioning.
In Linux, the file system is organized in the/File System (root file system) tree. See how to partition in Wiki
Iii. How to partition
Are these file systems mounted as independent partitions? It's not all about it. It depends on your situation and needs.
Common partitioning methods include:/file system and a swap partition;/file system,/Home file system, and a swap partition, multiple Linux directory trees, such as the/boot System and/var file system, and the/back that does not belong to the Linux directory tree (the name can be set by yourself, or the/file can also be, this is the place for storing the backup data. It can be divided into one/and swap, and the hard disk space can be used to the maximum extent (as long as/is not used up when the user is using it, you can ignore the hard disk space issue), but in this way, you need to back up/home before reinstalling the system, otherwise it will be troublesome to reinstall the system. If the disk space you infringe on Ubuntu is relatively small, such as 8 GB and 10 Gb, it is better to use this method, although after the default system is installed, the/file system only has about 3 GB, however, as you install more software, the/file system will become larger and larger. I have allocated 6 GB to/file systems, and nearly 5 GB has been occupied. However, it is dangerous to divide only one/partition, which means that all data will be stored in the only/file system, this is not safe for the actual production system (just as we won't divide only one C disk when using Windows ). If the space allocated to Ubuntu is larger, you can mount/home independently or independently Mount others, such as/boot and/var, based on your own needs. This has some advantages:
Reference:
Root directory.
/, Root directory
/Boot partition, which contains the kernel of the operating system and the files to be used during system startup. It is necessary to create this partition, because most PCs are subject to BIOS restrictions, moreover, if you have a separate/boot partition, the computer can still start even if the primary root partition has a problem. The partition size is about 60 mb-120mb.
/Usr partition is the place where the software is stored in Linux. If possible, the maximum space should be allocated to it.
/Home partition is the location of your home directory. The size of this partition depends on the number of users. If multiple users use a computer together, this partition is completely necessary. Moreover, root users can well control the use of computers by common users, such as using hard disks for users or user groups, restrict common users to which files to access.
/Var/log partition is the System Log Record Partition. If this independent partition is set up, even if the system log file has a problem, they also do not affect the primary partitions of the operating system.
/Tmp partition, used to store temporary files. This is necessary for multi-user systems or network servers. In this way, even if a large number of temporary files are generated during the running of the program, or the user has performed wrong operations on the system, other parts of the file system are still safe. Because this part of the file system is still subject to read/write operations, it usually occurs faster than other parts.
/Bin partition to store standard system utilities
(Separate/boot partitions)
1. Several different operating systems can share the same kernel for convenient management.
2. The Boot directory has less I/O access and is placed in a single partition to prevent inode corruption caused by reading and writing of other directories.
3. The old motherboard has 1024 cylinders. You can avoid this problem by dividing the first 1024 cylinders into one boot partition.
4 If raid or LVM is used, the Boot manager may not support it, and the kernel cannot be found. Therefore, the independent boot partition is very meaningful.
5. convenient use of tools such as DD for backup
6. You can mount the boot partition in read-only mode to increase security.
Safe partitioning scheme principle: system data and common user data are separated and placed in different partitions (that is, separate home partitions ); the infrequently changed system data and frequently changed system data are separated and placed in different partitions (that is, separate USR partitions and VAR partitions ).
Generally, at least a separate home partition must be created in an actual system.
Iv. graphic demonstration
Here, I use virtual machines to show you how to operate partitions. Of course, the data here has no reference significance, but it just gives you a perceptual knowledge (PS: during the manual partitioning process, you can discard partitions with incorrect partition settings and re-start by "revoking the modification to partition Settings" at any time ):
(1) use desktop CD to install it on a blank Hard Disk:


Note: When installing Ubuntu to a blank hard disk with javastopcd, there are only two partitions: "Wizard-use the entire disk" and "Manual ", if you want to use the entire hard disk to install the Ubuntu system without finer partitioning, you can select "use the entire hard disk ", the installer automatically divides the entire disk into/file system and swap file system. The size of swap is slightly smaller than the memory in my experiment. "Using the entire hard disk" is relatively simple. Click the "Forward" button to complete the process in a flash. Next we will take a look at how to manually partition (simply divided into/,/home and swap, if you want to split more partitions, refer to the operation ):


Select "Manual" and click "Forward"


Click "New Partition Table" to create a partition table.


Click "continue"


1. Select free space)
2. Click new partition)
3. Select the type of the new partition: Primary (primary partition) (install Ubuntu to a new disk separately, and select primary for/partition. Select logical partition for other partitions; if a dual-system is installed and Windows is installed, you can select primary or logical as the partition type, and select logical as the logical partition for other partitions .)
4. Enter the size of the new partition (in MB)
5. 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 (ext3 or reisefs is generally used)
7. Select a mount point (although there is a drop-down triangle here, I cannot select it during a virtual machine experiment. I can only enter it myself)
8. Click OK.
After creating the/file system, you can see that an ext3 file system has been created and mounted to the/partition, with MB of free space left,


Continue to create and mount the partition to the/Home file system. Similar to the previous operation, the partition type does not need to be primary (primary partition), as long as it is a logical partition (logical:


After the/Home file system is created and mounted,


Next, we create a swap partition. Note that we can use the remaining free space provided by the system. The file system uses swap. You do not need to enter a mount point here:


All partitions have been created,


In the last step of the desktop CD installation, we can see:

Original link address: http://www.ylmf.net/read.php? Tid = 1086828

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.