Inode and block changes in file operations in linux

Source: Internet
Author: User

Inode operations on files in linux, block changes 1. create a file system and mount it: inode. The block information is as follows: filesystem Inodes IUsed IFree IUse % Mounted on/dev/sdb5 28112 11 28101 1%/test5/dev/sdb6 28112 11 28101 1%/test6Filesystem 1K-blocks Used Available Use % Mounted on/dev/sdb5 108837 5663 97555 6%/test5/dev/sdb6 108865 5663 97581/test62. create a testfile file under/test5: the following information is displayed: filesystem Inodes IUsed IFree IUse % Mounted on/dev/sdb5 28112 12 28100 1%/test5/dev/sdb6 28112 11 28101 1%/test6Filesystem 1K-blocks Used Available Use % Mounted on/dev/sdb5 108837 5664 97554 6%/test5/dev/sdb6 108865 5663 97581 6%/test6 conclusion: when creating a file, it occupies one inode. At least one block3. copy the file testfile from/test5 to/test6/testfile. cpFilesystem Inodes IUsed IFree IUse % Mounted on/dev/sdb5 28112 13 28099 1%/test5/dev/sdb6 28112 12 28100 1%/test6Filesystem 1K-blocks Used Available Use % Mounted on/dev/sdb5 108837 5664 97554 6%/test5/dev/sdb6 108865 5664 97580 6%/test6 conclusion: replication should be equal to the creation process 4. move/test5/testfile to/test6/Filesystem Inodes IUsed IFree IUse % Mounted on/dev/sdb5 28112 12 28100 1%/test5/dev/sdb6 28112 13 28099 1%/test6Filesystem 1K-blocks Used Available use % Mounted on/dev/sdb5 108837 5664 97554 6%/test5/dev/sdb6 108865 5664 97580 6%/test6 conclusion: /test5 inode to reduce one,/test6 inode to add one,/test5 block should remain the same,/test6 should be reduced by a possible cause of file size 5. delete testfileFilesystem Inodes IUsed IFree IUse % Mounted on/dev/sdb5 28112 12 28100 1%/test5/dev/sdb6 28112 12 28100 1%/test6Filesystem 1K-blocks Used Available Use % Mounted on under/test6 /dev/sdb5 108837 5664 97554 6%/test5/dev/sdb6 108865 5664 97580 6%/test6 conclusion: when deleting a file, only inode nodes are deleted, and data in block blocks are not destroyed. This is also the basis for data recovery.

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.