cen0s mount device under load

Source: Internet
Author: User

In CentOS, if we want to view the CD drive, or to mount the installation package to a folder, I write down some of my understanding.

The so-called mount, is the physical device or file (including installation files, compressed packets, etc.), and a directory in the system to establish a shortcut, and then through this shortcut we mount the object to operate

One Mount Optical disk drive
[Email protected] Desktop]$ ls-l/dev|grep cdrom
lrwxrwxrwx. 1 root root 3 Jan 6 04:34 CDROM-sr0----> Optical drive is named: CDROM
CRW-RW----. 1 root CDROM, 1 Jan 6 04:34 SG1
BRW-RW----+ 1 root cdrom one, 0 Jan 6 04:34 sr0

Brain Repair:

Therefore, the FHS standard suggestion: the root record (/) where the split slot should be as small as possible, and the software installed by the program should not be placed in the same slot with the root record, keep the root record as small as possible. This is not only good performance, the root of the file system is also less prone to problems.

In the FHS of the foregoing, it is therefore necessary to have the existence of these sub-records at the bottom, even if there is no physical record, and FHS would like to have at least a link to exist:

The
Catalogue File contents should be placed
Part I: FHS requirements must exist in the catalogue
/bin The system has a lot of records for the/bin, but the comparison is special. Because /bin is placed in a single-person maintenance mode can also be manipulated instructions. The commands under/bin can be used by root and general account, mainly: Cat, chmod, chown, date, MV, mkdir, CP, Bash and so on.
/boot This is primarily a file that will be used to place the opening, including the Linux core files and the required settings for the opening and the start of the machine. Linux kernel commonly used files are: Vmlinuz, if you are using GRUB2 this management program, there will be/boot/grub2/this record Oh!
/dev On the Linux system, any device and peripheral is in the form of a file that is present in this catalogue. All you have to do is access one of the files under this record and wait for access to a device that is more important than /dev/null,/dev/zero,/dev/tty,/dev/loop*,/dev/sd*, etc.
/etc system's major settings are almost always placed in this catalogue, such as the person's account password, the start of each service, and so on. In general, the files in this category can be checked by the general user, but only the root has the power to modify them. FHS suggestions do not place the removable file (binary) in this catalogue. The more important files are: /etc/modprobe.d/,/etc/passwd,/etc/fstab,/etc/issue and so on. In addition, FHS also has a few important records that are best to exist/etc/:
  • /etc/opt (necessary): This item is placed in a third party The/opt of the Force software
  • /etc/x11/(suggestion): All the settings associated with X Window are here, especially xorg.conf this X Ser Ver's setup.
  • /etc/sgml/(suggestion): Various settings related to SGML format
  • /etc/xml/": various settings related to XML format
/lib The system has a lot of functions, and the /lib is placed in the library that will be used at the time of the opening, and the function library that the instruction under/bin or/sbin will call. What is a function library? You can think of him as "hanging out", some instructions have to have these "hanging" to be able to complete the program's meaning. In addition, FHS requires that the following must exist:
  • /lib/modules/: This is the main type of core-related modules (drivers) that can be pumped.
