Conventional methods for backing up data may be divided into two distinct approaches: file-by-file (also known as “file-level backups”) and block-by-block (also known as “block-level” backups). In a file-level backup, each block of data associated with a particular file is sequentially copied onto a backup storage device, irrespective of the original physical location of the block of data on its original storage device. Although file-level backups preserve the file or directory structure of file systems, which allows individual files to be easily accessed and restored, file-level backups fail to preserve the original physical layout of the blocks of data that make up such files.
A block-level backup, in contrast, preserves the original physical layout of data within a volume by copying and backing up such data block-by-block from a volume in the physical order in which it is organized on the volume, without regard to the file or directory structure of any file system on the volume. Although block-level backups may offer a number of advantages over file-level backups (including, e.g., flexibility and/or speed), because block-level backups preserve the original physical layout of data within a volume, block-level backups may also unwillingly preserve data in a non-optimal layout if the data was originally physically arranged on the volume in a non-optimal manner due to file-system fragmentation.
In a storage-backed file system, the blocks of data that make up files within a file system may, even if originally stored in a contiguous (i.e., sequential) manner, become fragmented as these files are modified or deleted and/or as additional files within the file system are added or deleted. Because many storage devices perform substantially better when accessing data sequentially (i.e., accessing physically adjacent units of storage) rather than randomly (i.e., accessing units of storage with arbitrary relative positions), such fragmentation may, over time, result in substantially decreased performance.
Unfortunately, because block-level backups preserve the original physical layout of data within a volume, block-level backups may preserve fragmented data in its fragmented state, even if this data is restored to a new or different storage device. As such, the instant disclosure identifies a need for systems and methods for efficiently reducing file-system fragmentation in block-level backups.