linux下檔案操作inode,block的變化 1.建立好檔案系統並掛載:inode,block資訊如下: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 6% /test62.在/test5下建立一個testfile檔案:後資訊如下: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結論:建立一個檔案時,佔用一個inode,至少一個block3.從/test5複製檔案testfile到/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結論:複製應該等於建立的過程4.移動/test5/testfile到/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結論:/test5 inode減少一個, /test6 inode增加一個,/test5 block應該不變,/test6應該減少一個 可能因為檔案大小5.在/test6下刪除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/dev/sdb5 108837 5664 97554 6% /test5/dev/sdb6 108865 5664 97580 6% /test6結論:刪除檔案時,只刪除inode節點,不銷毀block塊中的資料,同時這也是資料恢複的基礎