# Patent

## Title
Methods and systems for data cleanup using physical image of files on storage devices

## Abstract

Systems and computer program products are provided for optimizing selection of files for deletion from one or more data storage devices to free up a predetermined amount of space in the one or more data storage devices. A method includes analyzing an effective space occupied by each file of a plurality of files in the one or more data storage devices, identifying, from the plurality of files, one or more data blocks making up a file to free up the predetermined amount of space based on the analysis of the effective space of each file of the plurality of files, selecting one or more of the plurality of files as one or more candidate files for deletion, based on the identified one or more data blocks, and deleting the one or more candidate files for deletion from the one or more data storage devices.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This application is related to U.S. patent application Ser. No. 13/584,417, filed on Aug. 13, 2012.
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates in general to data storage and, more particularly, to optimizing space in data storage.
2. Description of the Related Art
Desktop computers, tablets, smart phones, and similar computing devices store data locally in one or more physical data storage devices. Typically, computers include local memory devices, such as dynamic random access memory devices for storing software applications, programs, and/or other data for computer operation. The local memory devices are accessible by a central processing unit, which is operable with a cache memory for temporarily storing received data. The computer also includes a mass storage device, such as an internal hard disk, for more permanent storage of data. To receive programs and/or other data from removable physical storage media, media drives, such as CD drives or other disk drives, are included and configured to read programs from and/or write data onto the storage media. Some computers include universal serial bus ports or other connection mechanisms for connecting flash drives or other temporary data storage devices to the computer.
SUMMARY OF THE INVENTION
In most cases, computers are provided with a limited capacity for memory. Thus, increasing memory capacity includes either adding additional hardware to the computer or using various flash drives and/or other temporary data storage devices to store desired data. Although these techniques are acceptable in most cases, adding hardware to the computer is relatively costly. Additionally, individual flash drives and/or other temporary data storage devices may not have adequate memory for the storage of certain data files, and hence, the files may be stored on multiple drives thereby increasing the likelihood of data misplacement.
To avoid adding hardware to the computer, some devices include a cleanup tool application that identifies files for deletion from one or more data storage devices of the computer. Typically when determining which data to migrate from one device to another, the cleanup tool application outputs a list of files to delete based on data importance and on policy. The user then arbitrarily selects files from the list to delete from storage in order to free up a desired amount of space. However, in some cases, a first file may share deduplication data with a second file, and hence, choosing the first file for deletion frees up less space than desired. In other cases, a first file may be located on lower performance storage than a second file. Thus, choosing the first file may decrease performance of the computer. Additionally, a first file may not be stored as a contiguous block of data when compared to a second file, and hence, selection of the first file may also decrease performance of the computer.
To improve computer performance, methods, systems, and computer program products are provided for optimizing selection of files for deletion from one or more data storage devices to free up a predetermined amount of space in the one or more data storage devices.
In an embodiment, by way of example only, a method includes analyzing an effective space occupied by each file of a plurality of files in the one or more data storage devices, identifying, from the plurality of files, one or more data blocks making up a file to free up the predetermined amount of space based on the analysis of the effective space of each file of the plurality of files, selecting one or more of the plurality of files as one or more candidate files for deletion, based on the identified one or more data blocks, and evicting the one or more candidate files for deletion from the one or more data storage devices.
In another embodiment, by way of example only, a system for optimizing selection of files for deletion to free up a predetermined amount of space includes one or more data storage devices, and a processor in operable communication with the one or more data storage devices capable of analyzing an effective space occupied by each file of a plurality of files in the one or more data storage devices, identifying, from the plurality of files, one or more data blocks of a file to free up the predetermined amount of space based on the analysis of the effective space of each file of the plurality of files, selecting one or more of the plurality of files as one or more candidate files for deletion, based on the identified one or more data blocks, and deleting the one or more candidate files for deletion from the one or more data storage devices.
In another embodiment, by way of example only, a physical computer storage medium comprises a computer program product for implementing a method of optimizing selection of files for deletion from one or more data storage devices. The method includes analyzing an effective space occupied by each file of a plurality of files in the one or more data storage devices, identifying, from the plurality of files, one or more data blocks making up a file to free up the predetermined amount of space based on the analysis of the effective space of each file of the plurality of files, selecting one or more of the plurality of files as one or more candidate files for deletion, based on the identified one or more data blocks, and deleting the one or more candidate files for deletion from the one or more data storage devices.



