3

In a couple of resources I encountered the terms "bad sector" and "bad block" when referring to corrupted areas at hard disks, which do not seem to be very different.

I thought about that they could be the same as more often the terms seem to be used interchangeably like f.e. at the answers to this question, but then again I found articles like that where apparently both terms are used as they would refer to different things.

My question is: Are blocks and sectors both the same (and it was just a mistake in this article) or do these terms denote different things in that context?

I'm aware of that a "sector" is different than a "block" like described here but anyhow in the sense of being "bad" they seem to be used to describe the same thing. Or maybe I'm wrong?


FWIW, I've found this question which could have had answered my question by going with the title but unfortunately the question turned out to get in quite different direction(s) (it's very broad) than what the title ask for, so I needed to open my new focused question regarding that question.

Giacomo1968
  • 58,727

2 Answers2

3

As "bad block" is not well defined, it is difficult to explain the difference. If you consider "bad block" as another term for "cluster" you can see the difference.

A sector is the minimal unit of space you can write and read to a hard drive.

A cluster is the minimal unit of space for management of the space within a file system. Most file systems seem to use clusters, ReiserFS is a rare exception as far as I know. Every sector can only belong to one cluster.

When talking "file system" it is obvious that we are now a level above "sector level".

If a sector becomes unreadible you know that you lost just one sector. On file system level, p.e. when using NTFS, one bad sector will cause the cluster he belongs to being marked as bad even though the other good sectors may still contain recoverable information - on sector level! If your file system tells you about one bad cluster you don't know if there is just one sector broken inside or even more.

You stated in a comment:

So a bad block can become "good" (by swapping broken sectors of the block with healthy ones), but a bad sector always keeps bad, right? A bad sector isn't recoverable but a bad block is.

After reading the above you should understand that this is a wrong assumption and LpChip is wrong when he confirms it.

A broken sector that cannot be read is "pending sector". Once the drives receives a write command for that sector and the write operation fails the firmware of the drive redirects the write operation to a spare sector. That would make appear the sector as good. This works as long as the spare pool is not exhausted.

During regular use of the file system this will never happen as NTFS marks an unreadible cluster as bad and won't access it anymore. Therefore no write operation occurs which could replace the sector. That would happen if you zero out the drive and maybe during a "long format" operation.

Please note that Giacomo1968 is wrong. One bad sector will already ruin the cluster. The cluster does not go bad when every sector in the cluster is bad. It is broken before. Sawdust is right in his writing, though.

The article Giacom1968 linked is bad:

So why are there blocks. Why doesn't the operating system just point straight to the sectors? Because there are limits to the number of blocks, or drive addresses, that an operating system can address. By defining a block as several sectors, an OS can work with bigger hard drives without increasing the number of block addresses.

Using clusters or blocks, does not free the operating system from addressing sectors. It's just a matter of convenience of combining a couple of sectors into a cluster.

Today's limitation with big drives is not caused by operating systems but rather by an outdated structure that describes the location of partitions on a drive. This limit has been lifted by the introduction of GPT as successor of the old school partition table. Even XP 64 bit could already handle big drives when GPT was used.

When you read the description of the "badblocks" command in Linux

https://linux.die.net/man/8/badblocks

you learn that this command is neither bound to sector size nor to cluster size. For badblocks you can define any block size you like.

r2d3
  • 4,050
1

A sector is a physical spot on your hard disk, whereas a block is a group of one or more sectors. The larger the disk the larger the blocks become.

Read More here: “Hard Drive Knowledge: Blocks vs. Sectors”

A bad sector indicates a spot on the hard disk that cannot be changed anymore and is marked as bad so that any scan can exclude that sector from a block and allocate another spare sector as part of that block.

A bad block simply refers to a block that contains a bad sector that needs fixing.

Giacomo1968
  • 58,727
LPChip
  • 66,193