Disk buffer
A disk buffer is a small amount of space on a hard drive used for volatile memory operations. Most hard disks usually have between 8 and 256 megabytes of such memory. It is the first partition on a hard drive.
Uses
[change | change source]Reading or writing data
[change | change source]When writing data to the disk, the data needs to be written to a certain position on the disk. This is done by a component called disk read/write head. This head needs to be moved to (or near) the correct track. After some settling time the read head begins to pick up bits. Usually, the first sectors to be read are not the ones that have been requested by the operating system. The disk's embedded computer typically saves these unrequested sectors in the disk buffer, in case the operating system requests them later.
Speed
[change | change source]The disk is attached to the computer by what is called an I/O interface. This interface almost always works at a different speed than that of the hard disk platter. In such a case, the disk buffer is used to store the data that comes from the disk, before it sent to the computer, or to store the data that comes from the computer before it can be written to the disk.
Command queuing
[change | change source]Modern disks often have a feature called command queuing. This is called TCQ (Tagged Command Queuing) when used with SCSI disks, and NCQ (Native Command Queuing) when used with SATA disks.
Command queueing enables many commands to be sent at the same time; the hard disk is then responsible for putting them into the correct order. To store the commands and re-order them, the hard disk needs the disk buffer.