跳转到主内容

如何在 NFS 客户端“ df ”输出中显示配额?

Views:
199
Visibility:
Public
Votes:
0
Category:
data-ontap-8
Specialty:
core
Last Updated:

执行  

适用于

Data ONTAP 配额

解答

有三种类型的配额、树、用户和组。Data ONTAP 不对 Windows ID 应用组配额。

  • 这些配额使用配额规则进行管理。
  • 一个配额规则始终特定于一个卷。
  • 在配额规则中定义的卷上激活之前,配额规则不具有任何效果。
  • 配额策略是 SVM 所有卷的配额规则的集合。
  • 配额策略不在 SVM 之间共享。SVM 最多可以有五个配额策略、这使您可以拥有配额策略的备份副本。
  • 在任何给定时间都将一个配额策略分配给一个 SVM 。

 

应用时的树配额将反映在 NFS 客户端和 CIFS 客户端的 df 输出中。

示例:


cluster-usa::> version
NetApp Release 8.3.2P7: Mon Oct 03 10:59:56 UTC 2016

cluster-usa::>
cluster-usa::> vol size nfs
vol size: Volume "nfssvm:nfs" has size 50g.

cluster-usa::>
cluster-usa::> qtree show nfs
Vserver    Volume        Qtree        Style        Oplocks   Status
---------- ------------- ------------ ------------ --------- --------
nfssvm     nfs          ""           unix         enable    normal
nfssvm     nfs           unix         unix         enable    normal
3 entries were displayed.

cluster-usa::>
cluster-usa::> quota policy rule show -volume nfs

Vserver: nfssvm            Policy: default           Volume: nfs

                                               Soft             Soft
                         User         Disk     Disk   Files    Files
Type   Target    Qtree   Mapping     Limit    Limit   Limit    Limit  Threshold
-----  --------  ------- -------  --------  -------  ------  -------  ---------
tree   unix     ""      -             1GB        -       -        -          -

cluster-usa::>


因此,我们在 50 G 卷上设置了 1 G 的树配额 现在、从 Linux 客户机挂载 qtree 并检查大小:

[root@sj ~]# mount nfssvm:/nfs/unix /mnt
[root@sj ~]#
[root@sj ~]# df -h /mnt
Filesystem            Size  Used Avail Use% Mounted on
nfssvm:/nfs/unix      1.0G     0  1.0G   0% /mnt
[root@sj ~]#


用户配额另一方面、 将仅反映在 CIFS 映射(映射的驱动器大小)上、而不反映在 NFS 客户端 df 输出上。

示例:


cluster-usa::> vol size vol_user
vol size: Volume "nfssvm:vol_user" has size 20g.

cluster-usa::>
cluster-usa::> quota policy rule show -volume vol_user

Vserver: nfssvm            Policy: default           Volume: vol_user

                                               Soft             Soft
                         User         Disk     Disk   Files    Files
Type   Target    Qtree   Mapping     Limit    Limit   Limit    Limit  Threshold
-----  --------  ------- -------  --------  -------  ------  -------  ---------
user   5839      home    off           1GB        -       -        -          -
user   RTP2K8DOM2\jsiva  home off   1GB        -       -        -          -
2 entries were displayed.

cluster-usa::>


在上面的 20 G 卷示例中、 对于名为 home 的 qtree 、 Windows 用户 RTP2K8DOM2\JSIVA 和 UNIX 用户 ID 5839 均设置了 1 G 的磁盘配额限制。
如果 qtree 具有 NTFS 安全类型、并且 CIFS 用户映射 qtree 、则映射的驱动器在 Windows 下的大小将为 1G 。

但是,在 UNIX 上、设置用户配额时、 qtree 的 NFS 挂载仍将显示卷的完整大小。


[root@sj ~]# mount nfssvm:/vol_user/home /home
[root@sj ~]#
[root@sj ~]# df -h /home
Filesystem            Size  Used Avail Use% Mounted on
nfssvm:/vol_user/home
                       19G  4.5M   19G   1% /home
[root@sj ~]#


当用户的 jsiva ( UID 5839 )尝试创建超过 1G 允许的配额大小的数据时、 它将失败并显示以下错误:

[root@sj ~]# su - jsiva
bash-4.1$
bash-4.1$ df -h .
Filesystem            Size  Used Avail Use% Mounted on
nfssvm:/vol_user/home
                       19G  4.5M   19G   1% /home
bash-4.1$
bash-4.1$ dd if=/dev/zero of=/home/jsiva/myfile bs=10485760 count=120
dd: closing output file `/home/jsiva/myfile': Input/output error
bash-4.1$


必须在控制器端启用 rquota 才能从 NFS 客户端检查用户配额。

cluster-usa::> vserver nfs modify -vserver nfssvm -rquota enabled

cluster-usa::>

bash-4.1$ quota jsiva
Disk quotas for user jsiva (uid 5839):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
nfssvm:/vol_user/home
                1048532  1048576 1048576               2  4294967295 4294967295
bash-4.1$

 

其他信息

在此处添加您的文本。

 

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.