Linux Basic Learning -9.1-file attributes Inode and block

Source: Internet
Author: User

1, Inode1) how come?

Created when the file system was formatted.

2) What do you mean?

Index node

The inode is the attribute information used to store the file, the location of the block

Inode Number (number)

3) features

1#linux create a non-empty file to occupy an inode and at least 1 blocks

4) View

[Email protected] ~]# ls-lhi/etc/hosts

915740-rw-r--r--. 2 root root 158 Jan 8 2018/etc/hosts

How much did #系统中inode一共有多少 use?

Creating a file reduces an inode

[Email protected] ~]# df-i

Filesystem inodes iused IFree iuse% mounted on

/dev/sda3 1250928 55504 1195424 5%/

TMPFS 125514 1 125513 1%/DEV/SHM

/DEV/SDA1 51200 51162 1%/boot

2, Block1) how come?

Created when the file system was formatted.

2) What do you mean?

Where the data is actually stored

3) features

The data is stored in

2#block size default 4KB (CentOS 6.x)

3# file is larger, need to use multiple blocks, when the file is relatively small (1KB) the remaining space will be wasted.

4) View

Usage of block in #查看 system ===== usage of disk space

[Email protected] ~]# df-h

Filesystem Size used Avail use% mounted on

/dev/sda3 8.8G 1.5G 6.9G 18%/

Tmpfs 931M 0 931M 0%/dev/shm

/DEV/SDA1 190M 40M 141M 22%/boot

Number of Inode

[[email protected] ~]# #grep filter is case insensitive

[Email protected] ~]# Dumpe2fs/dev/sda3 |grep-i "inode size"

DUMPE2FS 1.41.12 (17-may-2010)

Inode size:256

Exercises:

1. Outline the ins and outs of the inode?

2. Describe the ins and outs of block?

Inode and block for Linux Basic Learning -9.1-file attributes

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.