Explanation of partition mounts in Linux

Source: Internet
Author: User

People who have studied Linux may feel very complicated about the Linux partition at the beginning, because they are accustomed to the simple and straightforward way to express the C,d,e,f,g disk in Windows, in fact, the partition of Linux is difficult to understand, but after figuring out its partition deconstruction, it is very well understood, And this zoning system is also more flexible and useful.

I. Definition of partition under Linux

we all know that a new hard drive after the purchase is not directly used, we need to partition him, this is the same for Windows and Linux, then why to partition the hard disk, first of all, if you put all the files on the current hard disk, which is placed in a partition, Then the operating system will be very inefficient, because there are too many things to look for when running a command, and the partitioning can also enhance the security of the system, says James Tobin, an American economist who said: "Don't put all your eggs in one basket." "That's the truth, if we put all the files in one partition, then when the system asks

questions need when we reload or format the file system, our data is lost, and if we partition it, we can

to avoid the occurrence of this situation. Finally, the service life of the disk is limited, if we have only one partition, then the sub -

The reading of the District writing will be frequent, thus speeding up the loss of the disk. In summary, hard disk partitioning is necessary.

Now that we know why we're partitioning, let's talk about the definition of partition under Linux, the main boot sector of a hard drive = hard disk master boot record (MBR) + hard disk partition table (DPT), total 512 bytes, where MBR is 446, partition table altogether 6 4 bytes, followed by a 2-byte end flag. The partition table is 64 bytes in total, and a partition occupies 16 bytes, which is a maximum of 4 primary partitions. There are also three types of partitions, primary partitions, extended partitions, and logical partitions, where the operating system can be installed on the primary partition, the system-initiated up to 23 more logical partition where each partition is assigned a separate drive letter that can be used by the computer as a separate physical device. The following diagram shows the structure of the Linux partition more clearly.

650) this.width=650, explanation of file system and partition mount in "alt=" Linux-M1 3526593315-m13526593315 's Blog "src=" Http://img0.ph.126.net/_36FDIqEx3aj21NPr8R-FQ==/6632275029468476559.jpg "style= "line-height:28px;border:0px;height:auto;margin:0px 10px 0px 0px;"/>

so how to view our partition information, such as enter fdisk-l on the command line, and then enter, there will be the following effect, we line-by-row to analyze.

650) this.width=650; explanation of file system and partition mount in "alt=" Linux-m13526593315-m13526593315 's blog "src=" http://img1.ph.126.net/ Slvecvavmrnrzxykatweiq==/6632433359142873307.png "style=" line-height:28px;border:0px;height:auto;margin:0px 10px 0px 0px; "/>

        First, the first line refers to the total size of the hard disk, Can see that my hard drive is 214.7G, that is, the back of the 241748364800 bytes. The second line of heads represents the head, which is 63 Sectors/track, which indicates that there are 63 sectors on each track, 26108cylinders is the meaning of 26,108 cylinders. How many bytes does a sector have, looking at the third row, you can see a sector with 512 bytes, then the total size of our hard disk is                                                ,         &N Bsp;heads*sectors/track*cylinders*512=214745610240bytes, there's wood. This number of bytes is not the same as the number of bytes in the first row, which is related to the structure of the disk, as you can see, The number of sectors of the disk outer ring and the inner ring of the disk is the same, but the disk outer ring of the track is obviously larger, but they are the same 512b, which creates a waste of resources, so now in the design of the disk, the outer ring will increase the number of sectors, In this case, the results of our algorithm will be calculated to be smaller than the actual.

650) this.width=650; explanation of file system and partition mount in "alt=" Linux-m13526593315-m13526593315 's blog "src=" http://img 2.ph.126.net/crgqr4ppolzs-q8prxdkzq==/6632612579538227972.png "style=" Line-height:28px;border:0px;height:auto; margin:0px 10px 0px 0px; "/>

 Fifth sixth seventh line is the main partition of our system, and the eighth row is the extension (extend) partition, the Nineth line is the swap partition, the front/dev/sda1,2,3,4,5, respectively, like WinDOS under the CDEFG disk, dev represents this disk, he behind the/ On behalf of this disk, the SD represents the type of disk, and my disk here isSCSI hard disk so is SDA, if it is the IDE disk is HD, SD after the A represents the disk number, if there are other SDB,SDC, Then we should know that a is the basic disk, B is the basic slave disk, C is auxiliary main disk, D is auxiliary slave disk, I this disk only divided the basic disk, so it is SDA, and SDA behind the 12345 represents the partition number, I here 123 is the primary partition, 4 is the extended partition, 5 is the swap partition. Here to mention a concept, swap partition (swap), swap A partition is a virtual memory partition under Linux, which is used when the physical memory is exhausted and the disk space is virtual into memory.Swap partitionthe reasonable value generally in the memory of about twice times, can be appropriately increased. In fact, the actual application of the subject, swap for memory of twice times is just a baseless assertion argument.

