Basic linux knowledge

Source: Internet
Author: User

Hard Disk
Hard Disks are media that can store a large amount of information resources. We usually see that the hard disk is a very heavy iron, but in fact the hard disk is round, with some control circuit, in order to facilitate the carrying and design into a square shell. But the hard disk is really round, don't lie to you, or how is it called a disk? Second, you need to know that the hard disk can be partitioned. You can make a hard disk partition into multiple partitions. It seems that a partition is a ranking and a verb. What is a ranking partition? Nowadays, hard disks are getting larger and more resources are stored. To manage and use hard disk resources more effectively and improve query speed and access quality, we can divide the hard disk into many partitions and store some information separately. When you need to read a certain piece of data, the system will automatically use the nearest head to read the data to speed up reading. Hard Disk partitioning is a means of rationally managing resources based on hardware.
Partitions are already known, but we cannot only have partitions. We have to use a method to control partitions. In Windows, the drive letter concept is used. A single letter is used to represent different partitions on the hard disk, such as drive C and drive D. Before Windows2000, drive C corresponds to the first partition, drive D corresponds to the second partition, and so on. In Winows2000, you can adjust the corresponding relationship.
In Linux, we do not have the concept of drive letters. We manage them in the form of directories.
To ensure the integrity of the article, let's simply talk about the contents. In fact, everyone knows. Is it hard to find tens of thousands of fruits in a basket? However, if we put an apple in a basket called an apple, and put it in a basket called a pear ...... Does this greatly simplify our search for specific fruits? If these fruits are our files, the baskets we use are called directories. A new problem occurs. Even if we put peaches in a basket called Peaches, it is still difficult to find peaches from thousands of peaches in longquanyi, Chengdu, Sichuan province. If you are smart, you must think of putting a lot of peaches in the baskets called Sichuan, Hebei, and Guangzhou, and putting peaches from different origins. Yes! That's it! We can create a new file directory under a file directory to manage the files very carefully. Here you understand what is called a directory, and you can also understand that a directory can be nested. Directory technology manages resources based on software.
Return to Linux's hard disk management: in Linux, we do not have the concept of drive letters. We manage them in the form of directories. Maps each partition to a directory. In the future, operations on this directory will be performed on this partition. In this way, hardware management methods and software Directory management methods will be unified. The process of attaching a partition to a directory is called mount. This relationship can be interrupted and changed by the user at any time.

SWAP Partition
You are familiar with partition knowledge. here we need to mention swap partition. If we do not have enough memory, we may not be able to run some large software. The solution is to draw an area on the hard disk as a temporary memory, as if the memory has become larger. In Windows, this region is called virtual memory, and in Linux it is called swap. Although the memory is no longer limited as the hardware price drops, the concept of swap partition is retained, and there are reasons for continuing to keep it, of course, it involves kernel issues, we will not discuss it much. It should be noted that when you create swap partitions in Linux, if your memory is only 64 MB or 128 MB, it is best to set swap partitions to three times of it, if your partition is large enough with 512 M or M, set it to the same size. But please note that it is best to have a number of N power numbers of 2.

Partition format
Today I have talked about a lot of hard disk-related issues. Now I want to add a partition format. The hard disk is just a medium for recording information in electromagnetic mode. We can manage it in different formats. Different operating systems use different formats. The same operating system may also support multiple formats. Microsoft's operating system uses the fat16 format as the DOS partition format. Later, windows95 and windows98 support the fat32 format. windowsNT uses the NTFS4 format. windows2000 and XP support the NTFS5 format and fat32 format, however, they do not support common partition formats in Linux. Linux is an open operating system. It initially uses the ext2 format and later uses the ext3 format, but it also supports a lot of partition formats, including XFS format used by UNIX on the mainframe, it also includes the fat and NTFS formats of Microsoft.
When partitioning a hard disk, you must specify the partition format.

Understanding the directory structure of Linux

Since directories are used to facilitate file management, what types of files are stored in different directories in Linux?

Directory Name meaning

/Bin: Common commands used to store Linux in this directory. In some versions, the commands are the same as those in the root directory.
/Boot this directory stores all the programs used during system startup. some information here will be used when lilo is used to guide Linux.
/Dev this directory contains all external devices used in Linux. It is actually the port used to access these external devices. You can access these external devices, it is no different from accessing a file or directory. For example, if you type "cd/dev/cdrom" in the system, you can see the files in the optical drive. If you type "cd/dev/mouse", you can see the files related to the mouse.
/Cdrom the directory is empty when the system is just installed. You can mount the optical drive file system to this directory, for example, "mount/dev/cdrom"
/Etc This directory stores various configuration files and sub-directories used for system management, such as network configuration files, file systems, X system configuration files, device configuration information, and set user information.
/Sbin this directory is used to store system management programs of the system administrator.
/Home if you create a user named "xx", there is a corresponding "/home/xx" path under the/home directory to store the user's home directory.
/Lib This directory is used to store the shared libraries dynamically connected by the system. Almost all applications will use the shared libraries in this directory.
/Lost + found this directory is empty in most cases. However, some files are temporarily stored here after a sudden power failure or abnormal shutdown.
/Mnt this directory is usually empty. You can temporarily mount another file system to this directory.
/Proc can obtain system information in this directory, which is generated by the system itself in the memory.
/Root if you log on as a Super User, this is the main directory of the Super User.
/Tmp is used to store temporary files generated during execution of different programs
/Many usr applications and files are stored in this directory.

Hardware supported by Linux
In general, there are three sentences for Linux's hardware support: the more new hardware is, the more difficult it is to support, the more difficult it is to support products of smaller manufacturers, and more hardware is supported!
Therefore, we recommend that you use mature products from famous manufacturers.

In the next chapter, we will introduce how to install Linux. The Linux release we selected is Redhat Linux 7.3. Before installation, please familiarize yourself with the hard disk partition knowledge we have introduced.

Author: birds"

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.