/media Media is the "media" of the English, the name of the definition, this /media is placed under the removable devices! devices, including software, CDs, DVDs, and so on, are temporarily installed. Common files are:/media/floppy,/media/cdrom and so on.
/mnt If you want to temporarily load certain extra devices, it is generally suggested that you can place them in this catalogue. In ancient times, the purpose of this recording is the same as/media! Just after the/media, this recording was used for a while.
/opt This is for third-party software to place the records. What is third party software? For example, the KDE desktop management system is a stand-alone project, and the KDE software is proposed to be placed in the Linux system, so that it can be installed. Also, if you want to install the extra software yourself (not the original distribution), then you can install your software here too. But, in the previous Linux system, we were still accustomed to being placed under the/usr/local.
/run The various information generated by the early FHS system will be placed under the/var/run, and the new version of FHS is under/run. Because/run can use memory to simulate, so the performance will be much better!
/sbin Linux has a lot of instructions to be used to set the system environment, these instructions only root can be used to "set" the system, the other users can only use to "inquire" only. placed under the/sbin is required for the process, which includes the instructions required for the machine, the restoration, and the original system. For some server software programs, it is generally put into/usr/sbin/. The system binary, which is produced by the machine's own software, is placed in the/usr/local/sbin/, too. Common commands include: fdisk, fsck, Ifconfig, MKFS, and so on.
/srv SRV can be regarded as the "service" of the contraction, is a number of Web services after the activation of these services need to access the information. Common services such as WWW, FTP and so on. For example, the Web information required by the WWW server can be placed in the/srv/www/. But, if the system has not yet been offered to anyone on the internet, it is a suggestion to place it under/var/lib.
/tmp This is where the general user or the program being executed temporarily places the file. This item is accessible to anyone, so you need to clean it up regularly. Of course, important information can not be placed in this catalogue ah! Because FHS even suggest that you should remove the information from/TMP at the start of the machine!
/usr Second layer FHS set, continue to introduce
/var The second FHS set, mainly to place the information of the change, and then continue to introduce
Part II: FHS The list of possible existing items
/home This is the user's home directory of the system's presets. When you add a general user account, the user's home record will be set here. More importantly, there are two generations of home records:
  • ~: Represents the current user's home catalogue
  • ~dmtsai: This represents Dmtsai's home catalogue!
/lib<qual> Used to store two/lib in different formats, such as the/LIB64 Library, which supports 64-bit functions.
/root The system administrator (root) 's home catalogue. The reason for this is that if you enter the single-person maintenance mode and simply download the root record, the record will be able to have root records, so we would like Root's home record and root record in the same slot.

In fact, the standard of the FHS to the root of the record is only the above, but we have a lot of Linux under the title you also need to understand. Below are a few of the most important items in Linux:

/tr>
catalogue file contents
/lost+found This is a record that uses the standard EXT2/EXT3/EXT4 file format for the purpose of placing some of the missing fragments into this record when the file system is wrong. \ \ \ \ \ \ \ If you are using the XFS file system, there will be no such recording!
/proc This is a virtual file system (virtual filesystem). The information he places is in memory, such as the system core, the travel information (process), the state of the perimeter device, and the network state, and so on. Because the information in this project is in memory, so it doesn't occupy any hard disk space! More important files such as: /proc/cpuinfo,/PROC/DMA,/proc/interrupts,/proc/ioports,/proc/net/*, etc.
/sys This is very similar to/proc, and it is also a virtual file system, and it is primarily a record of core and system hardware information. This includes the currently loaded core modules and the hard device information detected by the core. This record does not occupy the capacity of the hard disk Oh!

Early Linux in the design, if the problem, rescue mode is usually only download root records, so there are five important records are required to be placed with the root record, that is/etc,/bin,/dev,/lib,/sbin these five important records. Now that many Linux distributions have moved many non-essential files out of/usr,/usr is also more and more refined, and since/USR is suggested to be "even if it is a read-only, the system can be normal operation" mode, so rescue mode can also be downloaded/ USR Oh! For example, our CentOS 7.x version is like this in the rescue mode. So the five-item limit has been broken! For example, the CentOS 7.x has been/sbin,/bin,/lib all moved to/usr under the mile!

Okay, we're done with the root catalogue, and then we'll talk about/usr and/var! Let's look at what's Inside/usr:

    • The meaning and content of/usr:

According to the basic definition of FHS, the information placed in/USR is a shareable and immutable (shareable, static), if you know how to get through the network of slots (for example, the NFS server in the server article), then/ USR can actually be shared with other hosts on the local network.

Many readers will misunderstand/usr to the user's contraction, the actual usr is the UNIX software resource, which is the "Unix system software Resources" placed in the records, not the user's information! This should be noted. FHS recommend that all software developers should place their information reasonably in the sub-records of this record, rather than creating the software's own unique record. "-----

