Data storage refers to retention of data used for computing for some period of time.
Computer data can be stored in numerous ways, including the following:
A data storage device is a device for recording (storing) data.
Data storage hardware may hold data, process data, or both. Hardware that only holds data is a recording medium, such as:
Hardware that processes data (data storage equipment) is known as a storage device, and may either access a separate (removable) recording medium, such as a floppy disk, or a recording medium installed as a permanent component to store and retrieve information, such as a hard disk. Examples of storage devices are:
Electronic data storage is storage that requires electrical power to store and retrieve data. Most electronically processed recording media are considered permanent (non-volatile) storage: the data will remain stored when power is removed from the device. In contrast, most electronic recording media using semiconductor microcircuits are volatile storage: the data will vanish when power is removed.
Storage of computer data can be classified as either primary storage or secondary storage.
A computer's central processing unit (CPU) interfaces with the rest of the computer as illustrated below:
Primary storage contains data that can be accessed directly by the computer's CPU via the data bus. Secondary storage must be transferred from an external device by the I/O interfacing circuitry into primary storage before it can be accessed by the CPU.
Primary storage consists of memory cells that the CPU can access by passing their addresses along the address bus. The memory can be classified as random access memory (RAM) or read only memory (ROM), as follows:
random access memory (RAM) |
Random access memory consists of memory cells. The CPU can access (read from or write to) a random cell directly by passing its unique address number along the address bus to refer to it. In a computer RAM is the working memory. Data can be read (retrieved) or written (stored) in RAM by providing the computer with an address location where the data is stored or where it is to be stored. When the data is no longer required it may be simply overwritten and the storage location can be used again for something else. Random access memory is volatile: i.e. the memory contents are lost when the computer is turned off. |
read only memory (ROM) |
Read only memory can be retrieved directly by the CPU but cannot be stored directly by the CPU. In a computer it is often useful to have frequently used instructions permanently stored. ROM provides the ability to do this without losing the programs and data when the computer is turned off. The programs and data can be provided in ROM, where the memory cannot be changed. Many complex functions, such as translators for high-level languages and operating systems are placed in ROM storage. Since these instructions are hardwired, they can be performed quickly and accurately. Another advantage of ROM is that the computer can contain programs tailored for its specific needs and have them installed permanently in ROM. Such programs are called microprograms or firmware. Read only memory is non-volatile: i.e. the memory contents remain unchanged when the computer is turned off. |
Computer software can be stored permanently as firmware in non-volatile primary storage media such as PROM (programmable read only memory) or ROM (read only memory) or semi-permanently in EPROM (erasable programmable read only memory) such as flash memory. It can be provided as a binary image that can be uploaded onto existing hardware.
Secondary storage, or auxiliary storage, is memory that cannot be accessed directly by the CPU. Programs and data can be stored in secondary storage for future use. Before a program in secondary storage is used, the data is read into primary storage. Secondary storage extends the storage capabilities of the computer system, and is required for two reasons:
A data storage device is used to hold permanent or semi-permanent data as secondary storage. Examples of secondary storage devices are:
One of the most common secondary storage devices is the hard drive. Many other devices, such as flash drives, employ an interface that replicates hard disk storage.
The physical structure of a disk is as follows:
The physical properties of a disk are as follows:
platter |
A hard disk contains one or more flat disks that are used to store data in the drive. These disks are called platters. They are composed of two main substances: a substrate material that forms the bulk of the platter and gives it structure and rigidity, and a magnetic media coating which stores the magnetic impulses that represent the data. A floppy disk contains only one flat disk used to store data. |
read/write head |
Data is stored to and retrieved from the surface of a platter by a device called a read/write head. A platter has two sides and thus two surfaces on which data can be stored; usually there are 2 heads per platter - one on each side. A floppy drive contains one head to store and retrieve data on the single magnetic disk. A head is positioned on an actuator assembly which moves to enable the head to access different areas of the recording medium (the platter or floppy disk). |
track |
A track is one of the thin concentric circular strips on a floppy medium or platter surface which actually contain the magnetic regions of data written to a disk drive. A track is the intersection of a head and a cylinder. |
cylinder |
A cylinder comprises all the tracks (on every usable platter surface) that can be accessed by the read/write heads while the actuator assembly remains stationary. |
geometric sector |
Geometrically, a sector is defined as a “pie-slice” part of a circle, or the area between two radii and the connecting arc of the circle. Data stored on a disk is referenced by the intersection of a track and a geometric sector, known as a data sector. |
data sector |
In the context of data storage, a data sector, often called a block, is a subdivision of a track on disk media. It refers to the intersection of a track and a geometric sector. Each sector stores a fixed amount of data. Typical formatting of disk media provides space for 512 bytes of data per sector on a magnetic disk or 2048 bytes per sector on an optical disk. Devices other than disk drives, such as flash drives, also use the concept of sectors to describe units of data storage. |
cluster |
In a filesystem, a cluster is the unit of space allocation for files and directories. In order to reduce the overhead of managing data, the filesystem allocates data in groups of sectors, known as clusters. For example, on a disk that uses 512-byte sectors, a 512-byte cluster would contain one sector, whereas a 4-kilobyte cluster would contain eight sectors. A cluster is the smallest amount of disk space that can be allocated to hold a file. Storing small files on a filesystem with large clusters therefore wastes disk space: the wasted space per file is statistically approximately half the cluster size. However, a larger cluster size reduces processing overhead and fragmentation, which can improve reading and writing speed. Typical cluster sizes range from 1 sector (512 B) to 128 sectors (64 KB). A cluster need not be physically contiguous on the disk; it may span more than one track or, if sector interleaving is used, may even be discontiguous within a track. |
CHS |
Cylinder-head-sector, also known as CHS, was an early method for giving addresses to each physical block of data on a hard disk. Using the CHS method, each block is addressed by means of a tuple which defines the cylinder, head, and geometric sector at which it appears on the hard disk. |
LBA |
Logical block addressing (LBA) is a common scheme used for specifying the location of blocks of data stored on computer storage devices, generally secondary storage systems such as hard disks. The term LBA can mean either the address or the block to which it refers. Logical blocks in modern computer systems are typically 512 or 1024 bytes each. ISO9660 CDs (and images of them) use 2048-byte blocks. LBA is a particularly simple addressing scheme; blocks are located by an index, with the first block being LBA = 0, the second LBA = 1 and so on. The LBA scheme replaces earlier schemes, such as CHS, which exposed the physical details of the storage device to the software of the operating system. |
A volume is a single accessible region of data that contains a single filesystem. It may exist in many forms and locations including:
A volume label is the name given by a filesystem to a particular volume.
In Unix, the following terms can be used to describe a volume's purpose:
root volume |
The root volume is the volume that contains the root filesystem. The root filesystem is the filesystem containing the root directory (/). |
boot volume |
The boot volume is the volume that contains the bootloader. |
kernel volume |
The kernel volume is the volume that contains the kernel image. |
Partitioning is the creation of separate divisions of a hard disk, flash drive or similar medium. Each partition is normally a volume. Directories and files of different categories may be stored in different volumes.
Media are partitioned for the following purposes:
Partitioning may be used to separate operating system files from user files.
A partition can be used as an area for operating system virtual memory swapping or paging.
Frequently used programs and data can be kept close to each other.
It is possible to keep cache and log files separate from other files. These can change size dynamically and rapidly, potentially filling a filesystem.
Partitioning enables multi-booting, which facilitates the existence of more than one operating system on a single computer. Various operating systems can be installed on different partitions of the same hard disk, providing a choice of which operating system to boot into at power-up.
Files may be protected or isolated to make it easier to recover a corrupted filesystem or operating system installation. If one partition is corrupted, none of the other filesystems are affected, and the data may still be salvageable. Having a separate partition for read-only data also reduces the chances of the file system on this partition becoming corrupted.
Partitioning can improve overall computer performance on systems where smaller filesystems are more efficient.
One partition on a recording medium can be set as the bootable partition or the active partition. The active partition normally contains the operating system to be used on the computer. Only one partition can be set as an active partition on a hard disk.
The terms volume and partition do not have the same meaning. For example, a floppy disk might be accessible as a volume, even though it does not contain a partition, as floppy disks cannot be partitioned. Also, an operating system can recognise a partition without recognising any volume associated with it, if it cannot interpret the filesystem stored there.
Examples of how data are stored on various devices are:
Device | Partitioned | Volumes |
---|---|---|
floppy drive | Cannot be partitioned. | The entire recording medium can contain only one volume. |
hard drive | Is always partitioned. | Each partition can contain a volume. |
flash drive | Is sometimes partitioned and sometimes not. | If not partitioned the entire recording medium can contain only one volume. If partitioned, each partition can contain its own volume. |
A boot sector is the first data sector (LBA = 0) in a recording medium that contains code for booting a program (usually, but not necessarily, an operating system) stored elsewhere in the recording medium.
On a PC-compatible computer the BIOS selects a boot device, then it reads and executes the first sector from the medium.
There are several major kinds of boot sectors on PC-compatible storage devices, including:
master boot record (MBR) |
A master boot record is the first sector of the recording medium in a data storage device that has been partitioned. The MBR may contain code to locate the active partition and invoke its volume boot record. |
volume boot record (VBR) |
A volume boot record is the first sector of the recording medium in a data storage device that has not been partitioned or the first sector of an individual partition on a recording medium that has been partitioned. It may contain code to load and invoke an operating system or a standalone program installed on that medium or within that partition. |
To be a valid boot sector, the two-byte hex word AA55, called the boot sector signature, must exist at the end of the sector; otherwise, either the BIOS or MBR code will report an error and halt the bootstrapping process.
A master boot record (MBR) is the boot sector of the partitioned recording medium in a data storage device such as a hard disk or a flash drive. The MBR has a number of uses, including the following:
A master boot record in a recording medium partitioned with the MBR Partition Table scheme (the conventional IBM PC partitioning scheme) is structured as follows:
Address | Description | Size (bytes) | ||
---|---|---|---|---|
Hex | Dec | |||
0000 | 0 | code area |
440 (max 446) |
|
01B8 | 440 | optional disk signature | 4 | |
01BC | 444 | usually null: 0000 hex | 2 | |
01BE | 446 | table of primary partitions: four 16-byte entries | 64 | |
01FE | 510 | 55 | MBR signature: AA55 hex | 2 |
01FF | 511 | AA | ||
total size | 512 |
The MBR is not located in a partition; it is located at a main boot record area in front of the first partition.
By convention, there are four primary partition table entries in the MBR.
The layout of one 16-byte partition record is as follows:
Offset (hex) | Field Length (bytes) | Description | ||
---|---|---|---|---|
00 | 1 | status: | ||
80 hex | bootable | |||
00 hex | non-bootable | |||
other | invalid | |||
01 | 3 | sector address of first partition sector: | ||
01 | head | |||
02 | sector and bits 9 - 8 of cylinder: | |||
bits 5 - 0 | sector | |||
bits 7 - 6 | bits 9 - 8 of cylinder | |||
03 | bits 7 - 0 of cylinder | |||
04 | 1 | partition type | ||
05 | 3 | sector address of the last sector in the partition: | ||
05 | head | |||
06 | sector and bits 9 - 8 of cylinder: | |||
bits 5 - 0 | sector | |||
bits 7 - 6 | bits 9 - 8 of cylinder | |||
07 | bits 7 - 0 of cylinder | |||
08 | 4 | LBA of first sector in the partition | ||
0C | 4 | sectors in partition |
When the MBR Partition Table scheme is used, the bootstrap loader in the ROM BIOS loads and executes the MBR. The code in the MBR's code area consists of machine language instructions which normally passes control by chain loading the volume boot record of the active partition, although some bootloaders replace that conventional code with their own.
The conventional MBR code scans its embedded partition table to find the only entry with a status of bootable (marked with the active flag), which indicates the active partition, and then loads and runs the volume boot record for that partition.
A volume boot record (VBR) is a type of boot sector, stored in a volume (a floppy disk, a partition on a hard disk or media in a similar data storage device), that contains code for booting programs (usually, but not necessarily, operating systems) stored elsewhere in the volume. On non-partitioned storage devices it is the first sector of the recording medium. On partitioned devices, it is the first sector of an individual partition, with the first sector of the entire device instead being a MBR.
The code in a VBR is invoked either directly by the computer's firmware or indirectly by a MBR or a bootloader. Invoking a VBR via a bootloader is known as chain loading.
On PC compatible computers, the BIOS is ignorant of the distinction between VBRs and MBRs, and of partitioning. The firmware simply loads and runs the first sector of the recording medium in the storage device: the VBR on a floppy disk or the MBR on a hard disk or flash drive. It is the code in the MBR that understands disk partitioning and in turn is responsible for loading and running the VBR of whichever primary partition is set as the active partition. The VBR then loads a second-stage bootloader from another location on the disk.
Whatever is stored in the boot sector of a data storage device is not required to immediately load any bootstrap code for an operating system, if ever. The BIOS merely passes control to whatever code exists as long as the sector contains the boot record signature (AA55) in its last two bytes. For this reason the usual bootstrap code found in a MBR can be replaced with more complex loaders or programs stored elsewhere on the recording medium that can run without an operating system.
example | partitioning |
home | Home Page |