System Management: linux disk structure and partition

Source: Internet
Author: User
Tags ide hard drive
System Management: This section describes the linux disk structure and partition-general Linux technology-Linux technology and application information. The following is a detailed description. First, we need to have a preliminary understanding of the basic concepts of Hard Disk partitioning. Hard Disk partitioning is mainly divided into two types: Basic partition and extension partition, the sum of the number of basic partitions and extended partitions cannot be greater than four. The basic partition can be used immediately but cannot be partitioned. The expanded partition must be partitioned before it can be used, that is, it must be partitioned twice. So what will be further divided by the expanded partition? It is a logical partition, and there is no limit on the number of logical partitions.

For users who are accustomed to using dos or windows, there are several partitions with several drives, and each partition will get a letter identifier, then you can use this letter to specify the files and directories in the partition. Their file structures are independent and easy to understand. But is it annoying for these users to get started with red hat linux. For red hat linux users, no matter how many partitions are allocated to which directory to use, it has only one root directory and an independent and unique file structure. In red hat linux, each partition is used to form a part of the entire file system, because it adopts a processing method called "LOAD, its entire file system contains a complete set of files and directories and associates a partition with a directory. In this case, a partition to be loaded will make its storage space available in a directory. Next, let's take a look at how red hat linux drives are identified.

For an ide hard drive, the drive identifier is "hdx ~", "Hd" indicates the type of the device where the partition is located. This indicates the ide hard disk. "X" is the disk number (a is the basic disk, B is the basic slave disk, c is the auxiliary master disk, d is the auxiliary slave disk), "~" The first four partitions are represented by numbers 1 to 4. They are primary partitions or extended partitions. They are logical partitions starting from 5. For example, hda3 indicates the third primary or extended partition on the first ide hard disk, and hdb2 indicates the second primary or extended partition on the second ide hard disk. For a scsi hard disk, it is marked as "sdx ~", The scsi hard disk uses "sd" to represent the type of the device where the partition is located. The rest are the same as the representation of the ide hard disk.

We can see from the above that the red hat linux partition is different from other operating system partitions. Its partition format is ext2 and swap, and ext2 is used to store system files, swap serves as the swap partition for red hat linux. Now we can know that red hat linux requires at least two dedicated partitions (linux native and linux swap). Moreover, red hat linux cannot be installed in dos/windows partitions. In general, we install one or more hard disk partitions of the "linux native" type in red hat linux, however, in red hat linux, a "mount point" must be specified for each partition, telling red hat linux which directory should be used at startup. A "swap" partition is generally defined and does not need to define a load point. Next we will first have a preliminary understanding of "linux native" and "linux swap.

* The swap partition is the swap partition for linux to temporarily store data, which is mainly used to store the data temporarily not used in the primary memory and re-transfer it into the memory as needed, you do not need to specify the "mout point" (loading point) for the partition used as the swap. Since it is used as the swap partition, we should specify the size for it, it must at least be equal to the actual amount of memory on the system. Generally, it is twice the size of the memory. If you have 16 MB memory, the size of the swap partition is about 32 MB, and so on. Note that the size of the swap partition should not exceed 128 mb. If you have 64 mb of memory, the maximum size of the swap partition can only be set to 127 mb, which is a waste of space, because the system does not need too many swap partitions. Similarly, if your memory is 127 mb or larger, the maximum size of the swap partition can be set to mb. Besides, you must note that if you have 128 mb (or larger) memory, you must remind the system that you have such a large memory. Otherwise, it may not recognize your mb memory. Details: After the installation process is successfully started, a boot: prompt is displayed. You only need to type boot: linux mem = Mb. In addition, you can create and use more than 16 swap partitions.

* Linux native stores system files. It can only use the ext2 partition type, as mentioned above. For windows users, the operating system must be installed in the same partition. Is it commercial software! So you have no choice! For red hat linux, you have a lot of options. You can install the system files in several zones (the loading point must be specified ), it can also be installed in the same partition (the loading point is "/"). Next, let's take a look at which partitions can be created (only a few commonly used columns ).

/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 50 mb-100mb. However, if you want to use lilo to start the red hat linux system, the partitions containing/boot must be completely less than cylindrical 1023. Because the data after 8 GB cannot be read by lilo, red hat linux should be installed within 8 GB.