BRIEF DESCRIPTION OF THE DRAWINGS
In order that the advantages of the invention will be readily understood, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments that are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered to be limiting of its scope, the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings, in which:
FIG. 1 is a block diagram of a computer, according to an embodiment;
FIG. 2 is a flow diagram of a method of identifying a deletion set of files, according to an embodiment;
FIG. 3 is flow diagram of a method of building a file cleanup information table for the method of identifying a deletion set of files illustrated in FIG. 2, according to an embodiment;
FIG. 4 is a flow diagram of a method of creating an interdeduplicated block information table for the method of identifying a deletion set of files illustrated in FIG. 2, according to an embodiment;
FIG. 5 is a flow diagram of a method of determining disk contiguity of a file for use in the method of creating an interdeduplicated block information table illustrated in FIG. 4, according to an embodiment;
FIG. 6 is a flow diagram of a method of obtaining interdeduplicated file sets for the method of identifying a deletion set of files illustrated in FIG. 2, according to an embodiment; and
FIG. 7 is a flow diagram of a method of creating a set of files for deletion for use in the method of identifying a deletion set of files illustrated in FIG. 2, according to an embodiment.



DETAILED DESCRIPTION OF THE DRAWINGS
The illustrated embodiments below provide an improved method for optimizing selection of files for deletion from one or more data storage devices to free up a predetermined amount of space in the one or more data storage devices. The method includes analyzing an effective space occupied by each file of a plurality of files in the one or more data storage devices, identifying, from the plurality of files, one or more data blocks making up a file to free up the predetermined amount of space based on the analysis of the effective space of each file of the plurality of files, selecting one or more of the plurality of files as one or more candidate files for deletion, based on the identified one or more data blocks, and deleting the one or more candidate files for deletion from the one or more data storage devices. Systems and physical computer program products are also provided.
FIG. 1 is a block diagram of a computer 152, according to an embodiment. Computer 152 includes at least one computer processor 156 or CPU and random access memory (RAM) 168. RAM 168 is made up of one or more data storage devices. For example, the devices include cache memory devices, dynamic RAM devices, and the like. In other embodiments, RAM 168 includes numerous physical devices for storing memory that are partitioned into different DRAM locations. Each location can be identified by block number, row, column, and/or another location identifier. RAM 168 is connected through a high speed memory bus 166, a bus adapter 158, and a front side bus 162 to processor 156 and to other components of computer 152. RAM 168 includes programming and/or software such as an operating system 154 responsible for execution of applications and/or programs and for administration of access to computer resources, memory, processing times, and I/O functions, on behalf of application programs.
In an embodiment, computer 152 includes a disk drive adapter 172 coupled through expansion bus 160 and bus adapter 158 to processor 156 and other components of computer 152. Disk drive adapter 172 connects non-volatile data storage to computer 152 in the form of disk drive 170. Non-volatile computer memory also may be implemented for as an optical disk drive, electrically erasable programmable read-only memory (so-called “EEPROM” or “Flash” memory), RAM drives, and so on, as known by those of skill in the art.
Computer 152 also includes a communications adapter 167, input/output (I/O) adapter 170, and video adapter 209, in an embodiment. Communications adapter 167 is configured for data communications with other computers 182 and for data communications with a data communications network 100. Such data communications may be carried out serially through RS-232 connections, through external buses such as a Universal Serial Bus (USB), through data communications networks such as IP data communications networks, and in other ways as known by those of skill in the art. Communications adapter 167 implements a hardware level of data communications through which one computer sends data communications to another computer, directly or through a data communications network. Examples of communications adapters useful for analyzing simulated operation of a computer according to embodiments of the present invention include modems for wired dial-up communications, Ethernet (IEEE 802.3) adapters for wired data communications network communications, and 802.11 adapters for wireless data communications network communications.
I/O adapters 178 implement user-oriented input/output through, for example, software drivers and computer hardware for controlling output to display devices such as computer display screens, as well as user input from user input devices 181 such as keyboards and mice. Video adapter 209 is an example of an I/O adapter specially designed for graphic output to a display device 180 such as a display screen or computer monitor. Video adapter 209 is connected to processor 156 through a high speed video bus 164, bus adapter 158, and the front side bus 162, which is also a high speed bus.
To identify data stored in one or more of the data storage devices (e.g., RAM 168) for deletion, a clean up tool is provided that is configured to take into consideration the physical image of a file stored on one or more of the data storage devices before identifying the file as a candidate for deletion. For example, the tool is configured to examine, among other factors, deduplication data factors, the storage location of the file on a data storage device, and the contiguity of the file. In this way, free space requirement can be specified and met with particularity.
FIG. 2 is a flow diagram of a method 200 of identifying a deletion set of files, according to an embodiment. An amount of space required to be freed is predetermined at 202. In an embodiment, the space required to be freed is selected and set by an administrator. Alternatively, the space required to be freed is pre-selected as part of a software routine or other automated process. Next, information tables are updated at 204. The information tables include a file clean up information table (Table 1 via method 300), an interdeduplicated block information table (Table 2 via method 400), and an interdeduplicated file information table (Table 3 via method 600). As referred to herein, the “file cleanup information table” is a table or other mechanism for storing data entries for each file output by method 200. As referred to herein, the “interdeduplicated block information table” refers to a table or other mechanism for storing data related to the locations of deduplication block chunk and the specific files associated with the deduplication block chunks. As referred to herein, the “interdeduplicated file information table” refers to a table or other mechanism for storing data related to deduplication peers of a file. After the information tables are updated, a deletion set of files is obtained at 206. Next, a determination is made as to whether automatic cleanup is enabled at 208. If automatic cleanup is not enabled at 208, then the deletion set of files is deleted at 210 from the one or more data storage devices. If automatic cleanup is enabled at 208, then the deletion set of files is outputted at 212. In an embodiment, the deletion set of files is outputted to the administrator.
Turning now to FIG. 3, a flow diagram is provided for a method 300 of building the file cleanup information table (“Table 1”) referred to at 204, according to an embodiment. First, a list of files to be cleaned up (“SETFILE 1”) is obtained at 302. The list of files to be cleaned up is selected by the administrator, in an embodiment. In another embodiment, the list of files to be cleaned up is automatically selected as part of the software routine. Next, Table 1 is created and an entry is inserted into Table 1 for each file in the list of files to be cleaned up at 304. File size and file block data are collected and the collected data are inserted into Table 1 for each SETFILE 1 at 306. The file size and file block data are obtained from a file system stored in RAM (e.g., RAM 168) or stored as another part of the computer, in an embodiment. Next, a list of deduplicated blocks is obtained and inserted into Table 1 at 308. The deduplicated block data is obtained from a deduplication engine, in an embodiment. The deduplication engine is stored in RAM or another storage device in the computer, in an embodiment. Device information and block location are obtained for each SETFILE 1 and inserted into Table 1 at 310. Such information is obtained from a device manager, in an embodiment. Next, a determination is made as to whether all files from the list of files to be cleaned (e.g., SETFILE1) have been examined at 312. If not, the method iterates at 304. If so, the method ends.
Sample Table 1 depicts a portion of a file cleanup information table, according to an embodiment.












