Virtual Hard Disk Image Shrinking via Garbage Block Relocation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Virtual hard disk image files, particularly dynamic and differencing types, do not reduce in size even after data deletion, leading to wasted storage space as the occupied space is not reclaimed.
Innovation Solution
A method and apparatus that identify and move effective data blocks to the positions of garbage data blocks, updating the block allocation table records, and then delete the unused space at the end of the file, effectively shrinking the file size.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of substance
If data is deleted from dynamic or differencing hard disk image files, then storage space should be reclaimed, but the file size does not reduce and storage space is wasted
Solution Approach 1:
The patent performs preliminary identification of garbage data blocks before actual file shrinking. By using bitmaps to pre-mark deleted data blocks and sectors, the system prepares the necessary information structure in advance, enabling efficient subsequent processing of file size reduction without encountering unprepared data structures during the shrinking operation.
Solution Approach 2:
The patent divides the hard disk image file into discrete data blocks and further segments them into sectors with individual bitmap tracking. This segmentation allows the system to identify and process garbage data at multiple granularities (block level and sector level), enabling precise reclamation of only the necessary storage space while maintaining the integrity of remaining data structures.
2Reliability
If the file structure maintains fixed block allocation, then data integrity is preserved, but storage efficiency decreases when data is deleted
Solution Approach 1:
The patent extracts the bitmap structure from the traditional fixed block allocation system. By maintaining separate bitmap records that track the status of each sector within data blocks, the system separates the allocation structure from the data storage structure. This allows garbage data blocks to be identified and removed for shrinking the file while the remaining valid data blocks maintain their integrity through the updated bitmap references.
Solution Approach 2:
The patent introduces dynamic tracking of data block status through bitmaps that can be updated in real-time as data is written or deleted. This dynamic structure allows the file system to adapt to changing data states, marking blocks as garbage when data is deleted and enabling subsequent shrinking operations to reclaim space while maintaining reliability of active data through continuous bitmap validation.
3Volume of stationary object
If garbage data blocks are identified and moved, then file size can be reduced, but processing time and computational resources increase
Solution Approach 1:
The patent performs preliminary identification of garbage data blocks using bitmap comparison before the actual file shrinking operation. By pre-marking deleted sectors and identifying garbage blocks in advance, the system prepares a clear roadmap for the shrinking process, avoiding the need for complex real-time analysis during the actual file size reduction and significantly reducing processing time.
Solution Approach 2:
The patent uses bitmap copies to track the status of data blocks and sectors. By maintaining and comparing bitmap representations rather than analyzing actual data block contents, the system efficiently identifies garbage blocks through simple bitwise operations. This copying approach to data status tracking dramatically reduces the computational resources and time required for garbage identification compared to direct data block analysis.
Data Source
AI summary
The present disclosure introduces a method and an apparatus of shrinking virtual hard disk image file. The present techniques search a garbage data block in a file and revise a record of the garbage data block in a block allocation table (BAT). The file includes one or more data blocks and a BAT that records information of each data block. The garbage data block is a data block that does not store effective data. The present techniques move an effective data block subsequent to the garbage data block, revise a record of the effective data block in the BAT after the moving, and shrink a size of the file after the movement.


