block, Inode, Superblock detailed

Source: Internet
Author: User

Ext2 File System

Block

    • In principle, the size and number of blocks cannot be changed after formatting (unless reformatted);
    • A maximum of one file can be placed within each block;
    • , if the file is larger than the block size, then a file will occupy multiple block numbers;
    • If the file is less than block, the remaining capacity of the block cannot be reused (disk space is wasted).

Inode

The recorded file data has at least those below:

    • The file's access mode (Read/write/excute);
    • The owner and group of the file (Owner/group);
    • The capacity of the file;
    • The time the file was created or changed in status (CTime);
    • Last read time (atime);
    • Time of Last modification (mtime);
    • Defines flags (flag) for file attributes, such as SetUID ... ;
    • The point of the real content of the file (pointer);

The number and size of the inode is also fixed at the time of formatting, and the Inode has the following features:

    • Each inode size is fixed to bytes;
    • Each file will only occupy one inode;
    • The number of files the file system can create is related to the number of inode;
    • When the system reads the file, it needs to find the inode and analyze whether the permissions recorded by the inode are consistent with the user, and if so, it can begin to actually read the contents of the block.

Superblock

is to record the entire filesystem related information place, no superblock, there is no this filesystem. The main information he has recorded are:

    • Block and Inode Total;
    • Number of unused and used inode/block;
    • Block and Inode size (block is 1, 2, 4k,inode is bytes);
    • Information about the file system such as the mount time of the filesystem, the last time the data was written, the time of the last Test disk (fsck), and so on;
    • A valid bit value, if the file system is mounted, the valid bit is 0, and if not mounted, the valid bit is 1.

Superblock is very important because the basic information of the filesystem is written here, Superblock is 1024bytes in size, and each block group may contain superblock! In fact, in addition to the first block group will contain Superblock, the subsequent block group does not necessarily contain superblock, and if it contains Superblock, the superblock is mainly as a first block GR OUP within the Superblock backup, so that can be superblock rescue.

Filesystem Description (File system description)

This section describes the start and end block numbers for each block group, and the number of blocks between each block (Superblock, Bitmap, Inodemap, and data block).

Block Bitmap (block table)

From the block bitmap can know which blocks are empty , if you delete some files, the original block number of those files will have to be released, at this time in the block bitmap relative to the block number of the flag will have to be modified to "do not make Use ".

Inode Bitmap (inode table)

This is actually similar to block bitmap, except that the block bitmap record is used with unused block numbers, as for Inode bitmap is the record used with unused inode numbers.

block, Inode, Superblock detailed

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.