TABLE 1





File
Size
Device
File
Dedup Block
Dedup Block


Name
kB
Name
Location
Count
Numbers




















File 1
200
Device 1
Outer tracks
10
11-20


File 2
300
Device 2
Inner tracks
10
31-40


File 3
400
Device 1
Middle tracks
5
11-15


File 4
100
Device 1
Outer Track
5
16-20


File 5
150
Device 1
Outer Track
5
25-29


File 6
150
Device 2
Outer Track
10
31-40


File 7
150
Device 2
Outer Track
0
—









Here, each file, Files 1-7, include entries in Table 1. Files 1-7 make up a cleanup subset (SETFILE1) of the total set of files in storage. Each entry includes the file size and the name of the device on which the file is included. For example, Files 1, 3, 4, and 5 are located on Device 1, while Files 2, 6, and 7 are located on Device 2. Additionally, locations of the files on the devices are listed in an adjacent column. In an embodiment, Files 1, 4, and 5 are located on an outer track of Device 1, File 3 is located on a middle track of Device 1, File 2 is located on an inner track of Device 2, and File 7 is located on an outer track of Device 2. In another column of Table 1, the number of deduplicated blocks of the files which are shared by other files are also included. For instance, File 1 shares 10 blocks (i.e., blocks 11-20 on Device 1) with another file, File 2 shares 10 blocks (i.e., blocks 31-40 on Device 2) with another file, File 3 shares 5 blocks (i.e., blocks 11-15 on Device 1) with another file (as can be seen, File 1), File 4 shares 5 blocks (i.e., blocks 16-20 on Device 1) with another file, File 5 shares 5 blocks (i.e., blocks 25-29 on Device 1) with another file, File 6 shares 10 blocks (i.e., blocks 31-40 on Device 2) with another file (as can be seen in Table 2, File 2), and File 7 has no blocks shared with any other file.
Concurrently, before or after the file cleanup information table (Table 1) is created, the interdeduplicated block information table is produced as part of 204 of method 200. FIG. 4 is a flow diagram of a method 400 of creating an interdeduplicated block information table (“Table 2”), according to an embodiment. To build Table 2, each file in the list of files to be cleaned up (e.g., SETFILE1 as referred to above in method 300) is examined at 402 and deduplicated blocks (“BLOCK1”) of each file included in SETFILE1 are identified at 404. For each deduplicated block, a determination is made as to whether an entry for the deduplicated block BLOCK1 is included in Table 2 at 406. If so, the method 400 iterates at 402. If not, an entry is created and included in Table 2 at 408. Next, a list of logical blocks (“BLOCKLIST1”) pointing to the deduplicated blocks is obtained at 410. For example, the BLOCKLIST1 is retrieved from the deduplication engine. Then, a list of the files (“FILELIST”) pointing to the deduplicated blocks from BLOCKLIST1 is obtained at 412, for example, by consulting the file system. A determination is then made as to whether the list of files FILELIST includes files that are not listed in Table 1 at 414. If not, then the block is identified as an interdeduplicated block and an examination is made according to method 500 below as to whether the block can be purged with other blocks listed in Table 2 at 416. If so, the block is purged preferably as a single chunk along with other blocks identified as interdeduplicated at 418. As used herein, the term “interdeduplicated” is defined as a block that is shared by more than one file that is included in the list of files to be cleaned up (i.e., SETFILE1). If the list of files includes those that are not listed in SETFILE1, then the block is identified as being non-interdeduplicated, and an examination is made according to method 500 below as to whether the block can be purged with other blocks in Table 2 at 420. If so, the block is purged preferably as a single chunk along with other blocks identified by method 500 at 422. If not, then another list of the files (“FILELIST1”) not included in FILELIST but that point to the non-interdeduplicated blocks is created at 424 and a query is presented as to the expiry date of each file in the FILELIST1 to identify the most expired file at 426.
Sample Table 2 below is a portion of an interdeduplication block information table, according to an embodiment.












