Liu Da's Linux handout-basics (1) disk and File System

Source: Internet
Author: User

Liu big Linux handouts-basics from Liu big csdn blog, reprinted please indicate the original link: http://blog.csdn.net/poechant/article/details/7214926

I. Disk knowledge

1. physical disk structure

(1) structure:

Physically, a disk has multiple disks. Each disk has many tracks based on its radius ). The magnetic track with the same radius on different disks is logically called cylinder ). A region in an arc of a track, called a sector ). The size of each slice is 512 bytes.

(2) capacity:

The formula is:

Disk capacity = 512 bytes X number of sectors per Track X number of CIOs X number of cylinders

Disk capacity = 512 bytes X number of sectors per Track X number of disks X number of tracks per Disk

Note: The number of cores = the number of disks, and the number of cylinders = the number of tracks for each disk.

2. Disk partitioning

(1) structure:

A disk is a partition from a starting cylinder of the outer layer to an ending cylinder of the inner layer ).

(2) MBR:

Master Boot recorder is the first cylindrical disk and records the partition information of the entire disk. After the disk is started, read data from the MBR. If the MBR of a disk is broken, the entire disk will be deprecated.

(3) MBR restrictions:

After all, the MBR is limited in size and cannot store information of any number of partitions. Therefore, MBR restricts the storage of only four partitions. Up to one extended partition can exist in the four partitions. Therefore, the disk partition result must be: X primary partitions + y extended partitions, and X + Y <= 4, Y <= 1. If there is still space available after you divide four partitions, these spaces cannot be used. If you divide one, two, or three partitions, and there is still space available, the space will be divided into three, two or one primary partition.

3. Logical Disk Structure

(1) structure:

The logical structure of a disk is determined by the operating system. The minimum physical storage unit of a disk is 512 bytes. However, the minimum logical storage unit of a disk can be specified by the operating system, which is called a block ), the size is 4 kb (eight sectors ). A block can only store one file at most. Therefore, the block setting must be moderate, which is too large to waste space and reduces efficiency.

(2) superblock:

The block at the starting position of each partition stores information about the partition, including the total number of partitions, the total number of idle blocks, the total number of non-idle blocks, and the status information ing table of all blocks. When reading and writing data in a partition, the superblock of the partition is read first. If the superblock of a partition is broken, the entire partition will be discarded (but it will not affect other partitions ).

4. file read/write process

Read the MBR of the entire disk, obtain information about all partitions, and determine the partition of the operating system file to be loaded. Then, when reading a partition, first read the superblock of the partition, and then find the corresponding block (possibly multiple) for reading.

Ii. File System

1. File System Concepts

A file system (or filesystem) is the data transmission and management layer between a hardware storage device and an operating system. Just as the client provides data communication with the network, the file system provides communication between the operating system or between the user and the hardware storage device. In many cases, the file system and the operating system are not so clear, but a whole. All types of storage devices have file systems, such as hard disk, floppy disks, optical disks, and Flash memory ).

2. File System classification

Disk File System)

Flash filesystem)

Tape File System (Tape filesystem)

Database File System)

Transaction File System (transactional filesystem)

Network filesystem)

Shared Disk File System)

Flat filesystem)

3. Linux File System

Ext2, 2nd extended filesystem, released on 1993.

Ext3, 3rd extended filesystem, released on 2001.

Ext4, 4th extended filesystem, released on 2008.

XFS, extended filesystem, released in 1994.

JSF, jounaled, 1990 released jfs1 on AIX 3.1, 1999 released JFS on OS/2 4.5.

Reiserfs, Reiser file system, released in 2001.

Btrfs, B-tree file system, 2009 unstable version, stable version has not yet been released.

4. Linux system disk and Partition Number

(1) disk number:/dev/hda,/dev/HDB,/dev/HDC indicates the local hard disk. /Dev/SDA,/dev/SDB, And/dev/SDC indicate external removable hard disks.

(2) Partition Number:/dev/hda1,/dev/hda2,/dev/hdc1 indicates the partition of the local hard disk. /Dev/sda1,/dev/sdc2 indicates the partition of the external hard disk.

Liu big Linux Travel Notes-basics from Liu big csdn blog, reprinted please indicate the original link: http://blog.csdn.net/poechant/article/details/7214926

-

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.