A method of generating an image file may generate corresponding image
files from data units in a first storage device of a source. The method
of generating an image file includes generating an image file head
according to hardware parameter information of the first storage device;
partitioning the first storage device into a plurality of data units with
the same size; performing a compression process to compress data in the
data units, respectively, thereby generating corresponding compressed
data blocks; sequentially storing the compressed data blocks in a data
area of the image file; creating an index table to use an index value to
record start positions of the data units in the first storage device and
positions of the compressed data blocks in the data area into the index
table; and creating a file foot information to mark a file length of the
image file.