Patent ID: 7167964

Claim:
Method for defragmenting a memory device ( 34 ) in which device a number of valid data blocks ( 8 ) are copied sequentially and stepwise as a sequence of copy chunks from a first position to a second, optimized position in said memory device ( 34 ), the method comprising the steps of: using at least two sets of descriptors in an alternating manner, each set of descriptors being used for defining the source location and target location of respective copy chunks being copied during a first copy operation and the location of the destination of a second copy operation subsequent to the first copy operation; the set of descriptors defining the copy chunk currently being copied being updated to define a later copy chunk to be copied only after said copy chunk currently being copied has been successfully copied and another one of said sets of descriptors is being used to define a next copy chunk being copied, wherein one of the sets of descriptors always holds information used for restoring the contents of the copy chunk currently being copied in case of a power break during the copying thereof.