"4" why is there no Linux partition

Source: Internet
Author: User

Do users who study Linux find that there is no "4" in the Linux partition? You know why? This article gives you a detailed introduction to the problem that the "4" number does not exist in Linux partitions, which plays a certain role in learning Linux.

In Linux, hard disk partitions are represented by hd * x or sd * x, where * represents a, B, c ...... ...... Numbers 1, 2, 3, and so on ...... ...... IDE Hard Disks are generally expressed as hd * in Linux or other Unix-like systems, such as hda, hdb ......, you can view it through fdisk-l. Sometimes you only have one hard disk, but hdb is displayed in the operating system, which is related to the hard disk jumper. In addition, most hdc devices are optical drive devices; if you have two hard disks: hda and hdb. SCSI and SATA hard disks are usually represented as sd * in Linux, for example, sda, sdb... take fdisk-l as the standard. We already know this, but do you notice that you cannot see hda4 or sda4 at any time? This is actually the case:

Let's look at an example:
The following information can be found through fdsik-l:

 
 
  1. Disk /dev/hda: 80.0 GB, 80026361856 bytes  
  2. 255 heads, 63 sectors/track, 9729 cylinders  
  3. Units = cylinders of 16065 * 512 = 8225280 bytes  
  4. Device Boot Start End Blocks Id System  
  5. /dev/hda1 * 1 765 6144831 7 HPFS/NTFS  
  6. /dev/hda2 766 2805 16386300 c W95 FAT32 (LBA)  
  7. /dev/hda3 2806 9729 55617030 5 Extended  
  8. /dev/hda5 2806 3825 8193118+ 83 Linux  
  9. /dev/hda6 3826 5100 10241406 83 Linux  
  10. /dev/hda7 5101 5198 787153+ 82 Linux swap / Solaris  
  11. /dev/hda8 5199 6657 11719386 83 Linux  
  12. /dev/hda9 6658 7751 8787523+ 83 Linux  
  13. /dev/hda10 7752 9729 15888253+ 83 Linux 

Through this example, we can see that the primary partition has 3, from the hda1-hda3, the extended partition by the hda5-hda10; this hard disk does not have the primary partition 4, so it does not show the primary partition hda4; but the logical partition cannot start from 4, because it is the location of the primary partition. Do you understand? That is to say, three primary partitions and one extended partition are divided into all logical partitions. Therefore, hda4 is an extended partition, and the logical partition must start from 5! Think about windows partition)

Reasonable partition planning is very important. For a disk partition, a disk should have four primary partitions, And the expansion is also considered a primary partition. The following situations exist:
1) partition structure: four primary partitions without extended partitions; [primary | partition 1] [primary | partition 2] [primary | partition 3] [primary | partition 4], in this case, if you want to divide more than five partitions on a disk, this will not work;
Three primary partitions have one extended partition. [primary | partition 1] [primary | partition 2] [primary | partition 3] [extended partition] |
[Logic | partition 5] [logic | partition 6] [logic | partition 7] [logic | partition 8] ......
This situation works, and the degree of freedom of partitions is relatively large. partitions are not restricted and can be divided into more than five partitions. This is just an example;

2) The most reasonable partitioning method;
The most reasonable partition structure: the primary partition is in the front, the extended partition is in the back, and then the logical partition is divided in the extended partition; the number of Primary partitions + the number of extended partitions should be controlled within four; for example, the following partition is better;

[Primary | partition 1] [primary | partition 2] [primary | partition 3] [extended partition]

[Logic | partition 5] [logic | partition 6] [logic | partition 7] [logic | partition 8] ......

[Primary | partition 1] [primary | partition 2] [extended partition]

[Logic | partition 5] [logic | partition 6] [logic | partition 7] [logic | partition 8] ......

[Primary | partition 1] [extended partition]

[Logic | partition 5] [logic | partition 6] [logic | partition 7] [logic | partition 8] ......

The most unreasonable partition structure: the primary partition is surrounded by extended partitions; for example, the following;
[Primary | partition 1] [primary | partition 2] [extended partition] [primary | partition 4] [Blank unpartitioned space]

[Logic | partition 5] [logic | partition 6] [logic | partition 7] [logic | partition 8] ......

In this way, [extended partitions] between [primary | partition 2] and [primary | partition 4] have degrees of freedom, but what should I do if [blank and unpartitioned space] After [primary | partition 4? Unless primary partition 4 fully utilizes the space after the extended partition, it is impossible for you to create another partition after primary partition 4, making it impossible to divide logical partitions; although this method also complies with the four primary partitions of a disk, the partitioning method of the primary partition surrounding the extended partition is not available. The preceding figure shows why "4" is not displayed in the Linux partition.

  1. Yuan Meng: a decade of great changes in Linux
  2. 8 best Linux platform BI) Software
  3. FAQs about soft RAID in Linux
  4. The anti-piracy Method for new systems based on Linux platforms is not applicable.
  5. Inter-process communication in Linux

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.