Network and Storage Protocols

unwanted automount .snapshot Directories Linux

brauntisc
16,643 Views

Hi All

 

I hope someone can explain me following Behavoir:

 

I have a exported Volume/qree:

/vol/nfs_shares/homedirs        -sec=sys,rw,anon=0

 

On the SLES 12 Server this export is mounted:

Filer:/vol/nfs_shares/homedirs/linux/user1   40G   28G   13G  70% /usr/shared/home/user1

 

When I change to a snapshot directory and execute an ls:

cd /usr/shared/home/user1/.snapshot/2015-11-25_1200+0100_hourly

ls -ll

 

Then I have two mountpoints. The Original and one for the Snapshot:

df -h

Filer:/vol/nfs_shares/homedirs/linux/user1                                         40G   28G   13G  70% /usr/shared/home/user1

Filer:/vol/nfs_shares/homedirs/linux/user1/.snapshot/2015-11-25_1200+0100_hourly  480G   99G  382G  21% /usr/shared/home/user1/.snapshot/2015-11-25_1200+0100_hourly

 

I dont understand, which component (fe Program) mounts the additional . snaphots Directory 😞

 

TIA

Thomas

6 REPLIES 6

Sahana
16,621 Views

Hi

 

Refer https://library.netapp.com/ecmdocs/ECMP1196991/html/GUID-36DC110C-C0FE-4313-BF53-1C12838F7BBD.html  

https://kb.netapp.com/support/index?page=content&id=1010422

to get information on accessing snapshot directory.

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

hariprak
16,601 Views

Hi,

 

By default, every volume contains a directory named .snapshot through which users can access old versions of files in that directory. Users can gain access to Snapshot copies depending on the file-sharing protocol used—NFS or CIFS. Access to Snapshot copies can be turned off.

Snapshot files carry the same read permissions as the original file. A user who has permission to read a file in the volume can read that file in a Snapshot copy. A user without read permission to the volume cannot read that file in a Snapshot copy. Snapshot copies do not have write permissions.

 

How to Access to Snapshot copies over CIFS:

 

By default, CIFS users cannot see the .snapshot directory. To allow CIFS users to see the .snapshot directory, you can set the cifs.show_snapshot option to on.

To CIFS users, the .snapshot directory appears only at the root of a share. For example, if a user’s home directory is a share named bill that corresponds to the /vol/vol0/home/bill directory, only the /vol/vol0/home/bill/.snapshot directory is visible. When this user displays the contents of the home directory, the .snapshot directory is displayed as ~snapshot if the operating system supports long file names and as ~SNAPSHT if the operating system supports only short file names.

 

 

Thanks

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

brauntisc
16,594 Views

Hi

 

Thanks for your reply 🙂

 

I understand the .snapshot thing, but:

 

Why create the linux client a new mountpoint (df -h), when I access a snapshot (2015-11-25_1200+0100_hourly)over the original mountpoint (/usr/shared/home/user1)?

 

df -h (I have now two mountpoints)

Filer:/vol/nfs_shares/homedirs/linux/user1        ​                                 40G   28G   13G  70% /usr/shared/home/user1 <-- This is expected

Filer:/vol/nfs_shares/homedirs/linux/user1/.snapsh​ot/2015-11-25_1200+0100_hourly  480G   99G  382G  21% /usr/shared/home/user1/.snapshot/2015-11-25_1200+0​100_hourly <-- This NEW mountpoint is not expected

 

TIA

Thomas

rwelshman
16,534 Views

Does the new mount point disappear after you log off or does it stick around until manually unmounted?

It does seem odd that is it doing that.

brauntisc
16,482 Views

Hi

 

The Mountpoint doesn't disappear. The mounts are active till the snapshots are deleted by the System (snapshot policy). After deletion of the mounted snapshots we see "stale file handle", because

the mount target isn't there anymore (snapshot deleted)..

 

regards

Thomas

pioneer
16,368 Views

Hi Thomas,

 

Pleaes have a look at KB ID: 2011481 A Linux system running kernel 2.6x creates a mount point when accessing the .snapshot directory via Network File System

 

I found this wile looking for a solution to the same problem (stale file handles). Seems there is not much you can do as it is intended behaviour.

 

Kind Regards,

Bas

Public