Linux system mount point and partition relationship

  

Linux uses a combination of letters and numbers to refer to disk partitions. This can be confusing, especially if you've used the "C drive" method to refer to hard drives and their partitions. In the DOS/Windows world, partitions are named in the following ways:

Each partition is checked to determine if it can be read by DOS/Windows.

If the partition type is compatible, it will be assigned to a "drive letter". The drive letter begins with "C"; and then moves alphabetically according to the number of partitions to be labeled.

Drive letters can be used to refer to that partition, and can also be used to refer to the file system contained in the partition.

Red Hat Linux uses a more flexible naming scheme. It conveys more information than the naming schemes used by other operating systems. The naming scheme is file-based. The format of the file name is:

/dev/xxyN

The following explains how to resolve the partition naming scheme:

/dev/< Br>

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

xx

The first two letters of the partition name indicate the type of device on which the partition resides. Usually it is hd (IDE disk) or sd (SCSI disk).

y

This letter identifies the device on which the partition is located. For example, /dev/hda (the first IDE disk) or /dev/sdb (the second SCSI disk)

N

The last number represents the partition. The first four partitions (primary or extended) are numbered from 1 to 4. The logical partition starts at 5. For example, /dev/hda3 is the third primary or extended partition on the first IDE hard disk; /dev/sdb6 is the second logical partition on the second SCSI hard disk.

There is no place to indicate the partition type in this naming scheme; unlike DOS/Windows, all partitions are recognized under Red Hat Linux. Of course, this is not to say that Red Hat Linux can access data on each type of partition, but in many cases it is possible to access data on a partition dedicated to another operating system.

Keep the above information in mind; it will help you understand many of the steps easier when setting up the required partitions for Red Hat Linux.

Linux disk partitioning and other OS

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

If you want to be able to read and write Windows NT, 2000, or XP partitions from Red Hat Linux, do not set the file system type of the Windows partition 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 don't have to use the same file system type. If you have more than one partition in your Windows, you can set one of them to VFAT and store the files you want to share between Windows and Red Hat Linux.

At this point in the preparations for Red Hat Linux installation, you should start thinking about the number and size of partitions your new operating system will use. “How many partitions” has been a controversial issue in the Linux community. Before the conclusion, there can be as many partitions as there are people arguing about this issue.

Given the above, unless you have another reason, you should at least create the following partitions: swap, /boot, and /(root) partition.

Linux Partitions and Mount Points

One of the things that confuses many new Linux users 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 indistinguishable from Linux's approach to handling partitions and disk storage issues. 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, which is the process of associating a partition to a directory. Mounting a partition enables a storage area starting at this specified directory (known as the 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 /dev/hda5, but the file /etc/X11/gdm/Sessions/Gnome is not.

Continuing with the above example, one or more directories under /usr may also be mount points for other partitions. For example, a partition (assumed to be /dev/hda7) can be mounted under /usr/local, which means /usr/local/man/whatis will be on /dev/hda7 instead of /dev/hda5 .

Perhaps you noticed that in Windows, the drive letter is used to represent both the hardware (the partition on the hard disk) and the path in the system. In Linux, the hardware is the hardware, the path is the path, it won't be confused, it's straightforward!

In Linux, the partition is represented like this

/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 in the /dev/folder, /dev/hda5, /dev/represents the dev directory in the root directory, we Look at the rest of the hda5.

The first two letters hd indicate that this is an IDE hard drive. If it is sd, it means SATA hard drive, or peripherals such as flash memory.

The third letter, a, indicates that this is the first device on that type of interface. Similarly, b, c, d … … represent the second three-four … … devices on the type interface. For example, hdc represents the primary hard disk on the second IDE interface (one primary device and one secondary device are allowed on each IDE interface).

The fourth digit of 5 does not mean that this is the fifth partition in the hard drive, but the first logical partition. Because in Linux, in order to avoid unnecessary confusion, the order of the partitions cannot be changed, and the partition identifiers are determined by their position on the hard disk. The system has to reserve 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.

Software

There is no registry in Linux. Install the software, in theory, just copy all the relevant files and run its main program.

According to tradition, a software is usually copied to bin, etc, lib, share, etc. in the same directory.

bin

Executables, the program's executable is usually in this directory. By setting the search path in the environment variable, you can execute it directly without having to locate its path.

etc

Configuration files, most of the system program configuration files are saved in the /etc directory for centralized modification.

lib

Library files are grouped together for easy sharing to different programs. Saving disk files separately compared to different software can save some disk space.

share

Other resources required for the program to run, such as icons, text. This part of the file is proprietary and does not need to be shared; and the directory structure is relatively complex, and it is confusing to mix and put together, so it is stored separately.

There are also some software that take up a separate directory and all resources are in this directory. Similar to the green software under Windows, it is not recommended to do this under Linux.

When executing, the system can't find the executable file (search all paths, the resource overhead is too large, it is unrealistic), you need to locate its location, like this /home/user/bin/executable file, Not convenient enough.

Many system software needs to run in cooperation, and the configuration files are saved separately. It is very troublesome to locate them.

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

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

Copyright © Windows knowledge All Rights Reserved