跳转到主内容

什么是目录大小?

Views:
609
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
core
Last Updated:

适用于

  • ONTAP 9
  • 目录元文件

回答

注意:  此上下文中的短语"目录大小"不适用于给定目录中所有文件的内容所使用的总磁盘空间。  相反,它适用于存储每个目录中所有文件的文件名的元数据文件的大小。

要了解目录大小,我们首先需要了解目录实际上是什么。Unix 类型的操作系统中通常有三种主要类型的文件: 

  • 常规文件
  • 专用文件
  • 目录文件

常规文件包含由用户和应用程序创建的数据。有关特殊文件,请参阅Linux/Unix 中详细介绍的文件类型。  本文将讨论目录文件。

什么是目录文件?

ONTAP 文件系统跟踪每个文件的名称、位置和其他元数据。为了获得最快的性能,文件名保存在称为目录文件的单个索引元文件中。 

注意:有关文件的一些文件元数据内容的示例,请参阅下面的"追加信息",另请参阅  什么是 inode?

目录文件的内容包括:

  • 文件名
  • DOS 8.3 名称,如果使用 CIFS 创建
  • Inode 编号 
如何查找目录文件的大小

在单个目录中具有高文件数的环境中,目录文件的大小变得非常重要。  现代文件系统允许长文件名和目录中的大量文件。  文件名的长度和单个目录中的文件数都会影响目录文件的大小。

要查看目录文件大小,请在客户端使用以下命令: 

$ ls -l
-rwxr-xr-x  1 user group    98404 Nov  8  2021 application.png    
drwxr-xr-x  3 user group    4096 Apr 13  2022 backup
-rw-rw-r--  1 user group   2221823 Aug 30  2021 ems.log.0000000009.txt  
-rwxr-xr-x  1 user group   1174298 Feb 12  2020 putty.log
drwxrwxr-x  4 user group    12288 Sep 17  2021 logs

  • 此输出中的第五列显示了每个文件使用的空间。
  • 突出显示的条目是目录文件的大小(以字节为单位)。
  • 新建目录的默认大小为 4096 字节。
对于 Directory File,什么被认为是大的? 
  • 在 ONTAP 9.14.1 及更高版本中,默认目录文件大小为 320MiB。
  • 在早期版本中,默认大小为 2MiB。
  • 目录文件大小大于默认值被认为是大的。
  • 对于 ONTAP 9.14.1 及更高版本,您可以调整目录大小至 1GiB。如果将目录大小设置为 1GiB 及更高,请查看对系统的性能影响。(如果不确定性能影响,请联系技术支持。)
ONTAP 在哪里计算一个卷的所有目录文件消耗的容量?

一个卷下所有目录的目录文件容量使用情况将在 User Data  从命令 volume show-space 下计算。

是否有任何目录文件分层到 FabricPool 云层?

否,目录文件始终保留在 Fabricpool 性能层中。

追加信息

$ stat file.dat
  File: file.dat
  Size: 419430400     Blocks: 822432    IO Block: 65536  regular file  
Device: 3bh/59d Inode: 99629125   Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1010/user)   Gid: (   80/   grp)
Context: system_u:object_r:nfs_t:s0
Access: 2017-01-16 04:54:15.115626000 -0800
Modify: 2013-01-09 02:48:00.000000000 -0800
Change: 2017-01-16 04:54:15.116631000 -0800
 Birth: -

  • 目录文件元数据示例

  $ stat fspopulate
  File: fspopulate
  Size: 4096       Blocks: 8      IO Block: 32768  directory    
Device: 3bh/59d Inode: 89991994   Links: 4
Access: (2755/drwxr-sr-x)  Uid: ( 1010/user)   Gid: (   80/   grp)
Context: system_u:object_r:nfs_t:s0
Access: 2022-05-30 03:45:53.110149000 -0700
Modify: 2017-01-16 04:54:15.538648000 -0800
Change: 2017-01-16 04:54:15.538648000 -0800
 Birth: -

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.

 

  • 这篇文章对您有帮助吗?