The relationship between mount points and partitions of Linux systems (reproduced)

Source: Internet
Author: User

The main storage device for storing information in a computer is the hard disk, but the hard disk cannot be used directly, the hard disk must be segmented, and the partition of the hard disk is partitioned. In traditional disk Management, a hard disk is divided into two major categories: primary and extended partitions. The primary partition is the ability to install the operating system, capable of computer-initiated partitions, such partitions can be directly formatted, and then install the system, directly stored files.

There can be up to 4 primary partitions in a hard disk of an MBR partition table type. If you need more than 4 disk blocks on a hard disk, you need to use an extended partition. If you use an extended partition, you can have up to 3 primary partitions and one extended partition on a physical hard disk. An extended partition cannot be used directly, it must be partitioned into a logical partition for the second time before it can be used. A logical partition in an extended partition can be any number.

After partitioning the disk, it must be formatted before it can be formally used, the format of the common disk format is: FAT (FAT16), FAT32, NTFS, ext2, ext3 and so on. (from Baidu Encyclopedia)

Following from Chinabyte, original link: http://soft.chinabyte.com/os/6/12172006.shtml

Linux uses a combination of letters and numbers to refer to a disk partition. This may be confusing, especially if you previously used the "C drive" method to refer to hard disks and their partitions.

In the Dos/windows world, partitions are named by the following methods: Each partition is checked to determine if 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 based on the number of partitions to label. The drive letter can be used to refer to that partition, or it can be used to refer to the file system included with the partition.

Red Hat Linux uses a more flexible naming scheme. It conveys more information than the naming scheme used by other operating systems. The naming scheme is file-based and the file name is in the format:/dev/xxyn (for example,/DEV/SDA2)

Here's how to parse a partition naming scheme:

/dev/: This string is the directory name where all the device files reside. Because the partitions are on the hard disk, and the hard disk is the device, these files represent all the possible partitions on the/dev/.

XX: The first two letters of the partition name indicate the type of device on which the partition is located. This is typically an HD (IDE disk) or SD (SCSI disk).

Y: This letter indicates the device where the partition is located. For example,/dev/hda (the first IDE disk) or/dev/sdb (a second SCSI disk)

N: The last number represents the partition. The first four partitions (primary or extended) are arranged in numbers from 1 to 4. The logical partition starts at 5.

In Linux, partitions are represented by/dev/hda,/dev/hda1,/dev/hda2,/dev/hda5,/DEV/SDB1

Take/dev/hda5 as an example:

Because in Linux, each device is represented by a file under the/dev/folder, so/dev/hda5,/dev/represents the Dev directory under the root directory, we look at the remainder of the HDA5.

The first two-bit letters HD indicates that this is an IDE hard disk, and if it is SD, it represents a SATA hard drive, or peripherals such as flash memory.

The third-digit letter A indicates that this is the first device on the type interface. Similarly, B, C, D ... Represents the No. 234 on the type of interface respectively ... A device. For example, HDC represents the primary hard disk on the second IDE interface (one master device and one slave device per IDE interface).

The number 5 in the fourth digit does not mean that this is the 5th partition in the hard disk, but the first logical partition. Because in Linux, in order to avoid unnecessary confusion, the order of partitions cannot be changed, and the partition identity is determined by their location on the hard disk. The system also reserves the identity for all possible primary partitions, so 1-4 must not be a logical partition, 5 is the first logical partition, and so on.

There is no place in the naming scheme that indicates the type of partition; Unlike dos/windows, all partitions can be identified under Red Hat Linux. Of course, this is not to say that Red Hat Linux has access to data on each type of partition, but in many cases it is possible to access data on partitions that are dedicated to another operating system.

When installing Red Hat Linux, you should start thinking about the number and size of partitions that your new operating system will use, and unless there are other reasons, you should create at least the following partitions: Swap,/boot, and/(root) partitions.

Linux partitions and mount points

One area of confusion for many new users of Linux is how partitions are used and accessed by the Linux operating system. It is relatively simple in dos/windows. Each partition has a "drive letter" and you use the appropriate drive letter to refer to the files and directories on the corresponding partition.

This is different from how Linux handles partitioning and disk storage problems. The main difference is that each partition in Linux is part of the storage area necessary to support a set of files and directories. It is implemented by mounting (mounting), which is the process of associating a partition to a directory. The mount partition enables the storage area starting at this specified directory (known as mount point) to be used.

For example, if the partition/dev/hda5 is mounted on/usr, this means that all files and directories under/usr are physically located on/dev/hda5. So the file/usr/share/doc/faq/txt/linux-faq is stored on the/DEV/HDA5, and the file/etc/x11/gdm/sessions/gnome is not.

Continuing with the above example, one or more directories below/usr may also be the mount points of other partitions. For example, a partition (suppose,/DEV/HDA7) can be mounted under/usr/local, which means that/usr/local/man/whatis will be on/DEV/HDA7 instead of/DEV/HDA5.

Perhaps you notice that in Windows, the drive letter is used both to represent the hardware (the partition on the hard disk) and to represent the path in the system. In Linux, hardware is the hardware, path is the path, will not be confused together, simple and direct!

Relationship of Linux system mount points to partitions (reproduced)

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.