Copy-on-write systems and methods
AssigneeKaseya Limited
InventorsNeale Campbell Hutcheson, Jr., Stuart Mark
Life of this patent
Estimating the term…
Abstract
Described methods and systems for copying a source volume to a target volume that include a combination of concurrent copying and a copy-on-write (COW) technique that improves the reliability of the backup process and requires fewer resources during a given backup instance than the processes of the prior art.
Claims20
A method for copying a source volume associated with a client device and comprising multiple blocks to a target volume, the method comprising:
- (a) taking a first snapshot of the source volume, the first snapshot comprising at least one block of the source volume to be copied to the target volume;
- (b) performing a first backup of the source volume based on at least a used block map;
- (c) causing an operating system managing the source volume to enter an incremental tracking mode, wherein the operating system collects incremental tracking information for any blocks of the source volume modified while in incremental tracking mode and stores the incremental tracking information in a first incremental tracking data structure, the incremental tracking information comprising the number of blocks of the source volume modified since performing the first backup;
- (d) while in incremental tracking mode, causing the operating system to allow writes to the source volume;
- (e) receiving an instruction to perform an incremental backup of the source volume to the target volume;
- (f) optionally storing the incremental tracking information in a memory associated with the client device;
- (g) determining a size of a COW file by multiplying the number of blocks identified by the incremental tracking information by a block size;
- (h) allocating, via the operating system, space on a storage media associated with the client device for the COW file, wherein the amount of space allocated for the COW file is based on the determined size;
- (i) initializing, via the operating system, a second incremental tracking data structure;
- (j) creating a snapshot virtual device of the source volume, wherein the snapshot virtual device of the source volume is a logical volume comprising the COW file and the contents of the source volume that are not identified by the incremental tracking information of the first incremental tracking data structure as having been modified since a previous backup;
- (k) instructing the operating system to begin storing incremental tracking information for any blocks of the source volume modified since creating the snapshot virtual device of the source volume in the second incremental tracking data structure;
- (l) causing the operating system managing the source volume to enter a copy-on-write mode, wherein for each block of the source volume that is targeted by a write instruction from the operating system, the operating system:
- (l1) determines whether each targeted block is identified in the incremental tracking information of the first incremental tracking data structure as having been modified since the previous backup;
- and
- (l2) if a targeted block is identified in the incremental tracking information of the first incremental tracking data structure as having been modified since the previous backup, copying the contents of the targeted block to the COW file before the write instruction modifies the contents of the targeted block included in the source volume;
- (m) while the operating system remains in COW mode, performing an incremental backup of the source volume by copying the contents of the snapshot virtual device to the target volume;
- and
- (n) causing the operating system to exit COW mode and transition to incremental tracking mode only.
A method for copying a source volume associated with a client device and comprising multiple blocks to a target volume, the method comprising:
- (a) designating a set of one or more blocks to be copied from the source volume to the target volume;
- (b) causing an operating system managing the source volume to enter an incremental tracking mode, wherein the operating system collects incremental tracking information for any blocks of the source volume modified while in incremental tracking mode and stores the incremental tracking information in a first incremental tracking data structure, the incremental tracking information comprising the number of blocks of the source volume modified since performing the first backup;
- (c) while in incremental tracking mode, causing the operating system to allow writes to the source volume;
- (d) copying the designated set of one or more blocks from the source volume to the target volume while the operating system is configured to write to the source volume;
- (e) identifying blocks of the source volume that were written to by the operating system since the operating system was configured to collect and store incremental tracking information in step (b);
- (f) if one or more blocks were identified in step (e), comparing an aggregate size of the identified one or more blocks to a threshold, wherein:
- (f1) if the aggregate size is greater than or equal to the threshold:
- changing the designated set of one or more blocks to be copied from the source volume to the target volume to include only one or more of the identified one or more blocks;
- resetting the incremental tracking information;
- and
- repeating steps (c), (d), and (e);
- (f2) if the aggregate size is below the threshold:
- causing the operating system to perform an incremental backup of the source volume to the target volume is performed, wherein the operating system managing the source volume enters a copy-on-write mode.
A system for copying a source volume associated with a client device and comprising multiple blocks to a target volume, the system comprising:
- at least one processor;
- and
- memory including instructions that, when executed by the at least one processor, cause the system to perform the steps of:
- (a) designating a set of one or more blocks to be copied from the source volume to the target volume;
- (b) causing an operating system managing the source volume to enter an incremental tracking mode, wherein the operating system collects incremental tracking information for any blocks of the source volume modified while in incremental tracking mode and stores the incremental tracking information in a first incremental tracking data structure, the incremental tracking information comprising the number of blocks of the source volume modified since performing the first backup;
- (c) while in incremental tracking mode, causing the operating system to allow writes to the source volume;
- (d) copying the designated set of one or more blocks from the source volume to the target volume while the operating system is configured to write to the source volume;
- (e) identifying blocks of the source volume that were written to by the operating system since the operating system was configured to collect and store incremental tracking information in step (b);
- (f) if one or more blocks were identified in step (e), comparing an aggregate size of the identified one or more blocks to a threshold, wherein:
- (f1) if the aggregate size is greater than or equal to the threshold:
- changing the designated set of one or more blocks to be copied from the source volume to the target volume to include only one or more of the identified one or more blocks;
- resetting the incremental tracking information;
- and
- repeating steps (c), (d), and (e);
- (f2) if the aggregate size is below the threshold:
- causing the operating system to perform an incremental backup of the source volume to the target volume is performed, wherein the operating system managing the source volume enters a copy-on-write mode;
- (g) optionally storing the incremental tracking information in a memory associated with the client device;
- (h) determining a size of a COW file by multiplying the number of blocks identified by the incremental tracking information by a block size;
- (i) allocating, via the operating system, space on a storage media associated with the client device for the COW file, wherein the amount of space allocated for the COW file is based on the determined size;
- (j) initializing, via the operating system, a second incremental tracking data structure;
- (k) creating a snapshot virtual device of the source volume, wherein the snapshot virtual device of the source volume is a logical volume comprising the COW file and the contents of the source volume that are not identified by the incremental tracking information of the first incremental tracking data structure as having been modified since a previous backup;
- (l) instructing the operating system to begin storing incremental tracking information for any blocks of the source volume modified since creating the snapshot virtual device of the source volume in the second incremental tracking data structure;
- (m) causing the operating system managing the source volume to enter a copy-on-write mode, wherein for each block of the source volume that is targeted by a write instruction from the operating system, the operating system:
- (m1) determines whether each targeted block is identified in the incremental tracking information of the first incremental tracking data structure as having been modified since the previous backup;
- and
- (m2) if a targeted block is identified in the incremental tracking information of the first incremental tracking data structure as having been modified since the previous backup, copying the contents of the targeted block to the COW file before the write instruction modifies the contents of the targeted block included in the source volume;
- (n) while the operating system remains in COW mode, performing an incremental backup of the source volume by copying the contents of the snapshot virtual device to the target volume;
- (o) causing the operating system to exit COW mode and transition to incremental tracking mode only;
- (p) discarding the first incremental tracking data structure;
- (q) instructing the operating system to continue collecting and storing incremental tracking information in the second incremental tracking data structure;
- and
- (r) repeating steps (c) through (q).
Dependencies are inferred from the claim text.