The Theory of Hard disk, Sectors and Clusters

I have hard disk.

Clear hard disk

Operation system see this disk as set of sectors. Sector is array of 512 bytes.

Hard disk is set of sectors

It is not handy to store anything data directly in sectors of hard disk. Typically we split sectors of the hard disk to three regions: MBR, disk C: and disk D:.

MBR is invisible to end user. It stores information about location of disks "C:" and "D:" on the hard disk. As a rule, MBR occupy 63 first sectors from #0 to #62.

Logical disks C: and D: can be located anywhere on other sectors of physical hard disk. As for my hard drive, it stores disk C: from sector #63 to #20482874 and disk D: from sector #20482875 to #67023179.

Disk C: consists of the Servise space and set of N clusters. Service space can occupy different count of sectors. And every cluster occupy 8 sectors (or 1, 2, 4, 8, 16, 32, or more depends of file system and size of the disk C:).

Logical media

So, our hard disk stores MBR, disk C: (service space and clusters) and disk D: (the same).

Logical disks on physical disk

The Theory of Bad Sectors and Clusters

Somtimes the surface of hard disk can be damaged. As a result we get several bad sectors.

Bad sectors of disk C:

Typically data in such sectors are lost. Because of them, operation system must to not use this sectors to storing any data. It is no way to exclude separate sectors from using by operation system. But we can exclude whole cluster having bad sector by using capabilities of filesystem: we just mark this cluster as bad.

Mark cluster as bad

Now, operation system see this bad cluster and not use sectors from it.

Hard disk with bad sectors having disk with bad cluster

The legend:

Legend