Ext2 file system hard disk Layout

Source: Internet
Author: User


This article describes the detailed layout of the popular ext2 File System on hard disk partitions in Linux. The next version supported by the ext2 file system and logs is the ext3 file system, which is the same as the ext2 File System in the hard disk layout, the difference is that the ext3 file system has a special ino de (which can be understood as a special file) on the hard disk to record the log of the file system, that is, the so-called journal. Because this article does not discuss log files, the content of this article is applicable to ext2 and ext3.
1. Preface
The source of this article is the ext3 File System in the Linux kernel. Source code . To facilitate the reader's access to the source Code Some key technical terms in this article use the English words used in the kernel source code, but do not use the corresponding Chinese translation. (Please advise me if this method is appropriate .)
2. rough description
For ext2 file systems, hard disk partitions are first divided into blocks. Each block on an ext2 file system is of the same size. However, for different ext2 file systems, the block size can be different. The typical block size is 1024 bytes or 4096 bytes. This size is determined when the ext2 file system is created. It can be specified by the system administrator or by the file system. Program A reasonable value is automatically selected based on the size of the hard disk partition. These blocks are grouped together into several large block groups. The number of blocks in each block group is fixed.
Each block group corresponds to a group descriptor. These group descriptor are together and placed at the beginning of the hard disk partition, following the super block. The so-called super block will be discussed below. There are several important block pointers in this descriptor. The block pointer here refers to the number of blocks in the hard disk partition. For example, if the pointer value is 0, we will say that it is directed to the block 0 in the hard disk partition; the pointer value is 1023, so we can say that it points to block 1023 on the hard disk partition. We noticed that the block count on a hard disk partition starts from 0, and this count is global for this hard disk partition.

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.