Baza wiedzy

Accessing Snapshots from Clients on the Dell™ PowerVault™ 720N, 740N, and 760N (Filer). - Technical Tip - 118253


About client access to snapshots.

Snapshots can be accessed by any user with the appropriate permissions. Every directory in the filer''s active file system contains a directory named .snapshot, through which users can access old versions of files in that directory. How users gain access to snapshots depends on the file-sharing protocol used: NFS or CIFS.



NFS client access to snapshots.

Figure 1 illustrates the directory structure on a client with the vol0 volume of a filer named toaster mounted on /n/toaster.


Figure 1

Explanation

In this example, the client can obtain access to snapshots by way of /n/toaster/.snapshot. This might seem to contradict the explanation of snapshot access in the preceding section, because it shows a .snapshot directory only at the mount point instead of in every directory in the tree.

Actually, the .snapshot directory in the mount point is "real" to make the pwd command work, whereas the .snapshot directories in all other directories are "magic"; that is, can be accessed when they are referenced by name but do not show up in a directory listing.

For example, at the mount point of a filer file system, a directory listing looks like this:

ls -a

. .. .snapshot dir1 dir2

The same command entered in a directory below the mount point does not show the .snapshot directory; for example:

cd dir1
ls -a

. .. file1 file2

If you enter the ls command with the directory name .snapshot, you can see a listing of the snapshots for the dir1 directory:

ls .snapshot

hourly.0 hourly.4 nightly.0 nightly.4
hourly.1 hourly.5 nightly.1 nightly.5
hourly.2 hourly.6 nightly.2 weekly.0
hourly.3 hourly.7 nightly.3 weekly.1

If .snapshot were to show up in every directory, it would cause many commands to work improperly. For instance, all recursive commands for removing files would fail because everything below .snapshot is read-only. Recursive copies would copy everything in the snapshots as well as files in the active file system, and a find command would generate a list much longer than expected.



CIFS client access to snapshots.

To CIFS clients, 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.

NOTE: The snapshot directory is visible in that it is displayed in a directory listing or File Manager display if the client operating system is configured to show hidden files.

In each directory within the share, a snapshot directory exists but is not visible to clients. For example, if the client operating system supports long file names, the applications on that operating system can use the snapshot at each level of the share by using .snapshot, ~snapshot, or ~SNAPSHT as the directory name. You cannot, however, display the directory name in any listing.



Determining snapshot versions.

From an NFS client

The best way to find all versions of a particular file preserved in snapshots is to use the ls command. The following example shows how to find all versions of foo:

ls -l foo .snapshot/*/foo

-rw-r--r-- 1 smith 0 Jan 14 09:40 foo
-rw-r--r-- 1 smith 0 Jan 13 18:39 .snapshot/nightly.0/foo
-rw-r--r-- 1 smith 0 Jan 12 19:17 .snapshot/nightly.1/foo

The version of foo in the active file system was last modified on January 14, but the old versions available in the snapshots were modified on January 13 and January 12. Although users can use standard UNIX commands to examine the saved versions of foo, they cannot modify or remove these older versions because everything beneath .snapshot is read-only.

From a CIFS client

Use the Find command to search for the file in the ~snapshot directory. For example, if a user maps the home share to drive F: and wants to find all versions of foo in snapshots, the user can use the Find command to search for foo in the f:\~snapshot folder.



Determining access times.

When the filer creates a snapshot, the access time of each file in the snapshot is updated to the snapshot creation time.

From an NFS client

You can use the ls -lu command, which shows the access times of files, to determine when snapshots were created. Following is an example of the ls -lu command:

ls -lu foo .snapshot/*/foo

-rw-r--r-- 1 smith 0 Jan 14 09:40 foo
-rw-r--r-- 1 smith 0 Jan 14 00:00 .snapshot/nightly.0/foo
-rw-r--r-- 1 smith 0 Jan 13 00:00 .snapshot/nightly.1/foo

From a CIFS client

You can determine the access time of a file by checking its properties.



 


Quick Tips content is self-published by the Dell Support Professionals who resolve issues daily. In order to achieve a speedy publication, Quick Tips may represent only partial solutions or work-arounds that are still in development or pending further proof of successfully resolving an issue. As such Quick Tips have not been reviewed, validated or approved by Dell and should be used with appropriate caution. Dell shall not be liable for any loss, including but not limited to loss of data, loss of profit or loss of revenue, which customers may incur by following any procedure or advice set out in the Quick Tips.

Identyfikator artykułu: SLN68823

Data ostatniej modyfikacji: 11/13/2010 12:00 AM


Oceń ten artykuł

Trafne
Przydatne
Łatwe do zrozumienia
Czy ten artykuł był przydatny?
Tak Nie
Wyślij nam swoją opinię
Komentarze nie mogą zawierać znaków specjalnych: <>()\
Niestety, nasz system przekazywania opinii jest obecnie niedostępny. Spróbuj ponownie później.

Dziękujemy za uwagi.