Understanding ext2 file system

Source: Internet
Author: User
Tags ide hard drive
Understanding the composition and partition of the ext2 file system hard disk 1. the physical structure of the disk is a circular disk (mainly used to record data). the mechanical arm www.2cto.com [the disk read header on the manipulator arm (can be erased from the data on the disk)] the spindle motor, you can turn the disk to allow read on the arm of the manipulator... understanding the composition and partition of the ext2 file system hard disk 1. the physical structure of the disk is a circular disk (mainly used to record data). the mechanical arm www.2cto.com [the disk read header on the manipulator arm (can be erased from the data on the disk)] the spindle motor, you can rotate the disk so that the read header on the manipulator can read and write data on the disk. the physical component Sector (Sector) of a disk is the smallest physical storage unit. each slice is bytes and the slice is a circle, that is, the Cylinder and the split slot) the smallest unit of the first sector is the most important, including: Master Boot Record MBR and Partition table, in which MBR occupies 446 bytes, while Partition Table occupies 64 bytes 3. disk partition --- specify the start and end magnetic column of the partition. The partition table of the first sector stores the Shard range of the partition. because the partition table only has 64 bytes, a maximum of four partitions can be recorded. these four partitions are called primary partitions or extended partitions, the extended partitions can be further divided into logical partitions, but only the primary and logical partitions can be formatted. Www.2cto.com the maximum number of primary and extended partitions is four (hard disk limit). The maximum number of extended partitions is one (operating system limit) A logical partition is a partition that is continuously separated by an extended partition. only the primary partition and the logical partition can be formatted. the extended partition cannot be formatted in different operating systems. The maximum number of logical partitions is different. In Linux, the IDE hard drive can have a maximum of 59 logical partitions (5-63), and the SATA hard drive can have a maximum of 11 logical partitions (5-15) 4. file system features because the file attributes/permissions set by each operating system are not the same. to store the data, you need to format the partition, to become a File System that can be used by the operating System ). the file systems that each operating system can use are also different. For example, if win98 uses FAT or FAT16, the ntfs file system will be available in versions later than win2000, and the Linux Orthodox file system will be ext2. In linux, permissions and attributes are stored in inode, while the actual data is placed in the data block. The super block records the overall information of the entire file system, including the total inode and block, usage, and remaining amount. Inode and block: an Indexed file system. Inode records the location of the block, and the operating system can read the data in one breath. For example, if a file system in the FAT format does not have inode, you must read the blocks one by one before you can know where the next block is. If the block written to the same file is too scattered, the disk read header will not be able to read all the data in a circle on the disk. [Fragment: the reason for fragment is that the block written to the file is too discrete, and the efficiency of file reading will be greatly reduced.] 5. linux EXT2 file system (inode) EXT2 is an inode-based file system. Each inode in www.2cto.com inode table is 128 bytes. each file occupies only one inode, therefore, the number of files that can be created by the file system depends on the number of inode. when the system reads files, it must first find the inode, it also analyzes whether the permissions recorded by inode are consistent with those recorded by the user. Superblock is the place where information about the entire filesystem is recorded. without Superblock, there is no FileSystem. The recorded information includes the total number of blocks and inode that are not used and the number of inode/blocks that are already used. The size of blocks and inode is 1, 2, 4 K, and inode is 128 bytes) the Mount time of the FileSystem, the time when data was last written, the time when the last disk (fsck) was verified, and other information related to the file system is a valid bit value. if the file system has been mounted, valid bit is 0, otherwise it is 1. generally, the size of superblock is 1024 bytes.
Related Article

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.