TABLE 2








File
Outside
Outside


Device
Start Block #
End Block#
List
Dedup
Expiry







Device 1
11
15
File 1
No
—





File 3


Device 1
16
20
File 3
No
No





File 4


Device 1
25
29
File 5
Yes
Sep. 01, 2012


Device 2
31
40
File 2
No
No





File 6









Devices are listed in the far left column of Table 2. Each entry includes the start block and an end block of each data chunk. For example, various chunks of data made up of blocks are stored on Device 1. In an embodiment, Device 1 has a chunk of data beginning at block 11 and ending at block 15, which is referenced by File 1 and File 3, is not referred to by outside deduplicated files and hence, has no outside deduplicated file having an expiration date. Chunk of data from blocks 16 to 20 is referenced by Files 1 and 4, is not referred to by outside deduplicated files, and has no outside deduplicated file having an expiration date. Chunk of data located at blocks 25 to 29 is referenced to by File 5, and has another file that is outside of the cleanup subset of files (Table 1). That outside file has an expiration date of Sep. 1, 2012. Device 2 has a chunk of data on blocks 31 to 40 that is referenced to by Files 2 and 6, is not referred to by outside deduplicated files, and has no outside deduplicated file having an expiration date.
Returning to method 400, FIG. 5 is a flow diagram of a method 500 of determining disk contiguity of a file for use at 414 and 416, according to an embodiment. In particular, the method 400 updates the start and end blocks of each file FILE1 in Table 1. At 502, for a given block (“BLOCK1”), n is set as the block number, P_FILELIST is a list of files pointing to BLOCK1, BLOCK_NEXT is the next, consecutively numbered block after BLOCK1 (i.e., n+1) and BLOCK_PREV is the previous, consecutively numbered block before BLOCK1 (i.e., n−1). A first entry (“Entry1”) is located in Table 2, where BLOCK_PREV is identified as the end block number and P_FILELIST of BLOCK_PREV matches with what is listed in FILELIST at 504. Additionally, a second entry (“Entry2”) is located in Table2 with BLOCK_NEXT identified as the start block number and where P_FILELIST of BLOCK_NEXT matches with what is listed in FILELIST of the entry at 504. At 506, a determination is made as to whether both Entry1 and Entry2 exist at 504. If both exist, then the starting block for Entry1_START is changed to Entry1, and the ending block for Entry2_END is changed to Entry2, while Entry1 and Entry2 are deleted at 508. A new entry is created in Table2 with Entry1_START as a start block and Entry_END as an end block and the remaining fields the same at 506.
Returning to 506, if one or both of Entry1 and Entry2 do not exist, then a determination is made as to whether only Entry1 exists at 510. If so, EndBlock of Entry1 is changed to BLOCK1 at 512. If not, a determination is made as to whether only Entry2 exists at 514. If not, no changes are made. If so, StartBlock of Entry2 is changed to BLOCK1 at 516.
With reference to 204 of method 200, concurrently, before or after one or both of the file cleanup information table and/or the interdeduplicated block information table are created, a table including interdeduplicated file sets is produced. FIG. 6 is a flow diagram of a method 600 of obtaining interdeduplicated file sets for building Table 3, according to an embodiment. For each file in the set of files to be cleaned up (e.g. SETFILE1 from Table 1) with a non-zero value for deduplicated blocks, a D_LIST1 is created listing the deduplicated blocks from SETFILE1 at 602. Next, an empty set (PEER_SET) is created for SETFILE1 at 604. For all files that are not included as part of SETFILE1 from Table1 (i.e., FILE2) that have non zero values for deduplicated blocks, a listing (i.e., D_LIST2) is created to include those files at 606. Next, a determination is made as to whether D_LIST2 is a subset of D_LIST1 at 608. If not, method 600 iterates at 606. If so, FILE2 is added to PEER_SET and D_LIST1 is changed so that D_LIST1 does not include D_LIST2 at 610. Subsequently, a determination is made as to whether D_LIST1 is empty at 612. If so, FILE1 and its PEER_SET is added to Table3 at 614. If not, a determination is made as to whether all other files in FILE2 have been examined at 616. If not, method 600 iterates at 606. If so, another determination is made as to whether all other files in FILE2 have been examined at 616. If so, method 600 ends. If not, method 600 iterates at 602.
Sample Table 3 below is an exemplary table including interdeduplicated file information.














