|
Note |
| |
This appendix is not applicable to non-x86 systems. However, the general principles mentioned here may apply. |
Disk partitioning has long been a basic knowledge in the personal computer field. However, as more and more people are buying computers with pre-installed operating systems, very few people understand the principle of partitioning. This chapter attempts to explain the causes and usage of partitions, so that you can install Red Hat Enterprise Linux as easily as possible. If you have enough knowledge about disk partitions, you can jump to section c.1.4 to read about how to free up disk space to prepare for the Red Hat Enterprise Linux installation. This section also discusses the partition naming scheme used by Linux, sharing disks with other operating systems, and other related topics. C.1. basic concepts of Hard DiskHard Disks are extremely simple-they are used to reliably store and retrieve data. It is important to understand basic hardware knowledge when discussing issues such as disk partitions. Unfortunately, this easily puts people into bars and ignores the global picture. Therefore, this appendix uses a simplified disk drive chart to explain the situation after the disk partition. Figure C-1 shows a brand new, unused disk drive. Figure C-1. unused disk drive There's nothing to see, isn't it? However, if we only discuss disk drives at the most basic level, this chart is sufficient. Suppose we want to store some data on this disk drive. For now, this is not enough. First, we need to make some preparations... C.1.1. not what you write, but how you writeExperienced computer users may be aware of this. We needFormat)This drive. Formatting is also called "makingFile System)It is a process of writing information to the drive, creating order in the blank space in the drive without formatting. Figure C-2. Disk Drive with File System As shown in the figure C-2 implies, the order of the file system involves some advantages and disadvantages:
A small portion of the available space on the drive is used to store data related to the file system, which can be considered as administrative fees.
The file system divides the remaining space into small segments with uniform sizes. In Linux, these segments are calledBlock). [1]
Because the file system makes it possible to create directories and files, the above sacrifice can be seen as a very small price. It is worth noting that a unified and common file system does not exist. As shown in the C-3, a disk drive can have many different types of file systems. You may also guess that different types of file systems are usually incompatible. This means that operating systems that support a certain File System (or related file system types) may not support other types of file systems. However, the last sentence is not an uncompromising theorem. For example, Red Hat Enterprise Linux supports a wide range of file systems (including many file systems commonly used by other operating systems), making data exchange between different file systems much easier. Figure C-3. disk drives with different file systems Writing a file system to a disk is just the beginning. The goal of this process is actuallyStorageAndSearchData. After writing some files, let's take a look at the disk. Figure C-4. Disk Drive with data written As shown in the C-4, some previously blank blocks are now written to Data. However, in a single view, we cannot determine the number of files on the drive. There may be only one file, or many files, because all files must use at least one block, and some need several blocks. Another important point to note is that the blocks used do not have to form a continuous area. The blocks used and unused blocks can be staggered and scattered. This is what we callFragmentation). Segment fragmentation may affect the attempt to change the size of existing partitions. Like many computer-related technologies, disk drives have been constantly changing since the advent. In particular, they are getting bigger and bigger. Instead of increasing the actual size, they are capable of storing more and more information. This new capacity leads to a fundamental change in the usage of the disk drive. C.1.2. partitioning: convert a drive into multiple drivesAs disk drive capacity continues to increase, some people began to question whether it is wise to merge all formatted space into a large block. The motives for such ideas are philosophical and technical. From a philosophical point of view, if the extra space provided by a large disk drive exceeds a certain size, it may only cause more disorder. Technically, some file systems are not designed to support disk drives larger than a certain capacity. Or, some file systemsMayLarge drives with a large capacity are supported, but the management fees imposed by file system tracking files become too high. To solve this problem, divide the diskPartition). Each partition can be accessed like an independent disk. This is done by addingPartition Table).
|
Note |
| |
Although the partition tables shown in the charts in this chapter are separated from the actual disk drive, this is not completely correct. In fact, the partition table is stored on the disk before any file system or user data. But for clarity, we separate them in the chart. |
Figure C-5. Disk Drive with Partition Table As shown in the C-5, the partition table is divided into four parts or fourPrimary Partition". A primary partition is a partition on a hard drive that can only contain one logical drive (or part. Each part contains the information required to define a single partition. This means that the Partition Table cannot have more than four partitions. Each partition table project contains several important features of the partition:
Let's take a closer look at each feature. The start and end points actually define the partition size and location on the disk. The "active" flag is used by boot loaders of some operating systems. In other words, the operating system on the partition marked as "active" will be guided. Partition types may not be easily distinguished. Type is the number used to identify the partition. If this sentence sounds a little general, it is because the terms of the partition type are also a little general. Some operating systems use partition types to represent a specified system type, or mark partitions as partitions associated with an operating system, it can be used to indicate that the partition contains a bootable operating system or a combination of the preceding three. At this point, you may wonder how these additional complexities are usually used. See Figure C-6 for the instance. Figure C-6. Disk Drive with only one partition In many cases, the entire disk has only one partition, which is basically the method used previously to repeat the partition. A partitioned table has only one project, which points to the start point of the partition. We mark this partition as a "dos" class. Although it is only one of several possible partitions listed in the table C-1, it is sufficient for the purpose discussed in this appendix. The table C-1 contains some common (and rare) Partition types and their hexadecimal values.
| Partition type |
Value |
Partition type |
Value |
| Empty |
00 |
Novell Netware 386 |
65 |
| DOS 12-bit fat |
01 |
PIC/IX |
75 |
| XENIX Root |
02 |
Old minix |
80 |
| XENIX USR |
03 |
Linux/minux |
81 |
| DOS 16-bit <= 32 m |
04 |
Linux swap |
82 |
| Extended |
05 |
Linux native |
83 |
| DOS 16-bit> = 32 |
06 |
Linux extended |
85 |
| OS/2 HPFs |
07 |
Amoeba |
93 |
| AIX |
08 |
Amoeba bbt |
94 |
| AIX bootable |
09 |
BSD/386 |
A5 |
| OS/2 Boot manager |
0a |
OpenBSD |
A6 |
| Win95 FAT32 |
0b |
Nextstep |
A7 |
| Win95 FAT32 (LBA) |
0c |
Bsdi FS |
B7 |
| Win95 fat16 (LBA) |
0e |
Bsdi swap |
B8 |
| Win95 extended (LBA) |
0f |
Syrinx |
C7 |
| Venix 80286. |
40 |
CP/M |
DB |
| Novell |
51 |
DOS access |
E1 |
| PPC prep boot |
41 |
Dos r/o |
E3 |
| GNU Hurd |
63 |
DOS secondary |
F2 |
| Novell Netware 286 |
64 |
Bbt |
FF |
Table C-1. partition type C.1.3. partition in a partition-Overview of extended partitionsAfter a period of time, the four partitions are obviously insufficient. As the disk drive grows, it is more and more likely to have space remaining after four large partitions are configured. We need some methods to create more partitions. Enter the world of extended partitions. In the table C-1, you may have noticed that a partition type is extended ). It is the partition type at the core of the extended partition. When a partition is created and its type is set to "extended", the extended partition table is also created. In short, an extended partition is like an independent disk drive-it has its own partition table that points to one or more partitions-they are now called logical partitions (Logical partitions), And fourPrimary Partition)The partition table of the extended partition is completely included in the extended partition. The figure C-7 shows a disk drive with a primary partition and an extended partition containing two logical partitions (and some unpartitioned free space ). Figure C-7. Disk Drive with extended partitions The table implies that there is a difference between the primary partition and the logical partition-the primary partition can only have four, but there is no fixed limit on the number of logical partitions that can exist. However, given the way Linux is partitioned, you should avoid defining more than 12 logical partitions on a disk drive. Now we have roughly discussed the concept of partitioning. Let's take a look at how to apply this knowledge to installing the Red Hat Enterprise Linux. C.1.4. expand space for Red Hat Enterprise LinuxWhen you try to repartition your hard disk, there are three possible scenarios:
Let's take a look at each situation in sequence.
|
Note |
| |
Remember, the solution is simplified for clarity. They do not reflect the exact partition layout you encounter when installing the Red Hat Enterprise Linux. |
C.1.4.1. use unpartitioned free spaceIn this case, the defined partition is not extended to the entire hard disk and does not include unallocated space that does not belong to any defined partition. The graph C-8 shows possible situations. Figure C-8. Disk Drive with unpartitioned free space In graph C-8,1It indicates the undefined partition with undialed space,2It indicates the partition with the space that has been dialed. If you think about it, you will realize that an unused hard disk belongs to this type. The only difference is the latter'sAllSpace does not belong to any defined partition. Next, we will discuss a more general situation. C.1.4.2. use space in an unused PartitionIn this case, you may no longer use one or more partitions. Maybe you have used other operating systems in the past, and the partitions you dial to it seem no longer to be used. The figure C-9 shows this situation. Figure C-9. Disk Drive with unused partitions In graph C-9,1Indicates unused partitions,2Resends unused partitions for Linux. If you find yourself in this situation, you can use the space allocated to unused partitions. First, you should delete the partition and then create the corresponding LINUX partition on it. You can delete unused partitions during the installation process, and then manually create a new partition. C.1.5. partition naming schemeLinux uses a combination of letters and numbers to refer to disk partitions. This may be confusing, especially if you used the "C drive" method to refer to hard disks and Their partitions. In the DOS/Windows world, partitions are named using the following methods:
Each partition has been checked to determine whether it can be read by DOS/windows.
If the partition type is compatible, it is assigned to a "drive letter ". The drive letter starts with "C" and then goes alphabetically by the number of partitions to be tagged.
The drive letter can be used to indicate the partition or the file system containing the partition.
Red Hat Enterprise Linux uses a more flexible naming scheme. It provides more information than naming schemes used by other operating systems. This naming scheme is based on files, and the file name format is similar/Dev/Xxyn. The following describes how to resolve the partition naming scheme:
- /Dev/
-
This string is the directory name of all device files. Because the partition is on the hard disk and the hard disk is a device, these files represent/Dev/All possible partitions.
-
Xx
-
The first two letters of the partition name indicate the device type of the partition. NormallyHD(IDE disk) orSD(SCSI disk ).
-
Y
-
This letter indicates the device where the partition is located. For example,/Dev/hda(First IDE disk) or/Dev/SDB(Second SCSI disk)
-
N
-
The last number indicates the partition. The first four partitions (primary or extended partitions) are separated by numbers1Sort4. Logical partition from5Start. For example,/Dev/hda3Is the third primary partition or extended partition on the first IDE hard disk;/Dev/sdb6Is the second logical partition on the second SCSI hard disk.
|
Note |
| |
This naming scheme does not indicate the partition type. It is different from DoS/windows,AllPartitions can be identified in Red Hat Enterprise Linux. Of course, this does not mean that Red Hat Enterprise Linux can access data in each type of partition, but in many cases, it is possible to access data in partitions dedicated to another operating system. |
Remember the above information. It helps you easily understand many steps when setting partitions required by Red Hat Enterprise Linux. C.1.6. disk partition and other operating systemsIf your Red Hat Enterprise Linux partition will share a hard disk with the partition used by other operating systems, in most cases, there should be no problem. However, a combination of liunx and other operating systems requires special attention. C.1.7. disk partition and mount pointWhat puzzles many new Linux users is how each partition is used and accessed by the Linux operating system. It is relatively simple in DOS/windows. Each partition has a "drive letter". You can use proper drive letters to indicate the files and directories in the corresponding partition. This is different from how Linux handles partition and disk storage problems. The main difference is that each partition in Linux is part of the storage zone necessary to support a set of files and directories. It is throughMount)To attach a partition to a directory. Mount a partition to start with the specified directoryMount point. For example, if the partition/Dev/hda5/Mounted on/Usr/, Which means that all/Usr/Files And Directories are physically located in/Dev/hda5/. Therefore/Usr/share/doc/faq/TXT/Linux-FAQSaved in/Dev/hda5/And file/Etc/X11/TPD/sessions/gnomeBut not. Continue with the above example,/Usr/One or more directories under may be mount points of other partitions. For example, a partition,/Dev/hda7/) Can be mounted/Usr/local/Which means/Usr/local/man/whatisWill be located in/Dev/hda7Instead/Dev/hda5. C.1.8. how many partitions?In this step, you should consider the number and size of partitions used by your new operating system. "How many partitions" has always been a controversial issue in the Linux community. Before the conclusion is reached, we can say that there are as many people discussing this issue as available partition la S. In view of the above situation, we recommend that you create at least the following partitions unless otherwise:Swap,/Boot/(/Boot/files are only required for other systems, but not for iseries systems), PPC prep boot, and/(Root) partition. Note: New virtual disks can be dynamically added on OS/400 v5r2 and later versions. |