Partitions and file systems in Linux

Source: Internet
Author: User
Tags ide hard drive

Partitions and file systems in Linux

1. file names of each Hardware Device in Linux

1. File Name of the IDE Hard Drive in Linux:/dev/hd [a-d] (a-d is exactly four. This is the reason for the following)

Explanation: for IDE interfaces, since an IDE flat cable can be connected to two IDE devices and the host usually provides two IDE interfaces, a maximum of four IDE devices can be connected. That is to say, if you already have a CD device, you can just upload a disk with three more IDE interfaces. These two IDE interfaces are usually called IDE1 (primary) and IDE2 (secondary), and the IDE Device on each flat cable can be divided into Master and Slave

The names of the four IDE devices are:

IDE1 (Primary)/dev/hda/dev/hdb

IDE2 (Secondary)/dev/hdc/dev/hdd

2. The file name of the SCSI/SATA/USB hard drive in linux is/dev/sd [a-p], and a-p is the same, however, SATA is ordered only by the Order detected by the system. For example, if there are four disks, then, it is possible to perform/dev/sda/dev/sdb/dev/sdc/dev/sdd in the order detected by the disk,

Ii. Composition of disks

1. A disk includes a disk, a mechanical arm, a disk reading header, and a spindle motor. Data is actually written to the disk. the disk surface can be subdivided into sectors (sectory) cylinder (cylinder). The size of one slice is 512 bytes.

2. There is a special sector on the disk's magnetic surface, that is, the first sector, especially because it records two information:

(1) disk split table, that is, information about the split of your disk. For example, the size of the ending disk is 64 bytes.

(2) MBR (master boot record) is the main boot guide area. The local size of the hypervisor can be 446 bytes.

3. Disk Partition Table: we know that the magnetic column is the smallest unit of the split slot, while the 64 bytes table is stored in the first sector, which is divided into four groups, the start and end column numbers of each group are recorded.

4. Since the split table only has 64 bytes, the limit can accommodate up to four split records. These four split records are called the Primary or Extended split slots.

5. (1) In fact, the so-called "split" is only for the 64-bytes split table!

(2) The default hard disk partition table can only write four groups of partition information

(3) The four groups of split information are called the Primary or Extended split slots.

(4) the smallest unit of the split slot is cylinder)

(5) When the system needs to write data to the disk, it must refer to the disk partition table to process data in a partition slot!

6. A disk can contain up to four primary partitions or three primary partitions and one extended partition, but only one extension partition can be used. This is a system limitation, the maximum number of primary and extended partitions is four, which is a disk limitation.

7. Extended partitions cannot be formatted, while logical partitions are formatted by extended cells !, That is to say, if the extension split slot is broken, the data in all the logical split slots will be damaged!

Iii. concepts related to the directory tree of Mount Points mounted to the disk file system in Linux and Their Relationships

1. There is nothing to say about a disk, that is, a hard disk or other storage devices.

2. File System: What is a file system?

(1) The file system is the method and data structure used by the operating system to identify files on disks or partitions; that is, the method to organize files on disks. It also refers to the disk or partition used to store files, or the type of file system. Therefore, it can be said that "I have two file systems" means that he has two partitions, one storage file, or he uses "extended File System", which means the types of file systems.

(2) The difference between a disk or partition and the file system it includes is very important. A few programs (including the program that generates the file system for the most reason) directly operate on the disk or the original sector of the partition; this may damage an existing file system. Most programs operate on file systems and cannot work on different file systems.

(3) Before a partition or disk can be used as a file system, you must initialize it and write the record data structure to the disk. This process is called creating a file system.

(4) Most UNIX file system types have similar general structures, even if some details change. Its central concept is superblock, I node inode, data block, directory block, and indirect block indirection block. A super block includes the overall information of the file system, such as the size (the exact information depends on the file system ). The I node contains all information about a file except the name. The name and the number of I nodes exist in the directory. The directory entries include the file name and the number of I nodes of the file. The I node contains the number of data blocks used to store file data. I nodes only have a small number of data blocks. If more data blocks are required, the pointer space directed to the data blocks is dynamically allocated. These dynamically allocated blocks are indirect blocks. in order to locate the data blocks, this name indicates that it must first find the numbers of the indirect blocks.

3. Mount: A directory is used as the entry point to store the data in the partition slot of the disk. That is to say, enter the directory to read the meaning of the split slot. This action is called mounting;

4. mount point: the directory of the entry point is called a mount point;

5. directory tree: in linux, the directory is displayed in the tree structure, so it is called the directory tree;

6. In the directory tree, the root directory is the root directory, which must be mounted to a split slot, and some directories under it can be mounted as needed, you can also choose not to mount it, because the root directory has been mounted. If you do not mount it, it is the same split slot as the root directory by default!

7. Soft mount is implemented through the mount command.

Makefile Analysis of Btrfs in Linux File System

Kconfig Analysis of Btrfs in Linux File System

Application of Btrfs File System in CentOS

This article permanently updates the link address:

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.