File Name
PEER_SET









File 1
File3, File4



File 2
File6










Sample Table 3 shows that File 1 is an interdeduplicated file because File 1 has a peer set including File 3 and File 4, meaning the blocks making up File 1 are also referred to by Files 3 and 4. Referring back to Table 1, blocks 11-20 of File 1 on Device 1 overlap with blocks 11-15 of File 3 and blocks 16-20 of File 4 on Device 1. Similarly, File 2 has a peer set including File 6, which means that the blocks of File 2 are referred to by File 6 (e.g., blocks 31-40 of File 2 and blocks 31-40 of File 6 both on Device 2 overlap with each other).
As noted above in method 200, a deletion set of files is obtained at 206. To identify the deletion set of files, FIG. 7 illustrates a flow diagram of a method for creating a set of files for deletion, according to an embodiment. At 702, the predetermined amount of space required to be freed is obtained from step 202 and set to value “M”, an empty set is created as DEL_SET (i.e., the deletion set of files), and the total size all of the files from Table 1 is compared with M. If the total size is less than M, then all of the files from Table 1 is set to DEL_SET and method 700 ends.
If the total size is more than M, then an examination is made of the list of files from Table 1 (LIST1) having no deduplicated blocks at 704. Each FILE1 from LIST1 is examined at 706. From Table 1, if FILE1 resides on a high performance disk, is at a relatively easy to retrieve location, and is mostly contiguous, then FILE1 is added to DEL_SET at 708. The file size of FILE1 is set at n and is subtracted from M (e.g., Z=M−n). A determination is made as to whether Z in DEL_SET is less than or equal to 0 at 710. If so, then DEL_SET is identified as the set of files for deletion at 712 and method 700 ends.
If not, then an examination is made of the list of files from Table 2 (LIST2) having interdeduplicated blocks and no files that are not listed on Table 1 (FILE2) referring thereto at 714. Each FILE2 from LIST2 is examined at 716. From Table 1, if FILE2 resides on a high performance disk, is at a relatively easy to retrieve location, and is mostly contiguous, then the PEER_SET of FILE2 is retrieved from Table 3 at 718 and FILE2 and the files of PEER_SET are included in DEL_SET. Next, a determination is made as to whether subtracting the size of FILE2 (n1) and the total file size of the files in PEER_SET (n2) from the predetermined required amount of space (M) and adding the deduplicated block duplicate space (e.g., Z=M−n1−n2+deduplicated block duplicate space) is less than or equal to 0 at 720. If Z is equal to or less than zero, then DEL_SET is identified as the set of files for deletion at 712 and method 700 ends.
If Z is not equal to or less than zero, then method 700 iterates at 722 where an examination is made of the list of files from Table 3 (LIST3) having interdeduplicated blocks and files that are not listed on Table 1 (FILE2) referring thereto. Each FILE3 from LIST3 is examined at 724. From Table 1, if FILE3 resides on a high performance disk, is at a relatively easy to retrieve location, and is mostly contiguous, then the PEER_SET of FILE3 is retrieved from Table 3 at 726 and FILE3 and the files of PEER_SET are included in DEL_SET. Next, a determination is made as to whether subtracting the size of FILE3 (n1) and the total file size of the files in PEER_SET (n2) from the predetermined required amount of space (M) and adding the deduplicated block duplicate space and the outside deduplicated block space (e.g., Z=M−n1−n2+deduplicated block duplicate space+the outside deduplicated block space) is less than or equal to 0 at 728. If so, then DEL_SET is identified as the set of files for deletion at 712 and method 700 ends. If Z is not equal to or less than zero, then method 700 iterates at 730 and the remaining files from LIST1, LIST2 and LIST3 are selected in sequence until Z is less than or equal to zero.
By identifying a set of candidate files for deletion by considering the physical image of the files to be cleaned, selection of such candidate files suitable for meeting a free space requirement is optimized. The methods described above can be implemented as an application or tool (“cleanup tool”) that interacts with existing deduplication logic to obtain data related to the files to be cleaned. The existing deduplication logic can export an application program interface that provide such data to the cleanup tool. The cleanup tool can also interact with a device manager to obtain information related to the actual storage devices where the files to be cleaned are stored, including physical block location, track location, and/or disk location.
As will be appreciated by one of ordinary skill in the art, aspects of the present invention may be embodied as a system, method, or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module,” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer-readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more computer-readable medium(s) may be utilized. The computer-readable medium may be a computer-readable signal medium or a physical computer-readable storage medium. A physical computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, crystal, polymer, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Examples of a physical computer-readable storage medium include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, RAM, ROM, an EPROM, a Flash memory, an optical fiber, a CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer-readable storage medium may be any tangible medium that can contain, or store a program or data for use by or in connection with an instruction execution system, apparatus, or device.
Computer code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, radio frequency (RF), etc., or any suitable combination of the foregoing. Computer code for carrying out operations for aspects of the present invention may be written in any static language, such as the “C” programming language or other similar programming language. The computer code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, or communication system, including, but not limited to, a local area network (LAN) or a wide area network (WAN), Converged Network, or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present invention are described above with reference to flow diagrams and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flow diagrams and/or block diagrams, and combinations of blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flow diagram and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instructions which implement the function/act specified in the flow diagram and/or block diagram block or blocks. The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flow diagram and/or block diagram block or blocks.
The flow diagrams and block diagrams in the above figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flow diagrams or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flow diagrams, and combinations of blocks in the block diagrams and/or flow diagram, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

