lsattr的输出是什么意思


16

我想知道什么的输出lsattrmeans.It打印这样奇怪如下,当我曾尝试:lsattr /usr

$ lsattr /usr
-----------------e- /usr/local
-----------------e- /usr/src
-----------------e- /usr/games
--------------I--e- /usr/include
--------------I--e- /usr/share
--------------I--e- /usr/lib
-----------------e- /usr/lib32
--------------I--e- /usr/bin
--------------I--e- /usr/sbin

我读过的手册页chattrlsattr,但仍然不知道。


2
您在eext3卷上看到吗?真?
伊格纳西奥·巴斯克斯

用于lsattr -l使用长名称而不是单字符缩写来打印选项。另外,请参阅此表以获取各个选项的描述。
Matthias Braun

Answers:


13

手册页chattr包含了解lsattr输出所需的所有信息。

摘抄

    The letters `acdeijstuACDST' select the new attributes for the files: 
    append only (a), compressed (c), no dump (d), extent format (e),  
    immutable (i),  data  journalling  (j),  secure deletion (s), no 
    tail-merging (t), undeletable (u), no atime updates (A), no copy on 
    write (C), synchronous directory updates (D), synchronous updates (S), 
    and top of directory hierarchy (T).

    The following attributes are read-only, and may be listed by lsattr(1) 
    but not modified by chattr: huge file (h), compression error (E), 
    indexed directory (I), compression raw access (X), and compressed dirty 
    file (Z).

如果您在同一手册页的下方进一步查看标签的说明,请执行以下操作:

    The 'e' attribute indicates that the file is using extents for mapping 
    the blocks on disk.  It may not be removed using chattr(1).

    The 'I' attribute is used by the htree code to indicate that a directory 
    is being indexed using hashed trees.  It may not be set or  reset  using
    chattr(1), although it can be displayed by lsattr(1).

10

chattr 'e'属性的手册页中可以看出该文件正在使用扩展数据块来映射磁盘上的块。可能无法使用将其删除chattr

范围是计算机文件系统中为文件保留的连续存储区域。当进程创建文件时,文件系统管理软件会分配整个范围。当再次写入文件时(可能在执行其他写入操作之后),数据将从上次写入停止的地方继续。这减少或消除了文件碎片以及可能的文件分散。

基于扩展区的文件系统(即通过扩展区而不是单个块寻址存储的文件系统)不需要将每个文件限制为单个连续的扩展区。

以下系统支持范围:

ASM - Automatic Storage Management - Oracle's database-oriented filesystem.
BFS - BeOS, Zeta and Haiku operating systems.
Btrfs - GPL'd extent based file storage (16PiB/264 max file size).
Ext4 - Linux filesystem (when the configuration enables extents — the default in Linux since version 2.6.23).
Files-11 - Digital Equipment Corporation (subsequently Hewlett-Packard) OpenVMS filesystem.
HFS and HFS Plus - Hierarchical File System - Apple Macintosh filesystems.
HPFS - High Performance File Syzstem - OS/2 and eComStation.
JFS - Journaled File System - Used by AIX, OS/2/eComStation and Linux operating systems.
Microsoft SQL Server - Versions 2000-2008 supports extents of up to 64KB [1].
Multi-Programming Executive - Filesystem by Hewlett-Packard.
NTFS - Microsoft's latest-generation file system [1]
Reiser4 - Linux filesystem (in "extents" mode).
SINTRAN III - File system used by early computer company Norsk Data.
UDF - Universal Disk Format - Standard for optical media.
VERITAS File System - Enabled via the pre-allocation API and CLI.
XFS - SGI's second generation file system.[2]

来自维基百科

chattrlsattrLinux上的工具,实用程序以及它们操作的属性特定于Second Extended Filesystem系列(ext2,ext3),并且作为e2fsprogs软件包的一部分提供。它们不适用于其他文件系统上的文件,例如ReiserFS,FAT。

(j)数据日志记录, (t)没有尾部合并功能, (e)可以扩展磁盘上的块映射

通常,在扩展区文件系统中,常规文件和目录文件作为扩展区序列(磁盘上连续的块序列)存储。文件的目录条目跟踪文件的范围。如果文件系统需要一个以上的扩展区来保存文件,它将使用扩展区块的链接列表来存储有关扩展区的信息。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.