Method and system for facilitating low-cost high-throughput storage for accessing large-size I/O blocks in a hard disk drive
A system is provided to receive a first request to write data to an HDD which comprises a plurality of platters with corresponding heads, wherein a respective platter includes a plurality of tracks. The system aligns the heads at a same first position on a first track of each platter, and distributes the data as a plurality of data sectors to track sectors located at the same first position on the first track of each platter. The system then receives a second request to read the data from the HDD, and aligns the heads at a same random position on the first track of each platter. Subsequently, the system reads, during a single rotation of the platters, all data stored on the first track of each platter, stores the read data in a data buffer, and reshuffles the read data in the data buffer to obtain the requested data.
1. A computer-implemented method, comprising:
receiving a first request to write data to a hard disk drive (HDD) which comprises a plurality of platters with corresponding heads, wherein a respective platter includes a plurality of tracks;
aligning the heads at a same first position on a first track of each platter;
writing the data to the platters by distributing the data as a plurality of data sectors to track sectors located at the same first position on the first track of each platter;
receiving a second request to read the data from the HDD;
identifying the first track as a location at which the data is stored;
aligning the heads at a same random position on the first track of each platter;
reading, during a single rotation of the platters and beginning from the same random position, all data stored on the first track of each platter;
storing the read data in a data buffer; and
reshuffling the read data in the data buffer to obtain the data requested in the second request.
2. The method of claim 1 , further comprising:
receiving a third request to read the data from the hard disk drive, wherein the data requested in the third request is stored in the first track of each platter;
determining that the data requested in the third request is stored in the data buffer;
retrieving the data requested in the third request from the data buffer without reading the data stored in the first track of each platter; and
returning the retrieved data.
3. The method of claim 1 ,
wherein aligning the heads at the same first position or the same random position comprises activating a plurality of arms associated with the plurality of platters of the hard disk drive, wherein a respective arm is attached to a corresponding head of a respective platter, and
wherein writing the data to the platters by distributing the data as a plurality of data sectors is based on a logical block address associated with a respective data sector.
4. The method of claim 1 , wherein a respective track includes a plurality of pre-allocated spare sectors for remapping data stored in a faulty sector of the respective track.
5. The method of claim 1 ,
wherein the data buffer is maintained by the hard disk drive or a host; and
wherein reshuffling the read data in the data buffer is performed by the hard disk drive or the host.
6. The method of claim 1 , further comprising:
writing replicas of the data to other hard disk drives of a distributed storage system,
wherein the replicas are written by distributing a respective replica as a plurality of data sectors to track sectors located at a same second position on a second track of each platter of a respective other hard disk drive;
receiving a third request to read the data stored in the distributed storage system;
obtaining a unique portion of the data requested in the third request from each of the hard disk drives on which the data or replicas of the data are stored;
concatenating the unique portions in a correct order to form the data requested in the third request; and
returning the concatenated data in response to the third request.
7. The method of claim 6 ,
wherein the unique portion of the data obtained from each of the hard disk drives is determined by a file system of the distributed storage system, and
wherein the concatenation of each unique portion comprises an entirety of the data requested in the third request.
8. A computer system, comprising:
a processor; and
a memory coupled to the processor and storing instructions which, when executed by the processor, cause the processor to perform a method, the method comprising:
receiving a first request to write data to a hard disk drive (HDD) which comprises a plurality of platters with corresponding heads, wherein a respective platter includes a plurality of tracks;
aligning the heads at a same first position on a first track of each platter;
writing the data to the platters by distributing the data as a plurality of data sectors to track sectors located at the same first position on the first track of each platter;
receiving a second request to read the data from the HDD;
identifying the first track as a location at which the data is stored;
aligning the heads at a same random position on the first track of each platter;
reading, during a single rotation of the platters and beginning from the same random position, all data stored on the first track of each platter;
storing the read data in a data buffer; and
reshuffling the read data in the data buffer to obtain the data requested in the second request.
9. The computer system of claim 8 , wherein the method further comprises:
receiving a third request to read the data from the hard disk drive, wherein the data requested in the third request is stored in the first track of each platter;
determining that the data requested in the third request is stored in the data buffer;
retrieving the data requested in the third request from the data buffer without reading the data stored in the first track of each platter; and
returning the retrieved data.
10. The computer system of claim 8 ,
wherein aligning the heads at the same first position or the same random position comprises activating a plurality of arms associated with the plurality of platters of the hard disk drive, wherein a respective arm is attached to a corresponding head of a respective platter, and
wherein writing the data to the platters by distributing the data as a plurality of data sectors is based on a logical block address associated with a respective data sector.
11. The computer system of claim 8 , wherein a respective track includes a plurality of pre-allocated spare sectors for remapping data stored in a faulty sector of the respective track.
12. The computer system of claim 8 ,
wherein the data buffer is maintained by the hard disk drive or a host; and
wherein reshuffling the read data in the data buffer is performed by the hard disk drive or the host.
13. The computer system of claim 8 , wherein the method further comprises:
writing replicas of the data to other hard disk drives of a distributed storage system,
wherein the replicas are written by distributing a respective replica as a plurality of data sectors to track sectors located at a same second position on a second track of each platter of a respective other hard disk drive;
receiving a third request to read the data stored in the distributed storage system;
obtaining a unique portion of the data requested in the third request from each of the hard disk drives on which the data or replicas of the data are stored;
concatenating the unique portions in a correct order to form the data requested in the third request; and
returning the concatenated data in response to the third request.
14. The computer system of claim 13 ,
wherein the unique portion of the data obtained from each of the hard disk drives is determined by a file system of the distributed storage system, and
wherein the concatenation of each unique portion comprises an entirety of the data requested in the third request.
15. An apparatus, comprising:
a non-volatile memory of a hard disk drive,
wherein the hard disk drive comprises a plurality of platters with corresponding heads, wherein a respective platter includes a plurality of tracks; and
a controller configured to:
receive a first request to write data to the hard disk drive;
align the heads at a same first position on a first track of each platter; and
write the data to the platters by distributing the data as a plurality of data sectors to track sectors located at the same first position on the first track of each platter;
receive a second request to read the data from the HDD;
identify the first track as a location at which the data is stored;
align the heads at a same random position on the first track of each platter;
read, during a single rotation of the platters and beginning from the same random position, all data stored on the first track of each platter;
store the read data in a data buffer; and
reshuffle the read data in the data buffer to obtain the data requested in the second request.
16. The apparatus of claim 15 , wherein the controller is further configured to:
receive a third request to read the data from the hard disk drive, wherein the data requested in the third request is stored in the first track of each platter;
determine that the data requested in the third request is stored in the data buffer;
retrieve the data requested in the third request from the data buffer without reading the data stored in the first track of each platter; and
return the retrieved data.
17. The apparatus of claim 15 ,
wherein a respective track includes a plurality of pre-allocated spare sectors for remapping data stored in a faulty sector of the respective track,
wherein aligning the heads at the same first position or the same random position comprises activating a plurality of arms associated with the plurality of platters of the hard disk drive, wherein a respective arm is attached to a corresponding head of a respective platter, and
wherein writing the data to the platters by distributing the data as a plurality of data sectors is based on a logical block address associated with a respective data sector.