/Usr partition: the place where the software is stored in red hat linux. If possible, allocate the maximum space 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. In fact, it is necessary for a single user to establish this partition. If this partition is not available, you can only log on to the system as the root user. This is dangerous, because the root user has absolute right to use the system, once you misoperate the system, the trouble will arise.

/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, which stores standard system utilities.

/Dev partition to store device files.

/Opt partition, which stores optional installed software.

/Sbin partition, which stores standard system management files.

This section describes several common partitions. Generally, we need a swap partition, A/boot partition, A/usr partition, A/home partition, and A/var/log partition. Of course, there is no rule. It is determined by yourself. But remember that there must be at least two partitions, one swap partition and one/partition. Next let's take a look at how to partition.

You can use two partitioning tools:

1. disk druid: it is a hard disk management tool provided by red hat linux. It was initially released with red hatlinux5 and can be used to create and delete hard disk partitions as required by users, in addition, you can manage the load point for each partition. This is a good partition software and is recommended for readers. This article also describes the red hat linux partition in detail using this software.

2. fdisk: it is a traditional linux hard disk partitioning tool, which is more powerful and flexible than disk druid. However, fdisk requires you to have some experience in hard disk partitioning and be able to adapt to and understand simple text interfaces. If this is the first time you partition a hard drive, it is best to avoid programs like fdisk. Although it is powerful, it does not feel very good to use.

Note: In addition, red hat linux also provides a partition software called fips. However, this partition software is dangerous and should not be recommended. Although many people have successfully used fips to partition their hard disks, this does not guarantee that fips will run properly in your system. In addition, red hat linux does not provide fips support. It is recommended that you use this partition software with caution.

If you want to install red hat linux on a disk that already contains other operating systems, that is, multiple operating systems, this situation is complicated, A mistake can destroy the data you have worked so hard to save and make you cry. If you want to make red hat linux and OS/2 coexist, you must use the OS/2 partition software to create hard disk partitions. Otherwise, OS/2 cannot recognize hard disk partitions. In addition, you can also use other partition software to partition. The following lists some common partition tool software:

* Partition commander software, downloaded from the www.v-com.com.

* Partition it software, which can be downloaded from www.quarterdeck..com.

* Partition magic software, which can be downloaded from www.powerquest.com.

Note: Hard Disk partitioning is a very dangerous step. It is not realistic to change the disk partition safely without data loss. Therefore, we recommend that you back up important data, it is more important to install multiple operating systems for emergency purposes. Of course, you may have just installed the system or just prepared to reinstall it. That is another thing, but you must be careful and careful when dealing with partitions. Remember.

The following describes in detail some information contained in the disk druid partition software of red hat linux7.1.

1. current disk partitions area (each row represents a hard disk partition)

Mount point indicates the loading point of the partition after red hat linux is started and runs. The swap space (linux swap) does not need to be loaded.

Device Name of the device hard disk partition

Minimum space requested by requeted to define this partition

Actual space allocated to the partition by actual

Type indicates the partition type.

2. drive summaries area (each line represents a hard disk)

Drive displays the device name of the hard disk

Geom [c/h/s] displays the physical information of the hard disk, c (cylindrical), h (head), s (sector)

Total display available space of the hard disk

Used: displays the allocated space on the hard disk.

Free displays the space allocated at the end of the hard disk.

Bar graph displays the percentage of the current hard disk in a graphical manner. # The smaller the number, the more free space the disk is.

3. disk druid button

Add a partition

Edit modifies the attributes of the selected partition in current disk partitons. If you select this button, a dialog box is displayed, but you can only modify the loading point of the partition. If you need to modify other content, delete the partition first, and then re-create the partition.

Delete deletes a partition selected in current disk partitons.

OK

Back is not saved.

4. If you want to add a partition, click "add". A dialog box is displayed, which describes the following content:

Mount point: partition loading point.

Size partition size

Grow to fill disk indicates that this partition will fill up the entire unallocated space of a hard disk. At this time, the capacity of this partition can increase or decrease with the modification of other partitions.

Type select partition type

Allowable drives: select the disk on which the partition will be created

Now, with the above understanding, we can easily create a suitable partition. The next step is to format the created partition, select the partition you want to format, and press the space key. If you want to check whether there are any bad blocks while formatting the partition, select check for bad blocks during format, click OK, and press space. If no data you want to save exists in the partition, it is best to format it all.
Related Article

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.