Difference between SMART reallocated sectors and bad sectors
Solution 1:
Your guess is right. The drive only reallocates a sector when a write operation fails. Check wikipedia. Also take a look at the Current Pending Sector Count S.M.A.R.T attribute. The pending sectors are those which had read failures but no write failures, upon writing to these sectors the sectors will be reallocated.
The OS would know nothing about a remapped sector, because remapping is transparent, this means that is the OS try to write to a sector e.g 27643 and that write fails, then the drive will remap the sector internally to another physical area. Then when the OS tries again to write to sector 27643 it will succeed. The OS doesn't know that it is writing to a different physical area.
Solution 2:
A bad sector is simply a cluster of storage space, which appears to be defective. The sector won’t respond to read or write requests. Bad sectors can happen on both hard drives and SSD’s. Bad sectors can happen from physical damage that can’t be repaired, and software errors that can be repaired.
Reallocated sector is when your hard drive finds a bad sector, and swaps it with one of the reserved sectors set in the drive at time of manufacturing for such instances. Once a sector is swapped, the drive would report that the drive is free of bad sectors to the OS. Keep in mind that there are a certain set number of reserved sectors, and once that number is used, then it’s probably time to replace the drive.