Introduced some concepts of partitioning below we look at how to partition a disk, of course, when installing Linux can also be partitioned, but in the future use, it is inevitable to do some zoning to adapt to the needs of the work environment. Before partitioning, we should use the hair fdisk-l to see if the partition is full, I'm already full here but in order to show that I need to delete my third partition, the input fdisk-l can be seen as follows, you can see that there is no third partition.

650) this.width=650; explanation of partition mount in "alt=" Linux-m13526593315-m13526593315 's blog "src=" http://img2.ph.126.net/ G3mamjz7d3kzjfbk9kxbvw==/6632294820677778656.png "style=" line-height:28px;border:0px;height:auto;margin:0px 10px 0px 0px; "/>

& nbsp         Then we can for Linux partitioning, the command used is FDISK/DEV/SDA (HDA), and after entering this instruction we can see the following

650) this.width=650; explanation of partition mount in "alt=" Linux-m13526593315-m13526593315 's blog "src=" Http://img2.ph.126.net/asaN Gb-7tlmp7cycsfyiaw==/6632729127768149399.png "style=" line-height:28px;border:0px;height:auto;margin:0px 10px 0px 0px; "/>
In the upper left corner of the warning below the right of the first command prompts us to enter M to see the Help option, which I have

Input m, you can see, there are a lot of options, we enter N (add a new partition) to separate a partition, input

Following tips

650) this.width=650; explanation of partition mount in "alt=" Linux-m13526593315-m13526593315 's blog "src=" http://img1.ph.126.net/ Wp4r9j30xllbqpkymkixja==/1275363119494063852.png "style=" line-height:28px;border:0px;height:auto;margin:0px 10px 0px 0px; "/>

after you can see the input n, the following command action is the option to select the partition type, I have logical and

Primary two options, the logical partition and the primary partition, because I already have the extended partition, and as we said above,

Logical partitioning is only possible if the extended partition already exists, so if I don't have an extended partition, the logical partition here

Select logical will become extend that is the extended partition option, OK, let's enter p to select the primary partition, then the arrow 2 means

Place, prompting us to enter the partition number, here the system automatically entered for me 3, this is because I have 12 of the primary partition and 4 of the extension

Partition, if everyone is a new disk, then you can select the partition number, enter 3 back to the car, you will see the Arrow 3 refers to the ground

Square, which prompts us to select the cylinder to begin with, which is usually the default, so it's just a carriage return and you'll see

The system prompts using the default value 6553, which is to use the defaults for start cylinder 6553, if everyone is a new disk, then

The default is definitely starting from 0, then, we are prompted to delimit the size of this partition, and can use the k,m,g such a single

bit, format + then the specific number then the unit (remember capitalization), such as +2g, I still choose the default option here, that is, I am

The area to be divided, the rest of the space will be used, that is, the arrow 4 refers to the place, enter the return, we have completed the partition,

However, it is not effective, and then input w is the arrow 5 refers to the place to save, enter after the automatic exit partition command, then we use

Fdisk-l to view the current partition, as follows

650) this.width=650; explanation of partition mount in "alt=" Linux-m13526593315-m13526593315 's blog "src=" http://img1.ph.126.net/ Y6nbisio0wzvhjppiqlmaw==/6632350895770789645.png "style=" line-height:28px;border:0px;height:auto;margin:0px 10px 0px 0px; "/>

As you can see, a new SDA3 partition has been added.

However, this is not the end, we have to format it to use it, enter the following command, and then wait for the Inode table to finish writing.

Next we'll be able to use the area we just divided.

two. Mounting

What is Mount, in Linux , without the concept of a drive letter, we use the form of directory management, each partition and a directory corresponding to the then, our operation on this directory is the operation of this partition, so that the hardware management means and software directory management means of unification, the partition and directory corresponding to the process is called mount, that is,-mount, mount can be interrupted and changed by the user at any time, The commonly used mount commands are mount and Umount, that is, mount and release mounts, such as UMOUNT/DEV/SDA is to release the SDA Mount, and Mount /dev/sda/app is to mount SDA to the app directory.


Explanation of partition mounts in Linux

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.