Are disk sector writes atomic?

前端 未结 9 1337
名媛妹妹
名媛妹妹 2020-12-22 20:31

Clarified Question:

When the OS sends the command to write a sector to disk is it atomic? i.e. Write of new data succeeds fully or old data is left intact should the

9条回答
  •  感情败类
    2020-12-22 20:35

    I suspect this assumption is wrong.

    Modern HDDs encode the data in sectors - and additionally protect it with ECC. Therefore you can end-up with garbaging all the sector content - it will just not make sense with the encoding used.

    As for increasingly poplular SSDs, the situation is even more gruesome - the block is cleared prior to being overwritten, so, depending on the firmware being used and the amount of free space, entirely unrelated sectors can be damaged.

    By the way, an OS crash will not lead to data being damaged within single sector.

提交回复
热议问题