Linux study Notes-Introduction to the Linux system

Source: Internet
Author: User
Linux Study Notes & mdash; introduction to the Linux system abstract: it mainly records some useful Linux study Notes-Introduction to the Linux system

Abstract: It mainly records some useful knowledge that can help you understand and use Linux, such as some related concepts, just look at it if you are not interested, and know that there is such a thing. Note, and the role of some common directories, as well as the very important startup sequence.

I. file system knowledge supplement

A file system is a mechanism used to provide users with underlying data access. It divides the space in the device into blocks (slices) of a specific size, typically 512 bytes each. Data is stored in these blocks, and the size is corrected to occupy an integer. The file system software organizes these blocks into files and directories, and records which blocks are allocated to which files and which blocks are not used.

However, the file system does not necessarily appear only on a specific storage device. It is the organizer and provider of data. as for its underlying layer, it can be a disk or another device that dynamically generates data (such as a network device ).

Many file systems are classified,

Disk file system

A disk file system is a file system designed to store computer files using data storage devices. The most common data storage device is a disk drive, which can be directly or indirectly connected to a computer. Example: FAT, exFAT, NTFS, HFS, HFS +, ext2, ext3, ext4, ODS-5, btrfs. Some file systems are process file systems (also known as log file systems) or tracing file systems.

CD

ISO 9660 and UDF are used for CD, DVD, and Blu-ray discs.

Flash file system

A flash file system is a file system designed to store files on Flash. With the popularization of mobile devices and the increase of flash capacity, such file systems are becoming increasingly popular.

Database File system

A new concept in file management is a database-based file system concept. No longer (or more) uses hierarchical structure management. files are differentiated by their features, such as file types, topics, authors, or sub-data. Therefore, file retrieval can be performed in the SQL or even natural language style.

For example, BFS and WinFS.

Network File System

Network File System (NFS) is a mechanism to mount the partitions (directories) on the remote host to the local System through the network.

In Linux, all devices, all files, and everything you know are files! There are two types of files in his opinion: one is character type and the other is binary form. In his opinion, the keyboard is a character device, a printer is also a character device, a hard disk, and a USB flash drive is a block device, which means reading data one by one. Linux manages everything in the form of files and programming is simple. Only programming for file systems. It provides a virtual file system (VFS) -- javasurlfilesystem. It can read and write to different file systems. the advantage is that it simplifies programming and is similar to Java's cross-platform architecture? Provides unified interfaces that can run on different platforms.

With the development of Linux, the supported file format systems are also expanding rapidly. the Linux system core can support more than 10 file system types: btrfs, JFS, ReiserFS, ext, ext2, ext3, ext4, ISO9660, XFS, Minx, MSDOS, UMSDOS, VFAT, NTFS, HPFS, NFS, SMB, SysV, PROC, etc.

II. hard disk Overview 1. hard disk physical composition

As far as physical components of the hard disk are concerned, the hard disk is actually composed of many circular hard disk disks. based on the data volume that the hard disk can accommodate, the so-called single disk (one hard disk contains only one hard disk) or multiple disks (one hard disk contains multiple hard disks.

There is a head in the hard disk to read and write on the hard disk, and the head is fixed on the arm of the manipulator. there are multiple heads on the arm to read. When the head is not fixed (assuming the mechanical arm is moving), the circle drawn by the hard disk turns around is the track ). The same track on two hard disks is a cylindrical disk. This cylindrical disk is the smallest unit in Partitioning. it draws a straight line from the center of the circle and can be subdivided into sectors, the slice is the smallest storage physical quantity on the disk. Generally, the size of a slice is about 512 bytes. These are the basic components of the entire hard disk.

2. hard disk interface

The hard disk interface is the connection component between the hard disk and the host system. it is used to transmit data between the hard disk cache and the host memory. Different hard disk interfaces determine the connection speed between the hard disk and the computer. in the whole system, the advantages and disadvantages of hard disk interfaces directly affect the program running speed and system performance. From an overall perspective, hard disk interfaces are divided into four types: IDE, SATA, SCSI, and fiber-optic channels. IDE interface hard disks are mostly used in household products and also partly used on servers, SCSI interface hard disks are mainly used in the server market, while fiber channel is only used on high-end servers, which is expensive. SATA is a new type of hard disk interface. it is still gaining popularity in the home market and has broad prospects. Under the large categories of IDE and SCSI, you can separate multiple specific interface types and have different technical specifications and different transmission speeds, such as ATA100 and SATA; both Ultra160SCSI and Ultra320SCSI represent a specific hard disk interface, and their respective speeds vary greatly.

