inodeと権限コマンドに関する質問

inodeと権限コマンドに関する質問

これが本当か偽なのか教えてくれる人がいますか?

ファイルのinodeにファイルの内容を含むブロックのアドレスがありますか?

また、Permission コマンドには、owner(r,w) g(r) の条件で既存のファイルの権限を変更する権限があるかどうかを尋ねる質問があります。だから私はそれがうまくいくと思いましたが、chmod 640 filename.txt明らかにchmod u+rw g+r filename.txt640万が正しいです。 u+rwが答えの一部ではない理由を知っている人はいますか?

ベストアンサー1

あなたの質問を正しく理解している場合は、状況によって異なると言いたいと思います。 Inodeは通常12個のデータブロックに接続できます。Wikipediaの記事で:

In the past, the structure may have consisted of eleven or thirteen 
pointers, but most modern file systems use fifteen pointers. These 
pointers consist of (assuming 15 pointers in the inode): 

- Twelve pointers that directly point to blocks of the file's data 
     (direct pointers) 
- One singly indirect pointer (a pointer that points to a block of 
     pointers that then point to blocks of the file's data) 
- One doubly indirect pointer (a pointer that points to a block of 
     pointers that point to other blocks of pointers that then point to 
     blocks of the file's data) 
- One triply indirect pointer (a pointer that points to a block of 
     pointers that point to other blocks of pointers that point to other 
     blocks of pointers that then point to blocks of the file's data)

したがって、ファイルが12ブロック*(ブロックサイズ)未満の場合、Inodeはブロックに直接接続されます。ファイルが12ブロックより大きい場合は、間接ブロックと二重間接ブロックの組み合わせを使用します。

                     inode構造のss

以下を使用して、ファイルが消費するブロック数を確認できますstat

例 stat コマンド #1

% stat /bin/ls
  File: `/bin/ls'
  Size: 117144      Blocks: 232        IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 2496176     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-04-17 16:24:20.593606056 -0400
Modify: 2010-11-03 07:43:02.000000000 -0400
Change: 2011-09-09 20:25:22.133239242 -0400

例 stat コマンド #2

% stat /etc/httpd/conf/httpd.conf 
  File: `/etc/httpd/conf/httpd.conf'
  Size: 34417       Blocks: 72         IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 3147109     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-09-26 21:04:47.303641015 -0400
Modify: 2010-10-27 06:01:44.000000000 -0400
Change: 2010-12-18 19:30:00.719999998 -0500

chmodの問題

あなたの質問については、chmod空白の代わりにカンマで記号権限(u + rg + r)を区切る必要があると思います。

% chmod u+rw,g+r filename.txt

引用する

以下は、inodeをよりよく理解するために読むことができるinodeのいくつかの追加リソースです。

おすすめ記事