Because it is the software of all system presets (the software provided by the distribution) is placed under/usr, this is a bit like the Windows system "C:\Windows\ (part of it) + C:\Program files\" These two CI, the system has been installed, this recording will occupy the most hard disk capacity. In general, the sub-records of/usr suggest the following:

Catalogue File contents should be placed
Part I: FHS requirements must exist in the catalogue
/usr/bin/ All the instructions that the general user can use are placed here! The new CentOS 7 now has all of the user instructions placed here, and the/bin is connected using a link! That is to say,/usr/bin and/bin are a model! In addition, FHS requirements in this catalogue should not have subdirectories!
/usr/lib/ Basically, the/lib function is the same, so the/lib is connected to this catalogue!
/usr/local/ The system administrator installed its own software (non-distribution), which is installed on the machine itself, and is designed to be installed in this catalogue, which is more manageable. For example, your distribution provides a newer version of the software and you want to install a new one, but you don't want to remove the old one, so you can install the new version of the software on the/usr/local/, and you can differentiate it from the original old version of the software! You can go to the/usr/local yourself to see, the record is also with bin, etc, include, Lib ... 's Sub-catalogue!
/usr/sbin/ The system command required for non-system operation. The most common is the service instructions (daemon) of some Web server Software! The basic functions and/sbin are similar, so the current/sbin is connected to this record.
/usr/share/ The main place is to read the structure of the information files, of course, including the sharing of documents. The information that is placed in this record is almost always readable by the hard structure, because it is almost a text file! " Here are some of the things you'll see in this catalogue:
  • /usr/share/man: the online documentation
  • /usr/share/doc: Software miscellaneous documents that explain
  • /usr/share/zoneinfo: Time Zone Archives
Part II: FHS The list of possible existing items
/usr/games/ The information that is relative to the game
/usr/include/ The file header and the include file (include) of the C + + and other programming languages will be used when we install certain information in the Tarball Way (*.tar.gz), and we will use many of the files that are included in it!
/usr/libexec/ Some of the files or script that are not used by ordinary users are placed in this catalogue. For example, most of the operation instructions under the X window are placed under this catalogue.
/usr/lib<qual>/ Is the same as the/lib<qual>/function, so the current/lib<qual> is connected to this catalogue
/usr/src/ General source code suggestions are placed here, SRC has the meaning of source. The core code is proposed to be placed under the/usr/src/linux/catalogue.
    • The meaning and content of/var:

If/usr is an installation that occupies a larger hard disk, then/VAR is the system that will gradually take up the capacity of the disk. This is because the/var record is primarily a file for regular changes, including the cache, the log file, and some software files, including the file (lock file, run file), or, for example, the MySQL archive file, and so on. Frequently seen sub-entries are:

Catalogue File contents should be placed
Part I: FHS requirements must exist in the catalogue
/var/cache/ The application itself is used as a staging file that will be produced in the process;
/var/lib/ In the process of the program itself, you need to use the information files placed in the record. The respective software should have their own records under this catalogue. For example, MySQL's repository is placed in the/var/lib/mysql/and RPM repositories to/var/lib/rpm!
/var/lock/ Some devices or files can only be used by one application at a time, and if there are two programs that use the device, it is possible to produce some bugs, so it is necessary to lock the device to ensure that the device is only used by a single software. For example, the camera is burning a disc, and you think about it, there will not be two people using a burning machine at the same time? If two people burn records at the same time, who does that film write to? So when the first person is burning the machine will be locked and the second person will have to be unlocked (that is, the previous person ran out) to continue using it. The current catalogue has also been moved to/run/lock!
/var/log/ Important To Not! This is the record placed by the login! More important files such as/var/log/messages,/var/log/wtmp (records logged in), etc.
/var/mail/ Place a personal email address, but this record is also placed in the/var/spool/mail/catalogue! Usually these two entries are connected to each other!
/var/run/ After some programs or services are initiated, their PID will be placed in this catalogue! As to the meaning of the PID, we will refer to it in the subsequent chapters. As with the/run, this recording is linked to the/run!
/var/spool/ This record usually places some nin information, so called "nin column" is the queue waiting for other programs to use the material! These materials are usually erased after they are used. For example, the system receives a new letter and is placed in the/var/spool/mail/, but the letter will be erased after the user has received the letter. If a letter is temporarily sent, it will be placed in the/var/spool/mqueue/and deleted after being sent out. If it is work scheduling information (crontab), it will be placed in the/var/spool/cron/catalogue!

