Bad Block in Operating System


In operating systems, a bad block is a sector on a dick drive or a flash of the computer system which is not usable due to a permanent damage to the disk like physical damage of the disk surface or failed transistors of flash memory.

In this article, we will discuss the bad block in detail along with their different types, causes, replacement, etc. So let’s get started with the basic definition of bad block in operating system.

What is a Bad Block in Operating System?

The storage area of a memory device such as disk drive or flash drive which cannot be utilized to store and retrieve data due to permanent damage is called a bad block. A bad block sometimes also referred to as a bad sector.

In other words, a bad block is a damaged portion of a memory device like HDD, SSD, etc. In a storage device, the bad blocks mainly occur due to physical damage, software errors, etc. In a computer system, the bad blocks result in the loss of data and system instability.

As we know, in a disk drive, there are several moving parts which are prone to fail. Whenever the failure of a disk drive takes place, the disk drive needs to be replaced and its data should be restored from the backup media to the new disk drive.

Computer operating systems are generally equipped with tools to detect and manage the bad blocks. For example, in windows operating system, a utility called “Check Disk (chkdsk)” is included to scan the file system to identify the bad blocks. Once a bad block on a storage device is identified, the operating system marks it as unusable and does not store data in this portion of the disk.

Types of Bad Blocks

In a computer storage, several types of bad blocks can occur which are explained below −

  • Physical Bad Block − Bad blocks which are caused due to physical damage to the storage device such as magnetic interference, scratches, etc. is called physical bad block. Physical bad blocks are also called hard bad blocks. This type of bad block is permanent and cannot be repaired. Hence, the physical bad blocks can result in permanent data loss.

  • Logical Bad Block − The type of bad block which occurred due to some software errors like virus, file system error, etc. is termed as logical bad block. Logical bad block is also known as soft bad block. Sometimes, we can repair the logical bad blocks by using software tools.

  • Unreadable blocks − Unreadable blocks are another type of bad blocks whose data cannot be read due to data corruption or any other issues. Unreadable blocks result in data loss or system instability.

  • Bad Sectors − In a storage disk, a bad sector is a portion that cannot be utilized to store data due to physical damages or manufacturing defects. Bad sectors are specific type of bad blocks that typically occur on hard disks. The bad sectors are mainly caused due to head crashes, power failure, etc.

Causes of Bad Blocks

In computer storage, the following are the major causes of bad blocks −

  • Bad blocks can be caused due to physical damage to the disk. Physical damage to the disk can occur due to dropping, mishandling, extreme ambient temperature, magnetic interference, etc. Physical damage causes defects like scratches, dents, etc. that eventually results in bad blocks.

  • Sometime defects in the disk may occur during manufacturing process that lead to the bad blocks.

  • The wear and tear that happens over time can also cause bad blocks to occur in the disk.

  • Sudden power outage can also cause bad blocks to occur in the disk as it disturbs the normal operation of the disk.

  • Software errors like errors in the file system, software components, or operating system can also result bad blocks in the storage device.

Bad Block Management

The approach to manage the bad blocks in storage devices depends upon the type of the bad block. Some common bad block management approaches are listed below −

  • Take Backup of Important Data − Whenever bad blocks are identified on a storage device. Then, it is an important practice to back-up all the crucial data immediately, so that there is no data loss when the bad blocks spread.

  • Regularly Check the Health of Storage Device − It is a good practice to check the health of the storage device regularly with the help of disk health test tools such as SMART (Self-Monitoring Analysis and Reporting Technology) tool. This test provides information about the overall health of the storage disk.

  • Use Bad Block Scanning Tool − Operating systems are typically equipped with bad block scanning tools to detect and mark bad blocks in a storage device. For example, in windows operating system, a tool called “Check Disk” is included to scan and mark bad blocks in storage disks.

  • Repair Bad Blocks − Sometimes, it is possible to repair or remap the bad blocks in a storage device. For this purpose, some special software tools are used.

  • Replacement of the Storage Device − If a storage device has severe bad blocks. Then, it is a good idea to replace the device with a new one.

By following these few practices, we can handle bad blocks in computer storage devices.

Conclusion

In conclusion, the damaged portion of a storage device like HDD, SSD, flash drive, etc. is referred to as bad block. Bad blocks in a storage device generally occur due to physical damages, software errors, etc. Bad blocks cause the loss of data and system instability. Therefore, we need to detect and fix the bad blocks as soon as possible.

Updated on: 04-Apr-2023

716 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements