Relationship between Linux Mount Points and partitions

Source: Internet
Author: User
Article Title: Relationship between Linux Mount Points and partitions. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Linux 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 Linux uses a more flexible naming scheme. It provides more information than naming schemes used by other operating systems. The naming scheme is file-based, and the file name format is:

/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 all possible partitions on/dev.

Xx

The first two letters of the partition name indicate the device type of the partition. Usually 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 (the second SCSI disk)

N

The last number indicates the partition. The first four partitions (primary or extended partitions) are arranged in numbers from 1 to 4. Logical partitions start from 5. For example,/dev/hda3 is the third primary partition or extended partition on the first IDE hard disk;/dev/sdb6 is the second logical partition on the second SCSI hard disk.

This naming scheme does not indicate the partition type. Unlike DOS/Windows, all partitions can be identified in Red Hat Linux. Of course, this does not mean that Red Hat 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 preceding information. It helps you easily understand many steps when setting partitions required by Red Hat Linux.

Linux disk partition and other OS

If Red Hat Linux and OS/2 coexist on your machine, you must use the OS/2 partition software to create your disk partition-otherwise, OS/2 may not recognize disk partitions. During installation, do not create any new partitions, but use Linux parted to set up the correct partition type for your Linux partitions.

If you want to read and write Windows NT, 2000, or XP partitions from Red Hat Linux, do not set the file system type of Windows partitions to NTFS. If the Windows partition type is NTFS, it cannot be read in Red Hat Linux; if the Windows partition type is VFAT, it can be read in Red Hat Linux.

If you have multiple Windows partitions, they do not have to use the same file system type. If you have more than one partition in Windows, you can set one of them as VFAT and store the files you want to share between Windows and Red Hat Linux.

In this step of preparation for installation of Red Hat Linux, you should begin to consider the number and size of partitions to be used in 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, unless otherwise, you should create at least the following partitions: swap,/boot, And/(Root.

Linux partition and mount point

What 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 implemented through mounting. mounting is the process of associating a partition to a directory. Mount partitions enable the storage zone starting from the specified directory (called mount point) to be used.

For example, if the partition/dev/hda5 is mounted on/usr, it means that all files and directories under/usr are physically located on/dev/hda5. Therefore, the file/usr/share/doc/FAQ/txt/Linux-FAQ is stored on/dev/hda5, but the file/etc/X11/TPD/Sessions/Gnome is not.

In the preceding example, one or more directories under/usr may be mount points of other partitions. For example, a partition (for example,/dev/hda7) can be mounted to/usr/local, this means that/usr/local/man/whatis will be located on/dev/hda7 instead of/dev/hda5.

In Windows, the drive letter is used to indicate both hardware (partitions on the hard disk) and paths in the system. In Linux, hardware is the hardware, path is the path, and will not be confused together, simple and direct!

In Linux, partitions are expressed in this way.

/Dev/hda

/Dev/hda1

/Dev/hda2

/Dev/hda5

/Dev/sdb1

Take/dev/hda5 as an example:

In Linux, every device is represented by a file in the/dev/folder. In/dev/hda5,/dev/indicates the dev directory under the root directory, let's look at the remaining part of hda5.

The first two letters "hd" indicate that this is an IDE hard disk. If it is sd, it indicates a SATA hard disk, or flash memory and other peripherals.

The third letter, a, indicates that this is the first device on this type of interface. Similarly, B, c, d ...... Represents the second, third, and fourth interfaces of this type respectively ...... Devices. For example, hdc indicates the master disk on the second IDE interface (each IDE interface allows one master device and one slave device ).

The fourth digit, number 5, does not indicate that this is the first logical partition in the hard disk. In Linux, the partition sequence cannot be changed to avoid unnecessary confusion, and the partition IDs are determined by their locations on the hard disk. The system reserves an identifier for all possible primary partitions, so 1-4 is not a logical partition, 5 is the first logical partition, and so on.

Software

Linux does not have the registry concept. Theoretically, you only need to copy all the relevant files and run the main program.

Traditionally, a software is usually copied to the bin, etc, lib, share, and other folders in the same directory.

Bin

Executable File. the executable file of the program is usually in this directory. You can set the search path in the environment variable and directly execute it without locating the path.

Etc

Configuration files. Most system program configuration files are stored in the/etc directory for centralized modification.

Lib

Library files, together to facilitate sharing to different programs. Compared with different software, saving database files separately can save some disk space.

Share

Other resources required for running the program, such as the sample mark and text. This part of files are proprietary and do not need to be shared. In addition, the directory structure is relatively complex and the contents are mixed and stored separately.

There are also some software that occupies a separate directory where all resources are stored. Similar to the green software in Windows, it is not recommended in Linux.

During execution, the system cannot find the executable file (it is unrealistic to search all paths and the resource overhead is too large). You need to locate the executable file, it is not convenient to run the/home/user/bin/executable file like this.

Many system software needs to run collaboratively, and configuration files are saved separately, which is very troublesome to locate.

If the library files used by the program, such as graphics library files, are stored separately, the disk space will be wasted very seriously.

There are some large software or important applications that you deploy. you can install them separately in a folder.

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.