Power failure recovery

Power failure recovery

Reference material: "Simple SSD"

There are two types of power-down, normal power-down and abnormal power-down, but no matter what kind of power-down, after the SSD is powered on and recognized, it must work normally

1. Normal power down

concept

Before power down, the SSD will receive a power down notification from the host. After receiving the notification, the SSD will do some operations. After the SSD completes these operations, the host will actually power off the SSD.

Generally speaking, normal power-off will not result in the loss of data. After re-powering on and recognizing the disk, you only need to reload the related information (map data, flash block information, etc.) saved before power-off to continue working.

 

Case

The host sends an Idle Immediately command to notify the SATA SSD. After receiving the command, the SSD will mainly do the following things before stopping the power supply to the SSD

1) Flash the data cached in the buffer into the flash memory

2) Flash the mapping table into flash memory

3) Write the block information of the flash memory to the flash memory (such as which flash memory block is currently written and where to write to the flash memory block, which flash memory blocks have been written, which flash memory blocks are invalid, etc.)

4) Write other SSD information into flash memory

 

 

2. Abnormal power failure

concept

1) The SSD is powered off when it does not receive the host's power-down notification, or receives the host's power-down notification, but it is powered off without having time to deal with the things to be handled above,

2) Abnormal power failure may cause data loss. For example, the data cached in SSD is too late to write to flash memory. Power failure will cause this part of data to be lost. According to the characteristics of flash memory,

      If the power failure occurs on the upper page of the MLC, the corresponding Lower Page data will be destroyed, which means that the data previously written to the flash memory may also be lost due to abnormal power failure

3) The purpose of abnormal power-off recovery is to restore user data as much as possible and minimize the loss, and to allow the SSD to work normally after an abnormal power-down.

 

Guess you like

Origin www.cnblogs.com/marton/p/12694708.html