## Claims

1. A system for optimizing selection of files for deletion to free up a predetermined amount of space comprising:
one or more data storage devices; and
a processor in operable communication with the one or more data storage device:
analyzing an effective space occupied by each file of a plurality of files on the one or more data storage devices;
identifying, from the plurality of files, one or more data blocks of a file to free up the predetermined amount of space based on the analysis of the effective space of each file of the plurality of files;
selecting one or more of the plurality of files as one or more candidate files for deletion, based on the identified one or more data blocks;
deleting the one or more candidate files for deletion from the one or more data storage devices;
after the plurality of files have undergone a deduplication process, determining whether the one or more data blocks is pointed to by an other file other than an instant file of the plurality of files being examined; and
choosing the instant file, if the one or more data blocks is not pointed to by the other file and if the instant file occupies space equal to or greater than the predetermined amount of space as the one or more candidate files for deletion.

2. The system of claim 1, wherein the processor is further:
determining disk contiguity of each file of the plurality of files; and
designating most-contiguous files from the plurality of files occupying space equal to or greater than the predetermined amount of space, as the one or more candidate files for deletion.

3. The system of claim 1, wherein the processor is further:
after the plurality of files have undergone a deduplication process, determining whether the one or more data blocks is pointed to by an other file other than an instant file of the plurality of files being examined, and if not, whether the instant file occupies space equal to or greater than the predetermined amount of space;
classifying the instant file according to location;
determining disk contiguity of the instant file; and
designating the instant file as the one or more candidate files for deletion based on file location and disk contiguity.

