Two-pass defragmentation of compressed hard disk data with a single data rewrite
First Claim
1. A method for defragmenting compressed data stored in files in non-adjacent variable-length clusters on a disk having a beginning and an end, each cluster comprising at least one sector, said method comprising the steps of:
- maintaining a first data structure having an entry for each file stored on the disk, each entry identifying the cluster in which the first portion of the file data is contained;
maintaining a second data structure having an entry for each cluster on the disk, each entry identifying another cluster in which the next portion of the file data is contained;
maintaining a third data structure having an entry for each cluster on the disk, each entry identifying the sectors in which the file data of each respective cluster is contained;
rearranging the second and third data structures such that the respective entries for each file are located in adjacent clusters starting from the beginning of the disk;
updating the first data structure entries as necessary responsive to said step of rearranging the second and third data structures; and
rearranging the file data on the disk such that the file data is located in adjacent clusters as determined by the rearranged second and third data structures;
wherein file data is not moved during said step of rearranging the second and third data structures.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for defragmenting compressed file data stored on a disk. The method includes a first pass in which the FAT and MDFAT entries for each file stored on the disk are rearranged into adjacent clusters, but in which no movement of the compressed file data occurs. The method includes a second pass in which the actual compressed file data is rearranged on the disk in accordance with the FAT and MDFAT entries. A reference point is identified within the disk storage space such that no compressed file data will be stored beyond the reference point after the second pass is completed. During the rearrangement of data during the second pass, compressed file data is temporarily relocated beyond the reference point if possible. During all movements of compressed file data, the method transfers as much data as can be stored within the space to which the data is to be moved.
-
Citations
43 Claims
-
1. A method for defragmenting compressed data stored in files in non-adjacent variable-length clusters on a disk having a beginning and an end, each cluster comprising at least one sector, said method comprising the steps of:
-
maintaining a first data structure having an entry for each file stored on the disk, each entry identifying the cluster in which the first portion of the file data is contained; maintaining a second data structure having an entry for each cluster on the disk, each entry identifying another cluster in which the next portion of the file data is contained; maintaining a third data structure having an entry for each cluster on the disk, each entry identifying the sectors in which the file data of each respective cluster is contained; rearranging the second and third data structures such that the respective entries for each file are located in adjacent clusters starting from the beginning of the disk; updating the first data structure entries as necessary responsive to said step of rearranging the second and third data structures; and rearranging the file data on the disk such that the file data is located in adjacent clusters as determined by the rearranged second and third data structures; wherein file data is not moved during said step of rearranging the second and third data structures. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)
-
-
22. A method for defragmenting uncompressed file data stored in non-adjacent clusters on a disk having a beginning and an end, said method comprising the steps of:
-
maintaining a first data structure having an entry for each file stored on the disk, each entry identifying the cluster in which the first portion of the file data is contained; maintaining a second data structure having an entry for each cluster on the disk, each entry identifying another cluster in which the next portion of the file data is contained; rearranging the second data structure such that the respective entries for each file are located in adjacent clusters; updating the first data structure as necessary responsive to said step of rearranging the second data structure; rearranging the file data on the disk such that the file data is located in adjacent clusters, wherein the clusters in which the rearranged file data are stored is determined by the rearranged second data structure; wherein said step of rearranging the file data is initiated only after said step of rearranging the second data structure and said step of updating the first data structure have been completed; wherein said step of rearranging the file data comprises the steps of; determining whether any file data is obstructing current file data to be moved into a location as determined by the second data structure; moving obstructing file data to another location on the disk to create a vacant portion of disk space in which to store the current file data; moving current file data into the vacant portion of disk space; wherein said step of moving the obstructing file data comprises the steps of; identifying a reference point at a predetermined location on the disk; scanning forward from the reference point toward the end of the disk until a vacant portion of disk space large enough to store the obstructing file data is identified; moving the obstructing data into the vacant portion of disk space; wherein the reference point is located at a location on the disk such that no file data is stored between the reference point and the end of the disk after said step of rearranging the file data has completed.
-
-
23. A system for defragmenting compressed data stored in files in non-contiguous clusters on a disk having a beginning and an end, each cluster comprising at least one sector, said system comprising:
-
a computer having a memory; an operating system stored within said memory; a magnetic disk drive connected to said computer for storing compressed files including compressed file data; a compression device driver for facilitating communication between said operating system and said compressed file data on said disk drive; and a defragmentation program stored within said operating system; wherein said disk drive comprises; first means for maintaining a first data structure having an entry for each file stored on said disk, each said entry identifying the cluster in which the first portion of said file data is contained; second means for maintaining a second data structure having an entry for each cluster on said disk, each said entry identifying another cluster in which the next portion of said file data is contained; third means for maintaining a third data structure having an entry for each cluster on the disk, each said entry identifying the sectors in which the file data of each respective cluster is contained; fourth means for rearranging said second and third data structures such that the respective entries for each said file are located in adjacent clusters starting from the beginning of said disk; fifth means for updating said first data structure entries as necessary responsive to said rearrangement of said second and third data structures; and sixth means for rearranging said file data on said disk such that said file data is located in adjacent clusters as determined by said rearranged second and third data structures; wherein said file data is not moved during said rearrangement of said second and third data structures. - View Dependent Claims (24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)
-
Specification