It is suggested that after you read the entire foundation, you can challenge the official English document of FHS (for reference in this chapter) and believe that you will have a better understanding of the Linux operating system.

    • The FHS, the distributions of each family, and the change of CentOS7

Since FHS is only defining the files or records that should be placed on the top (/) and sub-level (/usr,/var) records, it is possible to configure it on its own in other sub-categories. For example, the CentOS network settings are in/etc/sysconfig/network-scripts/, but SuSE is placing the web in the/etc/sysconfig/network/, which is different from the name of the catalog! Just remember the general FHS standard, the difference is actually limited!

In addition, CentOS 7 is different from the previous version in the catalogue. This episode has been introduced a little earlier, and it's done here. The bigger difference is that many of the items that should have been recorded in the root record (/) will be moved to/usr in all of his internal information, and then the connection is set! This includes the bottom:

    • /bin-/usr/bin
    • /sbin-/usr/sbin
    • /lib-/usr/lib
    • /LIB64-/usr/lib64
    • /var/lock-/run/lock
    • /var/run-/run

The first character represents this file as "records , files or links, etc.":

      • When [ D] is a record, for example, the row of the previous table named ". config";
      • When [ -] is a file, such as the one on the table named "Initial-setup-ks.cfg";
      • If [ l] is said to be connected (link file);
      • If [ b] is indicated as the storage perimeter of the device (optional access to the device);
      • If [ c] is indicated as a serial port device, such as a keyboard, a mouse (one-time reader).

Note: This is a private dish of CP from Bird Brother.

[[email protected "desktop]$ ls-l/dev|grep cdrom
L rwxrwxrwx. 1 root root           3 jan  6 04:34 cdrom sr0
c rw-rw----. 1 root cdrom    21,   1 jan  6 04:34 SG1
b RW-RW----+ 1 root cdrom    11,   0 jan  6 04:34 sr0
Again, this command shows the following: Well, we understand, CDROM is a connection to the Sr0 file name

[[email protected "dev]# mount/dev/sr0/mnt/sr0
Mount:mount point/mnt/sr0 does not exist
[[email protected] dev]# mount/dev/sr0/mnt/
Mount:block device/dev/sr0 is write-protected, M ounting read-only
[[email protected] dev]# mount-t ext3 /dev/sr0/mnt/
Mount:block Device/dev/sr0 is W rite-protected, mounting read-only
Mount:/dev/sr0 already mounted or/mnt/busy
mount:according to mTAB,/dev/sr0 is already mounted on/mnt
I must give it a try, it's true. Classmate, Sr0 is the real optical drive, in order to confirm my understanding. Let's remove the mount first, and then mount it again to see if it was successful.

[[email protected "mnt]# umount/mnt ---" This sentence, I found that my/mnt directory did not Oh, tragedy ...
Umount:/mnt:device is busy.
        (in some cases useful info about processes this use
          the device is found by lsof (8) or fuser (1))
[[email protected] mnt]# eject< Br>^[[a^[[a[[email protected]

[Email protected]/]# mkdir mnt
[[Email protected]/]# CD MNT
[Email protected] mnt]# mkdir CDROM
[[Email protected] mnt]# CD/
[Email protected]/]# mount-t Ext3/dev/sr0/mnt/cdrom
Mount:block Device/dev/sr0 is write-protected, mounting read-only
Mount:wrong fs type, bad option, bad Superblock on/dev/sr0,
Missing codepage or helper program, or other error
In some cases useful info are found in Syslog-try
DMESG | Tail or so
Success, thank you Niang at the same time, also want to know why.

cen0s mount device under load

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.