IDE

IDE is called "IntegratedDriveElectronics" in English, that is, "electronic integrated drive". it is intended to be a hard drive that integrates the "hard drive controller" with the "disk body. The integration of the disk and controller reduces the number and length of cables on the hard disk interface, enhances the reliability of data transmission, and makes it easier to manufacture the hard disk, hard disk manufacturers do not need to worry about whether their hard disks are compatible with controllers produced by other manufacturers. It is more convenient for users to install hard disks. Since its birth, IDE has been continuously developing and its performance has been continuously improved. it features low price and strong compatibility, this makes it an irreplaceable position for other types of hard disks.

SCSI

SCSI is called "SmallComputerSystem Interface" (a Small Computer System Interface). It is a completely different Interface from IDE (ATA), and IDE Interface is a standard Interface of ordinary PCs, SCSI is not an interface specially designed for hard disks, but a high-speed data transmission technology widely used on minicomputers. The SCSI interface has the advantages of wide application range, multi-task, high bandwidth, low CPU usage, and hot swapping. However, the high price makes it difficult to popularize like an IDE hard disk, therefore, SCSI hard disks are mainly used in medium and high-end servers and high-end workstations.

3. MBR (Master bootRecord)

MBR is located at the first physical sector (absolute sector) cylindrical 0, Head 0, Sector 1, MBR contains the hard disk's main boot program and hard disk partition table. Is the most important part of a disk. if this part breaks down, the entire disk will be decommissioned.

4. Linux disk naming rules

Naming rules --/dev/xxyN:

1. a directory for all hardware devices under Linux is/dev (devices)

2. Linux does not have a C drive, a D drive, or a directory on the Linux Root/

3./dev/-- The directory name of all device files. Because the partition is on the hard disk and the hard disk is a device, all these files represent all possible partitions on/dev.

4. xx -- the first two letters of the partition name indicate the device type of the partition. Usually hd (IDE disk) or sd (SCSI disk ).

5. y: indicates the device where the partition is located, for example,/dev/hda (first IDE disk) or/dev/sdb (second SCSI disk)

6. N -- the last number indicates the partition. First four partitions (primary partition or extended partition) use numbers 1 to 4 to indicate that logical partitions always start from 5. for example,/dev/hda3 is the third primary partition on the first IDE hard disk.

III. Linux directory structure

1./Linux file system entry, which is also the directory at the highest level

2. the commands required by the/bin basic system are located in this directory and are also required by the minimum system, such as ls, cp, and mkdir; similar to/usr/bin, files in this directory are executable and common users can use commands. The most basic command required by the basic system is put here.

3. files required for/boot Linux kernel and boot system programs, such as vmlinuzinitrd. all imgfiles are in this directory, and in general, GRUB or LILO system boot manager is also in this directory.

4./dev device file storage directories, such as sound cards and disks...

5. the location of the/etc system configuration file and some server configuration files are also located here, such as the user account and password configuration files.

6./home ordinary user's home directory is stored by default

7./lib library file storage directory.

4. Linux startup process:

1. loadbios (hardwareinforamtion) -- Power-on self-check.

2. readMBR 'sconfig to find out the OS (operation system) -- read the configuration and find the startup system

3. loadthekernel of the OS-load the system core

4. initprocessstarts... -- initialize the startup program

5. extcute/etc/rc. d/sysinit -- run sysinit under/etc/rc. d. Rc -- runcommand, d -- demon

6. startothermodules (etc/modules. conf)-Start other modules, such as hard disk modules and optical drive modules.

7. executetherun level scripts -- execute the startup level script

8. execute/etc/rc. d/rc. local -- very important. for example, you need to enable a program automatically.

9. execute/bin/login -- logon interface,

10. startshell: the logon is successful and the shell is started.

Supplement:

Run level:

Init n;

0 -- system shutdown status

1 -- single-user working status

2-multi-user status (without NFS, you cannot connect to others)

3 -- multi-user status (with NFS)

4-the system is not used and left to users

5-graphic interface

6 -- the system is shut down normally and restarted

Note: There is no relationship between each level. for example, you can start the third level separately, or you can change the default startup level.

V. Linux startup and shutdown command:

Exit

Shutdown

Reboot restart

Logout

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.