Thursday 14 April 2016

Data structure in disk.

Disk Structure and Partitions

A hard disk is physically composed of a series of flat, magnetically coated platters stacked
on a spindle. The spindle turns while the heads move between the platters, in tandem, radially
reading/writing data onto the platters.

Fig. 3. Physical Disk Structure


Disk tracks, cylinders, and sectors
A disk is divided into tracks, cylinders, and sectors. A track is that portion of a disk which
passes under a single stationary head during a disk rotation, a ring 1 bit wide. A cylinder is
comprised of the set of tracks described by all the heads (on separate platters) at a single seek
position. Each cylinder is equidistant from the center of the disk. A track is divided into segments of
sectors, which is the basic unit of storage.

On Sun systems a sector is 512 bytes (1 disk block) of data, with header and trailer
information. The latter make it possible for the controller to identify sectors, detect data errors, and
perform error corrections when necessary. The actual layout of a disk sector will vary depending on
the controller, but should look something like that shown in Fig. 2.3. There are two Preambles and a
Postamble (whose sizes may vary due to rotational speed, etc., and are disk dependent). The Header
field lets the controller know where the head is positioned, and the ECC field is for error correction.

Fig. 2. Disk Platter




The number of sectors per track varies with the radius of the track on the platter. The
outermost tracks is larger and can hold more sectors than the inner ones. These outer tracks also
spin faster under the head than do the inner ones, because while the angular speed remains the
same, the larger circumference results in more sectors spinning by in the same period for the outer
tracks. Disk blocks are numbered starting at the outermost track, so put the data you expect to
access most often on partition, or slice, 0.

Cylinder group

SunOS uses the Berkeley fast file system which uses cylinder groups. A group is formed
form 32 or fewer cylinders on a disk (default 16). Each cylinder group has a redundant copy of the
superblock, space for inodes, list of available blocks, and a list of data block usage within the
cylinder group. Data blocks are spaced to minimize rotational delays and to keep blocks of the same
file close together. By grouping cylinders in this way we reduce the amount of head movement, on
average, required to access a file. The inode describing the file, and the data for the file, are likely to
be in the same physical area of the disk. The position of the redundant superblock within each
cylinder group is varied, so that they don't all reside on the same disk platter. This helps to insure
that you can recover in the event of the loss of the primary superblock.

Physical disk structure
Disk formatted in MS-DOS has physical structure (Fig. 5).


1. Boot record has special program for checking is disk system or not. Checking criterion is
very simple: first two files in a root directory must be IO.SYS and MSDOS.SYS. These two
files must be in a root directory exactly disposed in this order. If disk is system boot record
every time is disposed in first sector of zero track of zero cylinder. After physical disk sector
destruction is no more in use. One physical disk division into independent logical parts for
fixed disks is called section. On of the section is used for MS-DOS booting. This is an active
section. Information about executed disk division is placed in special called Partition table.
This is a part of Master Boot Record. This record places in the first sector of the zero
cylinders of the zero tracks. When recorded program got control, it defines which one is
active and from which cylinder this division begins.

2. First FAT copy (read about File Allocation Table)

3. Second FAT copy. FAT is very important supporting data integrity. That’s why MS-DOS
has two identical tables’ copies that give opportunity “save” contents on disk after damaging
using the copy for the file access.

4. Data domain. The ret space after enumeration is available for the file location. First cluster
in data domain every time is cluster number two. This does not mean that all enumerated
fields are in two clusters. First two FAT elements are used as disk format indicators.



No comments:

Post a Comment

Popular Posts