System and method for restoring a single file from a snapshot
First Claim
Patent Images
1. A method for restoring a single file to an active file system from a snapshot, the method comprising the steps of:
- determining a type of file;
performing, in response to determining that the type of file is a file that is absent from the active file system, an empty file routine;
performing, in response to determining that the type of file is a file that exists in the active file system and is a large file, a restore routine including a reconcilation process, the reconciliation process including the steps of,a. creating a twin inode, the twin inode including a copy of block pointers associated with the file in the active file system;
b. creating a new inode associated with the file to be restored;
c. performig a reconciliation of the block pointers included in the twin inode with a set of block pointers included in the snapshot; and
performing, in response to determining that the type of file is a file that exists in the active file system and is small file, a conventional restore operation.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention provides a system and method for restoring a single file from a snapshot without the need to copy every individual block or inode from the snapshot. A file restore process duplicates the inode of a file within the active file system and performs a reconciliation process between the blocks of the twin inode and the snapshot inode. If the file does not exist within the active file system, a new buffer tree is created that points to the data blocks stored in the snapshot.
-
Citations
25 Claims
-
1. A method for restoring a single file to an active file system from a snapshot, the method comprising the steps of:
-
determining a type of file; performing, in response to determining that the type of file is a file that is absent from the active file system, an empty file routine; performing, in response to determining that the type of file is a file that exists in the active file system and is a large file, a restore routine including a reconcilation process, the reconciliation process including the steps of, a. creating a twin inode, the twin inode including a copy of block pointers associated with the file in the active file system; b. creating a new inode associated with the file to be restored; c. performig a reconciliation of the block pointers included in the twin inode with a set of block pointers included in the snapshot; and performing, in response to determining that the type of file is a file that exists in the active file system and is small file, a conventional restore operation. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer storing files on an active file system, the computer comprising:
-
means for determining a type of file; means for performing, in response to determining that the type of file is a file that is absent from the active file system, an empty file routine; means for performing, in response to determining that the type of file is a file that exists in the active file system and is a large file, a restore routine including a reconciliation process, the reconciliation process having, a. means for creating a twin inode, the twin inode including a copy of block pointers associated with the file in the active file system; b. means for creating a new inode associated with the file to be restored; c. means for performing a reconciliation of the block pointers included in the twin inode with a set of block pointers included in the snapshot; and means for performing, in response to determining that the type of file is a file that exists in the active file system and is a small file, a conventional restore operation. - View Dependent Claims (7, 23, 24, 25)
-
-
8. In a storage operating system, a reconcilation process for restoring a single file to an active file system from a snapshot, wherein the file exists in the active file system and wherein the file is a large file or a small file, the reconciliation process comprising instructions for performing the steps of:
-
creating a twin inode, the twin inode including a copy of all blocks associated with the file in the active file system; creating a new inode for the file to be restored; comparing a block pointer from the twin inode with a block pointer associated with the snapshot; moving, in response to the twin inode block pointer matching the block pointer associated with the snapshot, the twin inode block pointer to file to be restored in the active file system; copying, in response to the twin inode block pointer differing from the block pointer associated with the snapshot and the block pointer associated with the snapshot not being allocated in the active file system, the block pointer associated with the snapshot to the file to be restored in the active file system; and copying, in response to the block pointer being allocated in the active file system, a data block from the snapshot to the active file system.
-
-
9. A method for restoring a single file to an active file system from a snapshot, the method comprising the steps of:
-
creating a tracking entry, the tracking entry storing state information related to progress of restoring the single file; determining a type of file; performing, in response to determining that the type of file is a file that is absent from the active file system, an empty file routine; performing, in response to determining that the type of file is a file that exists in the active file system and is a large file, a restore routine including a reconciliation process, the reconciliation process including the steps of, a. creating a twin inode, the twin inode including a copy of block pointers associated with the file in the active file system; b. creating a new inode associated with the file to be restored; c. performing a reconciliation of the block pointers included in the twin inode with a set of block pointers included in the snapshot; and performing, in response to determining that the type of file is a file that exists in the active file system and is a small file, a conventional restore operation.
-
-
10. A computer storing files on an active file system, the computer comprising:
-
means for determining a type of file; means for creating a tracking entry, the tracking entry storing state information related to progress of restoring a single file from a snapshot; means for performing, in response to determining that the type of file is a file that is absent from the active file system, an empty file routine; means for performing, in response to determining that the type of file is a file that exists in the active file system and is a large file, a restore routine including a reconciliation process, the reconciliation process having, a. means for creating a twin inode, the twin inode including a copy of block pointers associated with the file in the active file system; b. means for creating a new inode associated with the file to be restored; c. means for performing a reconciliation of the block pointers included in the twin inode with a set of block pointers included in the snapshot; means for performing, in response to determining that the type of file is a file that exists in the active file system and is a small file, a conventional restore operation; and wherein the state information stored in the tracking entry enables the means for performing a restore routine including a reconciliation process and the means for performing an empty file routine to resume operation after an interruption.
-
-
11. A method for restoring a single file in a volume having a plurality of files, comprising:
-
(A) maintaining the single file in an active file, the active file maintained in an active file system; (B) choosing a snapshot of the file, the snapshot created at a first time, the snapshot having a snapshot inode; (C) issuing a restore command at a second time later than the first time; (D) creating, in response to the restore command, a new file in the active file system, the new file having a new file inode; (E) determining if the snapshot file exists in the active file system, (E.1) if the snapshot file does not exist in the active file system, then copying the snapshot inode to the new file inode, thereby restoring the data blocks pointed to by the snapshot file into the active file system; (E.2) if the snapshot file does exist in the active file system and is a large file, performing a reconciliation process that includes, (F) creating a twin inode of the file in response to the restore command; (G) comparing entries in the twin inode with entries in the snapshot inode, (G.1) if a twin inode entry matches a snapshot inode entry then pointing the new file inode entry to the twin inode entry, (G.2) if a twin inode entry does not match a snapshot inode entry then allocating space in the active file system for the data blocks pointed to in the snapshot and pointing the new file inode entry to the snapshot inode entry. - View Dependent Claims (12, 13, 14)
-
-
15. A method for restoring a single file in a volume having a plurality of files, comprising:
-
(A) maintaining the single file in an active file, the active file maintained in an active file system; (B) choosing a snapshot of the file, the snapshot created at a first time, the snapshot having a snapshot inode; (C) issuing a restore command at a second time later than the first time; (D) creating, in response to the restore command, a new file in the active file system, the new file having a new file inode; (E) determining if the snapshot file exists in the active file system, and if the snapshot file does exist in the active file system and is a large file, performing a reconciliation process that includes, (F) creating a twin inode of the file in response to the restore command; (G) comparing entries in the twin inode with entries in the snapshot inode, (G.1) and if a twin inode entry matches a snapshot inode entry then pointing the new file inode entry to the twin inode entry, (G.2) and if a twin inode entry does not match a snapshot inode entry then allocating space in the active file system for the data blocks pointed to in the snapshot and pointing the new file inode entry to the snapshot inode entry.
-
-
16. A filing system having a plurality of files operated to restore a single file of a volume, comprising:
-
(A) means for maintaining the single file in an active file, the active file maintamed in an active file system; (B) means for choosing a snapshot of the file, the snapshot created at a first time, the snapshot having a snapshot inode; (C) means for issuing a restore command at a second time later than the first time; (D) means for creating, in response to the restore command, a new file in the active file system, the new file having a new file inode; (E) means for determining if the snapshot file exists in the active file system, (E.1) if the snapshot file does not exist in the active file system, then means for copying the snapshot inode to the new file inode, thereby restoring the data blocks pointed to by the snapshot file into the active file system; (E.2) if the snapshot file does exist in the active file system and is a large file, performing a reconciliation process that includes, (F) means for creating a twin inode of the file in response to the restore command; (G) means for comparing entries in the twin inode with entries in the snapshot inode, (G.1) if a twin inode entry matches a snapshot inode entry then means for pointing the new file inode entry to the twin inode entry, (G.2) if a twin inode entry does not match a snapshot inode entry then means for allocating space in the active file system for the data blocks pointed to in the snapshot and means for pointing the new file inode entry to the snapshot inode entry. - View Dependent Claims (17, 18, 19)
-
-
20. A filing system having a plurality of files operated to restore a single file of a volume, comprising:
-
(A) means for maintaining the single file in an active file, the active file maintamed in an active file system; (B) means for choosing a snapshot of the file, the snapshot created at a first time, the snapshot having a snapshot inode; (C) means for issuing a restore command at a second time later than the first time; (D) means for creating, in response to the restore command, a new file in the active file system, the new file having a new file inode; (E) means for determining if the snapshot file exists in the active file system, and if the snapshot file does exist in the active file system and is a large file, performing a reconciliation process that includes, (F) means for creating a twin inode of the file in response to the restore command; (G) means for comparing entries in the twin inode with entries in the snapshot inode, (G.1) and if a twin inode entry matches a snapshot inode entry then means for pointing the new file inode entry to the twin inode entry, (G.2) and if a twin inode entry does not match a snapshot inode entry then means for allocating space in the active file system for the data blocks pointed to in the snapshot and means for pointing the new file inode entry to the snapshot inode entry.
-
-
21. A computer readable media, comprising:
-
said computer readable media containing instructions for execution on a processor for the practice of a method for restoring a single file in a volume having a plurality of files, having the steps of, (A) maintaining the single file in an active file, the active file maintained in an active file system; (B) choosing a snapshot of the file, the snapshot created at a first time, the snapshot having a snapshot inode; (C) issuing a restore command at a second time later than the first time; (D) creating, in response to the restore command, a new file in the active file system, the new file having a new file inode; (E) determining if the snapshot file exists in the active file system, (E.1) if the snapshot file does not exist in the active file system, then copying the snapshot inode to the new file inode, thereby restoring the data blocks pointed to by the snapshot file into the active file system; (E.2) if the snapshot file does exist in the active file system and is a large file, performing a reconciliation process that includes, (F) creating a twin inode of the file in response to the restore command; (G) comparing entries in the twin inode with entries in the snapshot inode, (G.1) if a twin inode entry matches a snapshot inode entry then pointing the new file inode entry to the twin inode entry, (G.2) if a twin inode entry does not match a snapshot inode entry then allocating space in the active file system for the data blocks pointed to in the snapshot and pointing the new file inode entry to the snapshot inode entry.
-
-
22. A computer readable media, comprising:
-
said computer readable media containing instructions for execution on a processor for the practice of a method for restoring a single file in a volume having a plurality of files, having the steps of, (A) maintaining the single file in an active file, the active file maintained in an active file system; (B) choosing a snapshot of the file, the snapshot created at a first time, the snapshot having a snapshot inode; (C) issuing a restore command at a second time later than the first time; (D) creating, in response to the restore command, a new file in the active file system, the new file having a new file inode; (E) determining if the snapshot file exists in the active file system, and if the snapshot file does exist in the active file system and is a large file, performing a reconciliation process that includes, (F) creating a twin inode of the file in response to the restore command; (G) comparing entries in the twin inode with entries in the snapshot inode, (G.1) and if a twin inode entry matches a snapshot inode entry then pointing the new file inode entry to the twin inode entry, (G.2) and if a twin inode entry does not match a snapshot inode entry then allocating space in the active file system for the data blocks pointed to in the snapshot and pointing the new file inode entry to the snapshot inode entry.
-
Specification