volume snapshot partial-restore-file
Restore part of a file from a snapshot
Availability: This command is available to cluster and Vserver administrators at the admin privilege level.
Description
The volume snapshot partial-restore-file
command enables you to restore a range of bytes in a file from the version of the file saved in the Snapshot copy. This command is intended to be used to restore particular pieces of LUNs, NVMe namespaces, and NFS or CIFS container files that are used by a host to store multiple sources of data. For example, a host might be storing multiple user databases in the same LUN. A partial file restore can be used to restore one of those databases in the LUN without touching other databases stored in the LUN. This command is not intended for restoring parts of normal user-level files that are stored in the volume. You should use volume snapshot restore-file command to restore normal user-level files. The volume for the partial-restore should be online during this operation.
For LUNs and NVMe namespaces, this command is supported across all LUN and NVMe namespace source and destination objects with equal logical block sizes.
Parameters
-vserver <vserver name>
- Vserver Name-
This specifies the Vserver which contains the volume.
[-volume <volume name>]
- Volume Name-
This specifies the volume in which the Snapshot copy is saved.
-s, -snapshot <snapshot name>
- Snapshot Name-
This specifies the Snapshot copy which contains the version of file from which a range of bytes is restored. The source file, LUN, or NVMe namespace must be present in the Snapshot copy.
-path <text>
- Filepath-
This specifies the relative path to the file, LUN, or NVMe namespace which is partially restored from the Snapshot copy. You should specify the
-volume
option so that the file, LUN, or NVMe namespace is searched and restored from the Snapshot copy of the specified volume. If you do not specify the-volume
then the file, LUN, or NVMe namespace is searched and restored from the Snapshot copy of the root volume. The destination file, LUN, or NVMe namespace must be present in the active file system. -start-byte <integer>
- Starting Byte Offset (Multiple of 4096)-
This specifies the starting byte offset in the file to partially restore. The first byte of the file is byte zero. The start byte must be a multiple of 4096. In addition, the start byte must not exceed the size of the source or destination file.
-byte-count <integer>
- Number of Bytes to Restore (Multiple of 4096)-
This specifies the total number of bytes to restore, beginning at the
-start-byte
value. The-byte-count
option must be a multiple of 4096. The maximum number of bytes that can be restored is 16 MB. The byte count must not exceed the range of the source or destination file.
Examples
The following example restores first 4096 bytes in the file foo.txt
inside the volume vol3
from the Snapshot copy vol3_snap
:
cluster1::> volume snapshot partial-restore-file -vserver vs0 -volume vol3 -snapshot vol3_snap -path /foo.txt -start-byte 0 -byte-count 4096