跳转到主内容

为什么在 NFS 客户端的“ ls -al ”输出中看不到 .snapshot 目录?

Views:
67
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
nas
Last Updated:

适用场景

  • ONTAP 9
  • NFS

问题解答

  • 要使 .snapshot 显示在 "ls -la" 输出中,必须满足以下条件。
  • 必须通过 NFSv3 挂载文件管理器
  • NFSv4 不会显示 .snapshot 目录
  • 但是 .snapshot ,仍可通过 NFSv4 访问此目录
  • ls -al必须从的底部执行命令 挂载点
  • 必须在卷上启用 Snapshot 目录
  • 这可通过卷上的 snapdir-access 标志来控制

Cluster::> volume show -volume nfs_vol -fields snapdir-access
vserver volume snapdir-access
------- ------- --------------
vserver nfs_vol true

  • 必须禁用 v3-hide-snapshot 选项
     
在 ONTAP 9.5 中推出


    Cluster::> vserver nfs show -vserver sinanju -fields v3-hide-snapshot
    vserver v3-hide-snapshot
    ------- ----------------
    vserver disabled

追加信息

  • 示例:
    • NFSv3

[root@centos ~]# mount -t nfs -o vers=3 10.216.29.104:/nfs_vol /mnt/nfs3
[root@centos ~]# ls -al /mnt/nfs3
total 12
drwxrwxrwx. 2 root root 4096 Apr 17 2019 .
drwxr-xr-x. 43 root root 4096 Oct 17 16:16 ..
drwxrwxrwx. 12 root root 4096 Oct 17 16:05 .snapshot
-rw-r--r--. 1 root root 0 Apr 17 2019 test.log
[root@centos ~]# ls -al /mnt/nfs3/.snapshot
total 48
drwxrwxrwx. 12 root root 4096 Oct 17 19:05 .
drwxrwxrwx. 2 root root 4096 Apr 17 2019 ..
drwxrwxrwx. 2 root root 4096 Apr 17 2019 daily.2019-10-16_0010
drwxrwxrwx. 2 root root 4096 Apr 17 2019 daily.2019-10-17_0010
drwxrwxrwx. 2 root root 4096 Apr 17 2019 hourly.2019-10-17_1305

  • NFSv4
  • .snapshot 未显示任何目录,但仍可访问它。
  • VMware等虚拟化平台也不会列出此目录。

[root@centos ~]# mount -t nfs -o vers=4 10.216.29.104:/nfs_vol /mnt/nfs4
[root@centos ~]# ls -al /mnt/nfs4
total 8
drwxrwxrwx. 2 nobody nobody 4096 Apr 17 2019 .
drwxr-xr-x. 43 root root 4096 Oct 17 16:16 ..
-rw-r--r--. 1 nobody nobody 0 Apr 17 2019 test.log
[root@centos ~]# ls -al /mnt/nfs4/.snapshot
total 48
drwxrwxrwx. 12 nobody nobody 4096 Oct 17 18:05 .
drwxrwxrwx. 2 nobody nobody 4096 Apr 17 2019 ..
drwxrwxrwx. 2 nobody nobody 4096 Apr 17 2019 daily.2019-10-16_0010
drwxrwxrwx. 2 nobody nobody 4096 Apr 17 2019 daily.2019-10-17_0010
drwxrwxrwx. 2 nobody nobody 4096 Apr 17 2019 hourly.2019-10-17_1205

 

 

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.