Snapshot directory name conflicts
The snapshot that is generated by the mmcrsnapshot command might not be accessed due to directory conflicts and the course of action to correct the snapshot directory name conflict.
By default, all snapshots appear in a directory that is named .snapshots in the root directory of the file system. This directory is dynamically generated when the first snapshot is created and continues to exist even after the last snapshot is deleted. If the user tries to create the first snapshot, and a normal file or directory that is named .snapshots already exists, the mmcrsnapshot command is successful but the snapshot might not be accessed.
- Delete or rename the existing file or directory.
- Tell GPFS to use a different name for the dynamically generated directory of snapshots by running the mmsnapdir command.
It is also possible to get a name conflict as a result of issuing the mmrestorefs command. Since the mmsnapdir command allows changing the name of the dynamically generated snapshot directory, it is possible that an older snapshot contains a normal file or directory that conflicts with the current name of the snapshot directory. When this older snapshot is restored, the mmrestorefs command recreates the old normal file or directory in the file system root directory. The mmrestorefs command does not fail in this case, but the restored file or directory hides the existing snapshots. After the mmrestorefs command is issued, it might appear that existing snapshots have disappeared. However, the mmlssnapshot command still shows all existing snapshots.
- After the mmrestorefs command completes, rename the conflicting file or directory that was restored in the root directory.
- Run the mmsnapdir command to select a different name for the dynamically generated snapshot directory.
Finally, the mmsnapdir -a option enables a dynamically generated snapshot directory in every directory, not just the file system root. This allows each user quick access to snapshots of their own files by going into .snapshots in their home directory or any other of their directories.
Unlike .snapshots in the file system root, .snapshots in other directories is invisible, that is, the ls -a command does not list .snapshots. This is intentional because recursive file system utilities such as find, du or ls -R would otherwise either fail or produce incorrect or undesirable results. The user must explicitly specify the name of the snapshot directory to access the snapshots. For example, ls ~/.snapshots. If there is a name conflict (that is, a normal file or directory that is named .snapshots already exists in the user's home directory), the user must rename the existing file or directory.
The inode numbers that are used for and within these special .snapshots directories are constructed dynamically and do not follow the standard rules. These inode numbers are visible to applications through standard commands, such as stat, readdir, or ls. The inode numbers that are reported for these directories can also be reported differently on different operating systems. Applications should not expect consistent numbering for such inodes.