Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux file system (inode and block)     - Build Golang development environment configuration on Ubuntu 14.04 (Linux)

- Install the system cleaning software under Linux: BleachBit 1.4 (Linux)

- Getting Started with Linux system to learn: how to use tcpdump to capture TCP SYN, ACK and FIN packets (Linux)

- How to network to share files between Windows, MAC and Linux (Linux)

- Create a project using Android Studio LinearLayout (Programming)

- MySQL innodb_table_stats table does not exist solution (Database)

- Use install_updates upgrade GAMIT / GLOBK (Linux)

- Json data with double backslashes to a single backslash Json data processing (Programming)

- 30 Practical Linux system administrators will learn the command (Linux)

- Fedora 19/20 and Debian Jessie / Sid users to install FFmpeg 2.3.2 (Linux)

- How to use the command line ftp upload and download files (Linux)

- Linux system on how to use rsync to synchronize data (Server)

- ASP.NET 5 (vNext) Linux deployment (Server)

- Merge sort Java implementation (Programming)

- Physical structure and process disk IO (Linux)

- Python when automated operation and maintenance often used method (Programming)

- Can not empty the Recycle Bin to repair problems in Ubuntu 14.04 (Linux)

- Java objects are taking up much space (Programming)

- shell script: MySQL monitoring service is normal (Database)

- Text analysis tools - awk (Linux)

  Linux file system (inode and block)
  Add Date : 2018-11-21      
  Let me talk about the format: file attributes for each operating system settings / permissions are not the same, in order to store the data required for these files, so you need to format the partition to become the operating system can take advantage of file system format. linux file format Ext2 / Ext3, now seems to have the Ext4.windows operating system vfat or NTFS.

linux file system:

Operating system file data in addition to the actual content of the file, there are a lot of attributes, such as file permissions (rwx) and the file attributes (owner, group, time parameters, etc.).

The two parts of the file system data is typically stored in different blocks. Permissions property into the inode, the actual data into the data block in.

There is also a super block (super block) file system information will be recorded as a whole, including the number and amounts used of the inode and block.

inode: Record file attributes of a file occupies one inode, while recording the data in this file is where the block number;

block: The actual contents of the log file, if the file is too large will take more than one block;

super block: recording information of the file system as a whole, including the total amount of inode / block, the usage, the remaining amount, as well as the format of the file system and related information.

Each inode and block are numbered, and each will be occupied by a file system inode, inode file data in place of block numbers. We can find the inode file, and then find the file number of the data block is placed, after reading data. This data access become indexed file system. Such file systems generally require less frequent disk defragmentation.

The U-such as the FAT file format, each block number recorded in the previous block number, and therefore poor read performance data, with a long terrible defragmented.

the linux Ext2 file system inode and block the outset planned, unless reformatted (or use resize2fs commands to change the file system size), otherwise the inode and block fixed after no longer change.

If the file system is too large, all the inode and block together is difficult to manage, so the Ext2 file system when formatting is basically divided into a plurality of groups of blocks (block group), each group has its own block inode / block / super block system.

data block (data block)

Ext2 file system supports block has 1K, 2K, 4K three. When formatting block it has been fixed, and each block has a number. Note, however, due to the different block sizes can cause the file system can support a maximum disk capacity and the maximum capacity is not the same as a single file.

block used is too small, use a file two more block, inode records will increase, reducing the read and write performance.

If the block is too large, small files when the remaining space will not be used, would be a waste of resources.

inodetable (inode table)

To tell you the file data inode.inode records must contain at least the following:

Access mode of the file;

Owner of the file with all groups;

The size of the file;

Created or the file's status change time (ctime);

Last read time (atime);

Recent modification time (mtime);

The document points to the real content.

There are about inode Features:

Each inode size are fixed 128bytes;

Each file occupies a inode;

When reading the file system you need to find inode, inode and analyze the recorded permissions and user compliance, if they meet to be able to read the contents of the block.

But there is a problem, the file attributes to be recorded particularly large, but a file may have a lot block, and inode is too small (a recording block to use 4byte), how to do? linux solution is: the area defining block inode record number of 12 direct and an indirect, one triple and a double indirection indirect recording area. Number block can record a total of: 12 + 256 + 256 * 256 + 256 * 256 * 256 (K) = 16G only meet the block size is 1K when the case.

Superblock (superblock)

The overall situation there is record of the file system. For example, a file system mount time, the last time data is written, the last test disk (fsck) of the time. There is also a validbit value, if this file system has been mounted, validbit is 0, If it is not mounted, the validbit is 1.

Understand the concept of file system after, of course, is to view the file system, use the following command:

# Dumpe2fs [-bh] device file name

-b lists the reserved portion of bad sectors

-h lists only superblock data, does not list the contents of other sections.


# Dumpe2fs / dev / hdc2
- Linux Platform Oracle 11g Single Instance Installation Deployment Configuration Quick Reference (Database)
- Linux user directory (Linux)
- Restrict console access to Linux servers to improve security (Linux)
- SecureCRT use the configuration detailed tutorial (Linux)
- Configuring Android NDK development environment for Mac OS X (Linux)
- JavaScript common array manipulation functions and usage (Programming)
- Sturdy build secure Linux server (Linux)
- Linux instructions and examples GPG encryption and decryption (Linux)
- Character Encoding notes: ASCII, Unicode and UTF-8 (Linux)
- Ordinary users how to use the firewall software (Linux)
- Linux yum command Detailed (Linux)
- MariaDB 10.1 and MySQL 5.7 in general performance on commodity hardware (Database)
- Analysis examples: Intrusion Response Linux platform Case (Linux)
- How to modify the Sublime in Tab four spaces (Linux)
- OpenVPN offsite interconnecting room availability and load balancing solution (Server)
- Erase do with HTML5 Canvas and diffusion effect (Programming)
- How to install MySQL on Linux Dock (Database)
- Linux, Eclipse flash back and reinstall the JDK methods (Linux)
- CentOS7 boot systemd introduction and use of management (Linux)
- Java object serialization (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.