4. The system of claim 3, wherein the processor, as part of selecting includes after the step of determining whether one or more data blocks is pointed to and before the step of determining disk contiguity:
analyzing a clean-up subset of files included in the plurality of files;
examining whether the other file other than the instant file is included as part of the clean-up subset of files; and
choosing the instant file as the one or more candidate files for deletion, if the other file is included as part of the clean-up subset of files.

5. The system of claim 1, wherein the processor is further:
analyzing a clean-up subset of files included in the plurality of files;
after the plurality of files have undergone the deduplication process, determining whether the one or more data blocks is pointed to by an other file other than an instant file of the plurality of files being examined;
examining whether the other file other than the instant file is included as part of the clean-up subset of files; and
choosing the instant file as the one or more candidate files for deletion, if the other file is included as part of the clean-up subset of files and the instant file occupies space equal to or greater than the predetermined amount of space.

6. The system of claim 5, wherein the processor is further:
if the other file is outside of the clean-up subset of files, determining whether the other file has an expiration date within a predetermined expiration date range; and
choosing the instant file, if the other file has the expiration date within the predetermined expiration date range and occupies space equal to or greater than the predetermined amount of space, as the one or more candidate files for deletion.

7. The system of claim 1, wherein the processor is further:
classifying the one or more candidate files for deletion according to location; and
designating the one or more candidate files for deletion based on location.

8. The system of claim 7, wherein the processor is further: classifying the one or more candidate files for deletion according to disk location.

9. The system of claim 7, wherein the processor is further: classifying the one or more candidate files for deletion according to track location.

10. A non-transitory physical computer-readable storage medium comprising a computer program product for implementing a method of optimizing selection of files for deletion from one or more data storage devices to free up a predetermined amount of space in the one or more data storage devices, the method comprising:
analyzing an effective space occupied by each file of a plurality of files in the one or more data storage devices;
identifying, from the plurality of files, one or more data blocks making up a file to free up the predetermined amount of space based on the analysis of the effective space of each file of the plurality of files;
selecting one or more of the plurality of files as one or more candidate files for deletion, based on the identified one or more data blocks;
deleting the one or more candidate files for deletion from the first storage pool;
after the plurality of files have undergone a deduplication process, determining whether the one or more data blocks is pointed to by an other file other than an instant file of the plurality of files being examined; and
choosing the instant file, if the one or more data blocks is not pointed to by the other file and if the instant file occupies space equal to or greater than the predetermined amount of space, as the one or more candidate files for deletion.

11. The non-transitory physical computer-readable storage medium of claim 10, wherein identifying includes:
classifying the one or more candidate files for deletion according to location; and
designating the one or more candidate files for deletion based on location.

12. The non-transitory physical computer-readable storage medium of claim 10, wherein identifying includes:
analyzing a clean-up subset of files included in the plurality of files;
after the plurality of files have undergone a deduplication process, determining whether the one or more data blocks is pointed to by an other file other than an instant file of the plurality of files being examined;
examining whether the other file other than the instant file is included as part of the clean-up subset of files; and
choosing the instant file as the one or more candidate files for deletion, if the other file is included as part of the clean-up subset of files and the instant file occupies space equal to or greater than the predetermined amount of space.

13. The non-transitory physical computer-readable storage medium of claim 12, wherein identifying includes:
if the other file is outside of the clean-up subset of files, determining whether the other file has an expiration date within a predetermined expiration date range; and
choosing the instant file, if the other file has the expiration date within the predetermined expiration date range and occupies space equal to or greater than the predetermined amount of space, as the one or more candidate files for deletion.