Introduction to Operating Systems: Unit IV(a): Storage Management

Disk Management

Storage Management - Introduction to Operating Systems

Operating system is responsible for disk management.Disk formatting is of two types. a) Physical formatting or low level formatting. b) Logical formatting.

Disk Management

Operating system is responsible for disk management. Following are some activities discussed:

Disk Formatting

Disk formatting is of two types.

a) Physical formatting or low level formatting. b) Logical formatting.

Physical formatting :

• Disk must be formatted before storing a data.

• Disk must be divided into sectors that the disk controller can read/write.

Low level formatting fills the disk with a special data structure for each sector.

• Data structure consists of three fields: header, data area and trailer.

Header and trailer contain information used by the disk controller.

• Sector number and Error Correcting Codes (ECC) contained in the header and trailer.

• For writing data to the sector - ECC is updated.

• For reading data from the sector - ECC is recalculated.

• If there is mismatch in stored and calculated value then data area is corrupted.

• Low level formatting is done at factory.

Logical formatting:

After disk is partitioned, logical formatting used.

Operating system stores the initial file system data structures onto the disk.

Boot Block

• When a computer system is powered up or rebooted, a program in read only memory executes.

• Diagnostic check is done first.

Stage 0 boot program is executed.

• Boot program reads the first sector from the boot device into main memory.

Boot sector is the first sector of the boot device and contains stage-1 boot program.

May be boot sector will not contain a boot program.

PC booting from hard disk, the boot sector also contains a partition table.

• The code in the boot ROM instructs the disk controller to read the boot blocks into memory and then starts executing that code.

Full boot strap program is more sophisticated than the bootstrap loader in the boot ROM.

Bad Blocks

• Data that resided on the bad blocks usually are lost. The controller maintains a list of bad blocks on the disk. The list is initialized during the low level format at the factory, and is updated over the life of the disk.

• Low level formatting also sets aside spare sectors not visible to the operating system. The controller can be told to replace each bad sector logically with one of the spare sectors. This scheme is known as sector sparing or forwarding.

A typical bad sector transaction might be as follows:

1. The OS tries to read the data from logical block number 120.

2. Device controller calculates the error correction code and it finds that required of nivel block data can not be read, so that sector is bad. It reports this information to OS.


University Question

1. Brief the various procedures need to be followed in disk management.   AU: May-19, Marks 5

Introduction to Operating Systems: Unit IV(a): Storage Management : Tag: : Storage Management - Introduction to Operating Systems - Disk Management