16.13. User Serviceable Snapshots
test.txtwhich was in the Home directory a couple of months earlier and was deleted accidentally. You can now easily go to the virtual
.snapsdirectory that is inside the home directory and recover the test.txt file using the
- User Serviceable Snapshot is not the recommended option for bulk data access from an earlier snapshot volume. For such scenarios it is recommended to mount the Snapshot volume and then access the data. For more information see, Chapter 16, Managing Snapshots
- Each activated snapshot volume when initialized by User Serviceable Snapshots, consumes some memory. Most of the memory is consumed by various house keeping structures of gfapi and xlators like DHT, AFR, etc. Therefore, the total memory consumption by snapshot depends on the number of bricks as well. Each brick consumes approximately 10MB of space, for example, in a 4x2 replica setup the total memory consumed by snapshot is around 50MB and for a 6x2 setup it is roughly 90MB.Therefore, as the number of active snapshots grow, the total memory footprint of the snapshot daemon (snapd) also grows. Therefore, in a low memory system, the snapshot daemon can get
OOMkilled if there are too many active snapshots
16.13.1. Enabling and Disabling User Serviceable Snapshot
# gluster volume set VOLNAME features.uss enable
# gluster volume set test_vol features.uss enable volume set: success
# gluster volume set VOLNAME features.uss disable
# gluster volume set test_vol features.uss disable volume set: success
16.13.2. Viewing and Retrieving Snapshots using NFS / FUSE
.snapsdirectory of every directory of the mounted volume.
# mount -t nfs -o vers=3 server1:/test-vol /mnt/glusterfs
# mount -t glusterfs server1:/test-vol /mnt/glusterfs
.snapsdirectory is a virtual directory which will not be listed by either the
lscommand, or the
ls -aoption. The .snaps directory will contain every snapshot taken for that given volume as individual directories. Each of these snapshot entries will in turn contain the data of the particular directory the user is accessing from when the snapshot was taken.
- Go to the folder where the file was present when the snapshot was taken. For example, if you had a test.txt file in the root directory of the mount that has to be recovered, then go to that directory.
# cd /mnt/glusterfs
NoteSince every directory has a virtual
.snapsdirectory, you can enter the
.snapsdirectory from here. Since
.snapsis a virtual directory,
ls -acommand will not list the
.snapsdirectory. For example:
# ls -a ....Bob John test1.txt test2.txt
- Go to the
# cd .snaps
- Run the
lscommand to list all the snapsFor example:
# ls -p snapshot_Dec2014/ snapshot_Nov2014/ snapshot_Oct2014/ snapshot_Sept2014/
- Go to the snapshot directory from where the file has to be retrieved.For example:
# ls -p John/ test1.txt test2.txt
- Copy the file/directory to the desired location.
# cp -p test2.txt $HOME
16.13.3. Viewing and Retrieving Snapshots using CIFS for Windows Client
.snapsfolder of every folder in the root of the CIFS share. The
.snapsfolder is a hidden folder which will be displayed only when the following option is set to
ONon the volume using the following command:
# gluster volume set volname features.show-snapshot-directory on
ON, every Windows client can access the
.snapsfolder by following these steps:
- In the
Folderoptions, enable the
Show hidden files, folders, and drivesoption.
- Go to the root of the CIFS share to view the
.snapsfolder is accessible only in the root of the CIFS share and not in any sub folders.
- The list of snapshots are available in the
.snapsfolder. You can now access the required file and retrieve it.