Control method of disk unit
Abstract
[Subject] In HDD which has only one storage device and does not have huge cache memory, either, data writing of the postscript system by the conversion to a physical block address from a logic block address is realized. [Solution means] It is inspected whether the size of the address mapping table on cache memory is over the threshold value by Step 303. The entry which chose the entry for several appointed minutes by the LRU system by Step 304 when it was over the threshold value, and was chosen at Step 305 is added to a WRITE buffer, and an address mapping table is evacuated on HDD by performing WRITE at Step 309. [Effect] There is an effect which negotiates for WRITE performance by reducing the seek time of the head at the time of WRITE by the present invention. Moreover, it is effective in the ability to build the snapshot which can access the volume of the snapshot which is in the state of the past HDD with access to the volume of the usual HDD allowed. Moreover, the state of HDD at the arbitrary times has an effect which can carry out a rollback by cancelling writing, after performing the writing to HDD. [Selection figure] Fig. 3
Term
No projected expiry on record.
- Priority and filed
- Published
- Today
27 claims: 12 independent, 15 dependent
- 1In a control method of a disk device including a control unit that transmits and receives commands and data between a storage medium and a host and performs write or read control to the storage medium, the control unit issues a write command from the host. The storage medium so that data can be written by a write-once method when the step of receiving, the step of reading the logical block address included in the write command, and the step of converting the read logical block address to the physical block address of the storage medium. The step of converting the unused area of the physical block address to the next physical block address of the most recently written physical block address, the step of writing the data specified by the host to the converted physical block address, and the converted physical block. A method for controlling a disk device, which comprises executing a step of writing the value of the logical block address specified by the host in a management area corresponding to the address. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 ホストからの書き込みコマンドを受信するステップ、 前記書き込みコマンドに含まれる論理ブロックアドレスを読み出すステップ、 前記読み出した論理ブロックアドレスを前記記憶媒体の物理ブロックアドレスに変換する際に、追記方式でデータ書き込みができるように、前記記憶媒体の未使用領域であり最も最近書き込みを行った物理ブロックアドレスの次の物理ブロックアドレスに変換するステップ、 前記変換した物理ブロックアドレスに対して前記ホストが指定したデータを書き込むステップ、 前記変換した物理ブロックアドレスに対応した管理領域に、前記ホストが指定した前記論理ブロックアドレスの値を書き込むステップ、 を実行することを特徴とするディスク装置の制御方法。
- 9In a control method of a disk device including a control unit that transmits and receives commands and data between a storage medium and a host and performs write or read control to the storage medium, the control unit issues a read command from the host. The step of receiving, the step of reading the logical block address included in the read command, and the corresponding logical block address from the address conversion table on the temporary storage area that stores the correspondence between the logical block address and the physical block address as one entry. It is characterized by executing a step of reading an entry, a step of reading a physical block address from the read entry, a step of reading data from the physical block address of the storage medium, and a step of transmitting the read data to the host. How to control the disk device. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 ホストからの読み出しコマンドを受信するステップ、 前記読み出しコマンドに含まれる論理ブロックアドレスを読み出すステップ、 論理ブロックアドレスと物理ブロックアドレスとの対応を一つのエントリとして保存する一時記憶領域上のアドレス変換テーブルから前記論理ブロックアドレスに対応するエントリを読み出すステップ、 前記読み出したエントリから物理ブロックアドレスを読み出すステップ、 前記記憶媒体の前記物理ブロックアドレスからデータを読み出すステップ、 前記読み出したデータを前記ホストに送信するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 11In a control method of a disk device including a control unit that transmits and receives commands and data between a storage medium and a host and performs write or read control to the storage medium, the control unit issues a read command from the host. The step of receiving, the step of reading the logical block address included in the read command, and the correspondence between all the logical block addresses that can be specified by the host and the physical block addresses on the specific area on the storage medium can be maintained. A step of reading an entry corresponding to the logical block address from an address conversion table, a step of reading a physical block address from the read entry, a step of reading data from the physical block address of the storage medium, and a step of reading the read data from the host. A method of controlling a disk device, characterized by performing a step of sending to. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 ホストからの読み出しコマンドを受信するステップ、 前記読み出しコマンドに含まれる論理ブロックアドレスを読み出すステップ、 前記記憶媒体上の特定の領域上にある、ホストが指定可能な全ての論理ブロックアドレスと物理ブロックアドレスとの対応を保持可能なアドレス変換テーブルから、前記論理ブロックアドレスに対応するエントリを読み出すステップ、 前記読み出したエントリから物理ブロックアドレスを読み出すステップ、 前記記憶媒体の前記物理ブロックアドレスからデータを読み出すステップ、 前記読み出したデータを前記ホストに送信するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 12In a control method of a disk device including a storage medium and a control unit that sends and receives commands and data between the storage medium and performs write or read control to the storage medium, the control unit includes a logical block address and a physical block. The step of initializing the address translation table on the temporary storage area that stores the correspondence with the address as one entry, starting from the most recently written physical block address, and moving the address translation table toward the smaller physical block address. Next to the step of searching the saved block of the storage medium, the step of reading the saved block of the address conversion table found by the search step and restoring it on the address conversion table on the temporary storage area, and the step of recovering to the saved block. The physical block address of the block and the management area corresponding to the physical block address are specified by the host when writing to the physical block address toward the most recently written physical block address starting from the physical block address of. Step to read the logical block address A method for controlling a disk device, which comprises executing a step of making the correspondence between the physical block address and the logical block address into one entry and saving the correspondence in the address translation table on the temporary storage area. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 論理ブロックアドレスと物理ブロックアドレスとの対応を一つのエントリとして保存する一時記憶領域上のアドレス変換テーブルを初期化するステップ、 最も最近書き込みを行った物理ブロックアドレスを起点に、より小さな物理ブロックアドレス方向に前記アドレス変換テーブルを退避した前記記憶媒体のブロックを検索するステップ、 前記検索ステップにより発見したアドレス変換テーブルを退避したブロックを読み出して前記一時記憶領域上の前記アドレス変換テーブル上に復旧するステップ、 前記退避したブロックの次の物理ブロックアドレスを起点に前記最も最近書き込みを行った物理ブロックアドレスに向かって、ブロックの物理ブロックアドレスと、前記物理ブロックアドレスに対応した管理領域から前記物理ブロックアドレスに書き込んだ際にホストが指定した論理ブロックアドレスとを読み出すステップ、 前記物理ブロックアドレスと前記論理ブロックアドレスとの対応を一つのエントリにして、前記一時記憶領域上の前記アドレス変換テーブルに保存するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 13In a control method of a disk device including a storage medium and a control unit that sends and receives commands and data between the storage medium and performs write or read control to the storage medium, the control unit includes a logical block address and a physical block. The step of initializing the address conversion table on the temporary storage area that stores the correspondence with the address as one entry, starting from the smallest physical block address of the storage medium and heading toward the most recently written physical block address. , The step of reading the physical block address of the block and the logical block address specified by the host when writing to the physical block address from the management area corresponding to the physical block address, the physical block address and the logical block address. A method of controlling a disk device, which comprises executing a step of making a correspondence into one entry and saving it in the address translation table. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 論理ブロックアドレスと物理ブロックアドレスとの対応を一つのエントリとして保存する一時記憶領域上のアドレス変換テーブルを初期化するステップ、 前記記憶媒体の最も小さな物理ブロックアドレスを起点に、最も最近書き込みを行った物理ブロックアドレスに向かって、ブロックの物理ブロックアドレスと、前記物理ブロックアドレスに対応した管理領域から前記物理ブロックアドレスに書き込んだ際にホストが指定した論理ブロックアドレスとを読み出すステップ、 前記物理ブロックアドレスと前記論理ブロックアドレスとの対応を一つのエントリにして、前記アドレス変換テーブルに保存するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 14In a control method of a disk device including a storage medium and a control unit that sends and receives commands and data between the storage medium and performs write or read control to the storage medium, the control unit includes a logical block address and a physical block. The step of initializing the address translation table on the temporary storage area that stores the correspondence with the address as one entry, starting from the smallest physical block address of the storage medium and heading toward the most recently written physical block address. , A step of searching the block in which the address translation table is saved, a step of reading the block in which the address translation table found in the search step is saved and adding it to the address translation table on the temporary storage area, the address translation table. Steps to compare the number of entries saved in with the number of allowed entries specified separately, as a result of the comparison, if the number of saved entries exceeds the number of allowed entries, only the number of deleted entries specified separately is used most recently. A step of selecting entries in order from an entry that has not been performed, a step of deleting the selected entry from the address translation table, Starting from the physical block address next to the saved block that was read last, the physical block address of the block and the physical block address corresponding to the physical block address are directed toward the most recently written physical block address. The step of reading the logical block address specified by the host when writing to the block address, the correspondence between the physical block address and the logical block address is made into one entry and stored in the address conversion table on the temporary storage area. A method of controlling a disk unit, characterized in that the steps to be performed are performed. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 論理ブロックアドレスと物理ブロックアドレスとの対応を一つのエントリとして保存する一時記憶領域上のアドレス変換テーブルを初期化するステップ、 前記記憶媒体の最も小さな物理ブロックアドレスを起点に、最も最近書き込みを行った物理ブロックアドレスに向かって、前記アドレス変換テーブルを退避したブロックを検索するステップ、 前記検索ステップにより発見したアドレス変換テーブルを退避したブロックを読み出して前記一時記憶領域上の前記アドレス変換テーブル上に追加するステップ、 前記アドレス変換テーブルに保存されたエントリ数を別途定める許容エントリ数と比較するステップ、 前記比較の結果、前記保存されたエントリ数が前記許容エントリ数を越えている場合に、別途定める削除数分だけ、最も最近使用していないエントリから順番にエントリを選択するステップ、 前記選択したエントリを前記アドレス変換テーブルから削除するステップ、 最も最後に読み込んだ退避したブロックの次の物理ブロックアドレスを起点に前記最も最近書き込みを行った物理ブロックアドレスに向かって、ブロックの物理ブロックアドレスと、前記物理ブロックアドレスに対応した管理領域から前記物理ブロックアドレスに書き込んだ際にホストが指定した論理ブロックアドレスとを読み出すステップ、 前記物理ブロックアドレスと前記論理ブロックアドレスとの対応を一つのエントリにして、前記一時記憶領域上の前記アドレス変換テーブルに保存するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 17In a control method of a disk device including a control unit that transmits and receives commands and data between a storage medium and a host and performs writing or reading control on the storage medium, the control unit processes the storage medium. Step to set the value of the upper limit physical block address, starting from the smallest physical block address, for each block toward the processing upper limit physical block address, the logic specified by the host when writing to the block's physical block address A step to check whether the host is writing at a physical block address higher than the physical block address for the same logical block address as the block address value, when the host is writing at a physical block address higher than the physical block address. A step of writing a dirty flag indicating that writing to the same logical block address is overwritten by a higher physical block address to the management area corresponding to the block. Starting from the smallest physical block address and moving toward the most recently written physical block address, for each block, the blocks without the dirty flag are subordinated so that the blocks with the dirty flag are overwritten. A method of controlling a disk unit, characterized by performing a step that moves in the direction of an address. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 前記記憶媒体の処理する上限の物理ブロックアドレスの値を設定するステップ、 最も小さな物理ブロックアドレスを起点に、前記処理上限の物理ブロックアドレスに向かって各ブロックについて、ブロックの物理ブロックアドレスに書き込んだ際にホストが指定した論理ブロックアドレスの値と同一の論理ブロックアドレスに対して、前記物理ブロックアドレスよりも上位の物理ブロックアドレスにおいてホストが書き込んでいないか検査するステップ、 上位の物理ブロックアドレスにおいてホストが書き込んでいる場合に、同一の論理ブロックアドレスへの書き込みが、より上位の物理ブロックアドレスにより上書きされていることを示すダーティ・フラグを前記ブロックに対応した管理領域に書き込むステップ、 最も小さな物理ブロックアドレスを起点に、最も最近書き込まれた物理ブロックアドレスに向かって各ブロックについて、ダーティ・フラグの付いたブロックを上書きするように、ダーティ・フラグの付いていないブロックを下位の物理ブロックアドレスの方向に移動するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 18In a control method of a disk device including a control unit that transmits and receives commands and data between a storage medium and a host and performs writing or reading control on the storage medium, the control unit processes the storage medium. Step to set the value of the upper physical block address, step to initialize the second address translation table on the temporary storage area that stores the correspondence between the logical block address and the physical block address as one entry, the smallest physical block Starting from the address, toward the physical block address of the processing upper limit, the physical block address of the block and the logical block address specified by the host when writing to the physical block address from the management area corresponding to the physical block address. Step of reading, the step of making the correspondence between the physical block address and the logical block address into one entry and storing it in the second address conversion table, the second address when receiving a request from the host. A step of enabling access means to the storage medium that converts a physical block address and a logical block address by a conversion table, A method of controlling a disk unit, which comprises executing. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 前記記憶媒体の処理する上限の物理ブロックアドレスの値を設定するステップ、 論理ブロックアドレスと物理ブロックアドレスとの対応を一つのエントリとして保存する一時記憶領域上の第二のアドレス変換テーブルを初期化するステップ、 最も小さな物理ブロックアドレスを起点に、前記処理上限の物理ブロックアドレスに向かって、ブロックの物理ブロックアドレスと、前記物理ブロックアドレスに対応した管理領域から前記物理ブロックアドレスに書き込んだ際にホストが指定した論理ブロックアドレスとを読み出すステップ、 前記物理ブロックアドレスと前記論理ブロックアドレスとの対応を一つのエントリにして、前記第二のアドレス変換テーブルに保存するステップ、 ホストからの要求を受信する際に、前記第二のアドレス変換テーブルにより物理ブロックアドレスと論理ブロックアドレスとの変換を行う前記記憶媒体へのアクセス手段を有効化するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 19In a control method of a disk device including a control unit that transmits and receives commands and data between a storage medium and a host and performs writing or reading control on the storage medium, the control unit processes the storage medium. Step to set the value of the lower limit physical block address, step to invalidate and initialize the written block toward the most recently written physical block address starting from the processing lower limit physical block address, logical block address The step of initializing the address conversion table on the temporary storage area that stores the correspondence between the physical block address and the physical block address as one entry. A step of reading the physical block address and the logical block address specified by the host when writing to the physical block address from the management area corresponding to the physical block address, and the correspondence between the physical block address and the logical block address. A method of controlling a disk device, which comprises performing a step of making one entry and saving it in the address translation table. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 前記記憶媒体の処理する下限の物理ブロックアドレスの値を設定するステップ、 前記処理下限の物理ブロックアドレスを起点に、最も最近書き込んだ物理ブロックアドレスに向かって、書き込み済みのブロックを無効化して初期化するステップ、 論理ブロックアドレスと物理ブロックアドレスとの対応を一つのエントリとして保存する一時記憶領域上のアドレス変換テーブルを初期化するステップ、 最も小さな物理ブロックアドレスを起点に、前記処理下限の物理ブロックアドレスに向かって、ブロックの物理ブロックアドレスと、前記物理ブロックアドレスに対応した管理領域から前記物理ブロックアドレスに書き込んだ際にホストが指定した論理ブロックアドレスとを読み出すステップ、 前記物理ブロックアドレスと前記論理ブロックアドレスとの対応を一つのエントリにして、前記アドレス変換テーブルに保存するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 22The control unit exists on the storage medium in a control method of a disk device including a control unit that transmits and receives commands and data between the storage medium and a host and performs write or read control to the storage medium. A step of receiving a write command or a read command from a host to a logical block address, a step of checking whether the logical block address is an address for receiving a control command, a step of receiving a control command, and the received command. Is a write command, a step of reading data in the data area of the write command, a step of checking whether the data is a control command of the disk device, and a step of executing the control command when is a control command. Step, and when the received command is a read command, the step of reading the management information of the storage medium corresponding to the received logical block address, the read management. A method of controlling a disk device, which comprises executing a step of transmitting information to the host. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 前記記憶媒体上に存在しない論理ブロックアドレスへのホストからの書き込みコマンドもしくは読み出しコマンドを受信するステップ、 前記論理ブロックアドレスが制御コマンド受信用のアドレスかどうかを検査するステップ、 制御コマンド受信用アドレスであり、かつ前記受信したコマンドが書き込みコマンドである場合に、 前記書き込みコマンドのデータ領域中のデータを読み出すステップ、 前記データを当該ディスク装置の制御コマンドかどうかを検査するステップ、 制御コマンドである場合に、前記制御コマンドを実行するステップ、を実行し、 制御コマンド受信用アドレスであり、かつ前記受信したコマンドが読み出しコマンドである場合に、 前記受信した論理ブロックアドレスに対応した前記記憶媒体の管理情報を読み出すステップ、 前記読み出した管理情報を前記ホストに送信するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 23In the control method of a disk device including a control unit that transmits / receives commands and data between the storage medium and the host and performs write / read control to the storage medium, the control unit receives commands from the host. The address specified by the host as the logical block address is specified as the logical block address when the step of checking whether the read command requests a direct reference to the internal data structure of the storage medium is executed and the read command requests a direct reference. A step of seeking as a physical block address inside the storage medium, a step of reading out the user data recorded in the block and the management data recorded in the management area corresponding to the block, and transmitting the user data and the management data to the host. A method of controlling a disk unit, characterized in that the steps to be performed are performed. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 ホストから受信したコマンドが前記記憶媒体の内部データ構造への直接参照を要求する読み出しコマンドかどうかを検査するステップを実行し、 直接参照を要求する読み出しコマンドである場合に、 前記ホストが論理ブロックアドレスとして指定したアドレスを前記記憶媒体内部の物理ブロックアドレスとしてシークするステップ、 ブロックに記録したユーザデータと、前記ブロックに対応した管理領域に記録した管理データとを読み出すステップ、 前記ユーザデータと前記管理データとを前記ホストに送信するステップ、 を実行することを特徴とするディスク装置の制御方法。
- 24In the control method of a disk device including a control unit that transmits and receives commands and data between the storage medium and the host and performs write or read control to the storage medium, the control unit receives commands from the host. The step of checking whether the command is for reading the management data recorded in the management area of the storage medium is executed, and when the command is for reading the management data, the address specified by the host as the logical block address is set inside the storage medium. A method for controlling a disk device, which comprises executing a step of reading management data recorded in a management area corresponding to a block and a step of transmitting the management data to the host as a physical block address. 記憶媒体と、ホストとの間でコマンドやデータの送受信を行い前記記憶媒体に対して書き込み又は読み出し制御を行う制御部とを備えるディスク装置の制御方法において 前記制御部は、 ホストから受信したコマンドが前記記憶媒体の管理領域に記録した管理データの読み出しコマンドかどうかを検査するステップを実行し、 管理データの読み出しコマンドである場合に、 前記ホストが論理ブロックアドレスとして指定したアドレスを前記記憶媒体内部の物理ブロックアドレスとして、ブロックに対応した管理領域に記録した管理データを読み出すステップ、 前記管理データを前記ホストに送信するステップ、 を実行することを特徴とするディスク装置の制御方法。
Independent claims12
153 paragraphs, as filed
The present invention relates to a method for controlling a disk device, and the present invention relates to a method for controlling a disk device that is resistant to obstacles.
In a conventional disk device (hereinafter referred to as HDD), the logical block address specified by the host is converted into a unique physical block address inside the HDD to access the storage medium inside the HDD. Normally, address conversion is performed using a conversion formula with parameters such as the number of HDD cylinders, the number of heads, and the number of sectors per track. Therefore, even a processor having a low processing capacity or a small memory capacity mounted on the HDD can convert between the logical block address and the physical block address at sufficiently high speed. However, when address translation is performed using such a conversion formula, the logical block address and the physical block address are translated one-to-one. This means that writing to the same logical block address erases previously written content.
Normally, there is no problem with such an operation. However, if the data that should not be erased is overwritten by an operation error or a computer virus, the data on the HDD will be lost. If you do not back up the data to the outside of the HDD, the data will be lost forever. This occurs because even if the command is invalid from the user's intention, if the command recognized by the HDD is correct, the HDD executes the command without interpreting the user's intention.
For large disk array devices, a method of allocating a storage area on a storage device, which is different from address translation by the above conversion formula, has been proposed. US Pat. No. 4,467,421 VIRTUAL STORAGE SYSTEM AND METHOD reserves the required space from multiple storage devices and records data each time a write request is received from a host. As a result, even when using a normal block device command, it is possible to write to a new area without erasing the existing area.
RAID system proposed by Patterson et al. (DA Patterson, GA Gibson, RH At RAID level 4 or 5 in Katz, A Case for Redundant Arrays of Inexpensive Disks (RAID), Proceedings of the international Conference on Management of Data (SIGMOD), June 1988, pp.109-116), every write After reading and updating the parity, a write penalty of writing back the parity occurs, so there is a problem that the write performance deteriorates. As a solution to this problem, US Pat. No. 5,124,987 "LOGICAL TRACK WRITE SCHEDULING SYSTEM FOR A PARALLEL DISK DRIVE ARRAY DATA STORAGE SUBSYSTEM" provides new storage for new write data and on-the-fly generated parity data. Proposals have been made to write to the area on the device.
U.S. Pat. No. 4,467,421 and U.S. Pat. No. 5,124,987 require a mapping table that manages the correspondence between the logical block address specified by the host and the physical block device on the storage device. Even if the storage device is not faulty, if the mapping table is faulty, the data on the storage device cannot be accessed. The mapping table needs to be highly reliable, and even if the mapping table is damaged due to some accident, it is required to rebuild the mapping table. As a solution to this problem, "an information storage device and a management data reconstruction method applied to the information storage device" described in Japanese Patent Application Laid-Open No. 11-85589 have been proposed.
In JP-A-11-85589, the value of the logical block address specified by the host is stored in the user data storage area, and if a problem occurs in the mapping table, all the logic recorded in the user data storage area. We propose a method to reconstruct the mapping table by reading the block address value. At the same time, when there are multiple writes to the same logical block address, a sequence number indicating the write order is generated, and this sequence number is stored in the user data storage area together with the value of the logical block address for mapping. It proposes a method to identify the latest write from the sequence number on the user data storage area when a failure occurs in the table.
US Pat. No. 4,467,421 and US Pat. No. 5,124,987 are techniques for allocating new space inside a storage subsystem that looks like a block device to the host. As another method, Log-Structured File System (M. Rosenblum, and JK Ousterhout, The Design and Implementation of a Log-Structured File System, ACM Transactions on Computer System, Vol. 10, No. 1, Feb 1992, pp.3-25). In the Log-Structured File System (LFS), blocks are arranged so that they are added to a normal block device at the file system level. LFS is one of the methods originally considered as a solution to the fact that the speed of HDDs does not increase as the speed of processors and semiconductor memories increases. In a normal file system, when writing to the HDD, the time available for data transfer from the host to the HDD is reduced by the seek time of the head. On the other hand, in LFS, all processing for the file system including meta information, which is the management information of the file system that manages file deletion, is added as a log to the HDD. This reduces the head seek time during writing and realizes high-speed writing by sequentially writing.
<patcit num="1"><text>U.S. Pat. No. 4,467,421</text></patcit><patcit num="2"><text>U.S. Pat. No. 5,124,987</text></patcit><patcit num="3"><text>Japanese Unexamined Patent Publication No. 11-85589</text></patcit><nplcit num="1"><text>Proceedings of the international Conference on Management of Data (SIGMOD), June 1988, pp.109-116</text></nplcit><nplcit num="2"><text>ACM Transactions on Computer System, Vol. 10, No. 1, Feb 1992, pp.3-25</text></nplcit>
<p> U.S. Pat. Nos. 4,467,421 and U.S. Pat. No. 5,124,987 assume large disk array devices and require multiple storage devices and huge cache memory. Therefore, it cannot be applied to HDDs that have only one storage device and do not have a huge cache memory. Also, unlike LFS, it does not necessarily control the area so as to secure the area so that the head seek time at the time of writing is reduced, so that the writing speed is not necessarily high.</p><p> If something goes wrong with the system, you may need an image of the storage at the time it was operating normally for recovery. However, as the capacity of HDDs increases, the backup time from the storage subsystem to an external device such as tape and the recovery time from the backup to the storage subsystem are increasing. Desirably, the storage subsystem should have a history of all updates, and should be able to quickly generate snapshots of the storage image at any given time and make it accessible to the host. However, U.S. Pat. No. 4,467,421 and U.S. Pat. No. 5,124,987 do not have such a snapshot function.</p><p> The method of constructing a mapping table according to JP-A-11-85589 requires a huge memory that can read the entire mapping table at once as a prerequisite. Therefore, it cannot be applied to HDDs that cannot be equipped with such a huge memory. Furthermore, when the mapping table is reconstructed, the values of all the logical block addresses recorded on the storage device must be read, which requires a very long processing time. This long processing time may be acceptable if the mapping table, which occurs very rarely, can be rebuilt over a long period of time to recover from a failure. However, considering the process of constructing a snapshot at an arbitrary point in time, such a process may occur frequently, and therefore it is unacceptable to take a long processing time.</p><p> Since LFS is a file system, it can be used only on an OS that supports LFS, and cannot be applied to any OS, any file system, or even block data storage. Also, when a certain area is no longer needed due to file erasure, the cleaner process collects the area and makes it reusable as an unused area. Therefore, the snapshot function cannot be realized.</p><p> The first object of the present invention is to write data in an additional manner at the end of existing data regardless of the value of the logical block address specified by the host, and use the address translation table to check the correspondence between the logical block address and the physical block address. It is to provide a control method of a disk device to be managed.</p><p> A second object of the present invention is to secure a plurality of consecutive physical block addresses at the end of existing data and write the data in a write-once manner in the case of writing to a plurality of consecutive logical block addresses, and to write the logical block address. It is to provide a control method of a disk device which manages the correspondence between a physical block address and a physical block address in an address translation table which is encoded by utilizing the fact that the data is written to a continuous address.</p><p> A third object of the present invention is that when the number of entries registered in the address translation table on the temporary storage area exceeds a certain threshold value, the number of entries for the number of saved entries in the order of unused entry from the most recently unused entry. Is written to the end of the existing data in a write-once manner and saved, to provide a control method for the disk device.</p><p> A fourth object of the present invention is to provide a control method for a disk device that saves the value of the physical block address from which the address translation table was saved last time when the address translation table is saved.</p><p> A fifth object of the present invention is to manage an address conversion table capable of holding the correspondence between all logical block addresses and physical block addresses that can be specified by the host in a specific area on the storage medium of the HDD. It is to provide a control method of a device.</p><p> A sixth object of the present invention is to search the address conversion table by the value of the logical block address specified by the host, read the value of the physical block address corresponding to the value of the logical block address, and read the data from the physical block address. , To provide a control method for a disk device.</p><p> A seventh object of the present invention is the physics corresponding to the value of the logical block address from the address translation table saved on the storage medium of the HDD when the value of the logical block address specified by the host does not exist in the address translation table. It is to provide a control method of a disk device for retrieving a block address value.</p><p> The eighth object of the present invention is to search an address conversion table that can hold the correspondence between all the logical block addresses and the physical block addresses that can be specified by the host in a specific area on the storage medium of the HDD, and search for the host. Is to provide a control method of a disk device that reads out the value of the physical block address corresponding to the value of the logical block address specified by.</p><p> A ninth object of the present invention corresponds to the address translation table saved on the storage medium of the HDD at the end, the value of the physical block address of each block written after the address translation table is saved, and the blocks. It is to provide a control method of a disk device which reconstructs an address translation table from the value of a logical block address recorded in a management area.</p><p> A tenth object of the present invention is to obtain the value of the physical block address of each block and the value of the logical block address recorded in the management area corresponding to the block from the start address to the end address of the storage medium of the HDD. It is to provide a control method of a disk device which reconstructs an address conversion table.</p><p> The eleventh object of the present invention is to move from the start address to the end address of the storage medium of the HDD toward the saved address translation table and from the address where the address translation table was finally read toward the end address of each block. It is to provide a control method of a disk device which reconstructs an address translation table from a value of a physical block address and a value of a logical block address recorded in a management area corresponding to a block.</p><p> A twelfth object of the present invention is to write to the same logical block address for each block with a higher physical block address within the range of the physical block address separately determined from the beginning of the physical block address of the storage medium of the HDD. It provides a control method for a disk device that reclaims space on a storage medium by inspecting for non-compliance and shifting the data to overwrite the block if it has been written.</p><p> A thirteenth object of the present invention is to provide a control method of a disk device capable of accessing a snapshot which is a past state of an HDD.</p><p> A fourteenth object of the present invention is to provide a control method for a disk device capable of invalidating the contents written to the HDD and returning to the past state.</p><p> A fifteenth object of the present invention is to provide a control method for a disk device that writes the operating time of an HDD to a management area of a block when writing to the block.</p><p> A sixteenth object of the present invention is to provide a control method for a disk device capable of accessing a management area of an HDD by using a normal write command or read command.</p><p> A seventeenth object of the present invention is to provide a control method for a disk device capable of accessing an internal data structure recorded on a recording medium of an HDD.</p><p> An eighteenth object of the present invention is to provide a control method for a disk device capable of reading management data recorded in a temporary area corresponding to each block of a recording medium of an HDD.</p><p> A nineteenth object of the present invention is to provide a control method for a disk device capable of adding an identifier to the management area of the last written block when there is no write request from the host for a certain period of time.</p><p> A twentieth object of the present invention is to provide a control method for a disk device that writes a write time specified by a host to a management area of a block when writing to the block.</p>
<p> In the present invention, when the logical block address specified by the host in the write request is converted to the physical block address of the storage medium inside the HDD, the address conversion is performed so as to add new data to the end of the existing data, and the logical block. Manages the correspondence table of addresses and physical block addresses, and controls to read data from the most recently converted physical block address for the logical block address requested from the correspondence table of logical block addresses and physical block addresses in read requests. ..</p><p> The control method of the disk device of the present invention includes a storage medium and a control unit that sends and receives commands and data to and from the host to perform write or read control on the storage medium, and the control unit is the host. The step of receiving the write command from, reading the logical block address included in the write command, and when converting the read logical block address to the physical block address, it is the most unused area so that data can be written by the append method. Converted to the next physical block address after the recently written physical block address, wrote the data specified by the host to the converted physical block address, and specified by the host in the management area corresponding to the converted physical block address. Performs the process of writing the value of the logical block address.</p><p> When it is detected that the host is issuing a write command to a plurality of consecutive logical block addresses, the plurality of consecutive logical block addresses are converted into a plurality of consecutive physical block addresses, and a plurality of consecutive logical block addresses are converted. It is preferable to allocate one management area corresponding to the physical block address and write the values of a plurality of consecutive logical block addresses specified by the host by an arbitrary recoverable coding method in one management area. As the coding method, a size that is written continuously with the start address of the logical block address can be used.</p><p> The control unit also puts the correspondence between the logical block address and the physical block address, or the correspondence between the plurality of consecutive logical block addresses and the plurality of consecutive physical block addresses as one entry in the address conversion table on the temporary storage area. Save and compare the number of entries saved in the address conversion table with the number of allowed entries specified separately, and if the number of saved entries exceeds the allowed number of entries as a result of comparison, only the number of saved entries specified separately is the most. Select the entries in the order of unused from the recently unused entry, select the physical block address next to the most recently written physical block address, and write the contents of the selected entry to the selected physical block address. By doing so, the address conversion table on the temporary storage area is saved on the storage medium, and a flag indicating that the written data is an entry of the address conversion table is written to the management area corresponding to the selected physical block address. ..</p><p> When the value of the selected physical block address is saved in the temporary storage area and the address conversion table is saved on the storage medium, in addition to the contents of the selected entry, the previous address conversion table recorded in the temporary storage area The value of the physical block address used when saving the file on the storage medium may also be written out. One correspondence between the logical block address and the physical block address in the address translation table that can hold the correspondence between all the logical block addresses and the physical block addresses that can be specified by the host on a specific area on the storage medium. It may be retained as an entry. The address translation table can be provided on the management area of the storage medium or on the user data area.</p><p> The control unit also receives a read command from the host, reads the logical block address included in the read command, and stores the correspondence between the logical block address and the physical block address as one entry. Address conversion on the temporary storage area. The entry corresponding to the logical block address is read from the table, the physical block address is read from the read entry, the data is read from the physical block address of the storage medium, and the read data is transmitted to the host. If the entry corresponding to the logical block address does not exist in the address translation table on the temporary storage area, the entry corresponding to the logical block address is searched from the address translation table saved on the storage medium.</p><p> According to the present invention, the control unit also receives a read command from the host, reads the logical block address included in the read command, and all the logic that can be specified by the host on a specific area on the storage medium. The entry corresponding to the logical block address is read from the address conversion table that can hold the correspondence between the block address and the physical block address, the physical block address is read from the read entry, and the data is read and read from the physical block address of the storage medium. Performs the process of sending the data to the host.</p><p> The logical block address specified when the host wrote to the physical block address from the management area corresponding to the physical block address is read, and the logical block address read from the read command is compared with the logical block address read from the management area. Returns an error to the host if the comparisons do not match.</p><p> The control unit also initializes the address conversion table on the temporary storage area that stores the correspondence between the logical block address and the physical block address as one entry, and is smaller starting from the most recently written physical block address. The block that saved the address conversion table in the physical block address direction is searched, the block that saved the address conversion table found by the search step is read, restored on the address conversion table on the temporary storage area, and next to the saved block. From the physical block address to the most recently written physical block address, the physical block address of the block and the logical block address specified by the host when writing to the physical block address from the management area corresponding to the physical block address. Is read, the correspondence between the physical block address and the logical block address is made into one entry, and the process of saving in the address conversion table on the temporary storage area is performed.</p><p> The control unit also initializes the address conversion table on the temporary storage area that stores the correspondence between the logical block address and the physical block address as one entry, and writes most recently starting from the smallest physical block address. The physical block address of the block and the logical block address specified by the host when writing to the physical block address from the management area corresponding to the physical block address are read toward the physical block address, and the physical block address and the logical block address are displayed. The correspondence of is made into one entry, and the process of saving in the address conversion table is performed.</p><p> The control unit also initializes the address conversion table on the temporary storage area that stores the correspondence between the logical block address and the physical block address as one entry, and writes most recently starting from the smallest physical block address. Search the block that saved the address conversion table toward the physical block address, read the block that saved the address conversion table found by the search step, add it to the address conversion table on the temporary storage area, and add it to the address conversion table. Compare the number of saved entries with the number of allowed entries specified separately, and if the number of saved entries exceeds the allowed number of entries as a result of comparison, the number of deleted entries specified separately will be added from the least recently used entry. Select the entries in order, delete the selected entry from the address conversion table, and start from the physical block address next to the last read saved block and move toward the most recently written physical block address. Read the physical block address and the logical block address specified by the host when writing to the physical block address from the management area corresponding to the physical block address, and make the correspondence between the physical block address and the logical block address into one entry. Performs the process of saving in the address conversion table on the temporary storage area.</p><p> The physical block address and the logical block address are read only when the data stored in the block is user data. In addition, the entries stored in the temporary storage area can be stored in the address translation table on the address translation table on the specific area on the storage medium, which can hold the correspondence between all the logical block addresses and the physical block addresses that can be specified by the host. Save to the corresponding entry.</p><p> When the control unit also sets the value of the upper limit physical block address to be processed and writes to the physical block address of the block for each block from the smallest physical block address as the starting point and toward the upper limit physical block address of processing. For the logical block address that is the same as the value of the logical block address specified by the host, the host checks whether the physical block address higher than the physical block address to be processed is written by the host, and the host at the higher physical block address. Writes a dirty flag to the management area corresponding to the block, indicating that the write to the same logical block address is overwritten by the higher physical block address, and sets the smallest physical block address. From the starting point, move the unflagged block toward the lower physical block address so that it overwrites the dirty flagged block for each block toward the most recently written physical block address. Perform processing.</p><p> The control unit also sets the value of the upper limit physical block address to be processed, and initializes the second address conversion table on the temporary storage area that stores the correspondence between the logical block address and the physical block address as one entry. , Starting from the smallest physical block address, toward the physical block address of the processing upper limit, the physical block address of the block and the logical block specified by the host when writing to the physical block address from the management area corresponding to the physical block address. Read the address, make the correspondence between the physical block address and the logical block address into one entry, save it in the second address translation table, and when receiving the request from the host, the physical block by the second address translation table Performs the process of enabling the access means to the storage medium that converts the address and the logical block address.</p><p> The control unit also sets the value of the physical block address of the lower limit to be processed, invalidates and initializes the written block toward the most recently written physical block address starting from the physical block address of the lower limit of processing. , Initializes the address conversion table on the temporary storage area that stores the correspondence between the logical block address and the physical block address as one entry, and blocks from the smallest physical block address to the physical block address at the lower limit of processing. Read the physical block address of and the logical block address specified by the host when writing to the physical block address from the management area corresponding to the physical block address, and make the correspondence between the physical block address and the logical block address into one entry. , Performs the process of saving in the address conversion table.</p><p> The control unit also reads the operating time of the device and writes the read operating time to the management area corresponding to the converted physical block address or one management area corresponding to a plurality of consecutive physical block addresses. Then, when the head is retracted or the power is cut off, the operating time of the device is saved in the management area, and when the device is started, the operating time saved in the management area is read out, and the read operating time is used to calculate the operating time of the device. initialize. The command issuance time is read from the write command from the host, and the read command issuance time is written to the management area corresponding to the converted physical block address or one management area corresponding to a plurality of consecutive physical block addresses.</p><p> The control unit also receives a write command or read command from the host to a logical block address that does not exist on the storage medium, checks whether the logical block address is an address for receiving control commands, and addresses for receiving control commands. If the received command is a write command, the data in the data area of the write command is read, the data is checked for control commands, and if it is a control command, the control command is executed and controlled. When the command is a command reception address and the received command is a read command, the management information of the storage medium corresponding to the received logical block address is read, and the management information of the read storage medium is transmitted to the host. ..</p><p> The control unit also checks whether the command from the host is a read command that requires a direct reference to the internal data structure of the storage medium, and if it is a read command that requires a direct reference, the host specifies it as a logical block address. The generated address is sought as a physical block address inside the HDD, the user data recorded in the block and the management data recorded in the management area corresponding to the block are read, and the user data and the management data are transmitted to the host.</p><p> The control unit also checks whether the command from the host is a command to read the management data recorded in the management area of the storage medium, and if it is a command to read the management data, the address specified by the host as the logical block address is used. As the physical block address inside the storage medium, the management data recorded in the management area corresponding to the block is read, and the management data is transmitted to the host.</p><p> The control unit also detects the issue interval of the write command from the host, checks whether the host has issued the write command for the period specified separately since the last issue of the write command, and the write command for the period specified separately. Is not issued, an identifier indicating that the write command has not been issued for a period specified separately is added to the management area corresponding to the most recently written physical block address.</p>
<p> According to the present invention, even in an HDD having only a small cache memory, it is possible to realize disk control in which data is written in a write-once manner without overwriting data on the storage medium of the HDD regardless of the LBA value specified by the host. It is possible to provide a disk device that is resistant to obstacles.</p>
Embodiments of the invention will be described with reference to the drawings. The same reference number indicates the same component.
FIG. 1 is a block diagram of a software processing layer according to the first embodiment of a method for controlling a disk device by a write-once method that does not overwrite the data of the present invention. This software processing layer 100 converts the protocol processing layer 101 that processes ATA and SCSI, which are the communication protocols between the host and HDD, and the logical block address (LBA) specified by the host into the physical block address (PBA) that is accessed in log format. It consists of a log conversion layer 102, a defective sector replacement layer 103 for replacing a spare sector when the specified PBA is a defective sector, and a physical access process 104 for accessing the storage medium of the HDD with the specified PBA.
FIG. 2 is a block diagram of a software processing layer of a conventional HDD control method. In FIG. 2, 201 is an address translation layer that translates the LBA specified by the host into PBA by computer algebra.
FIG. 3 is a PAD diagram of WRITE processing according to the first embodiment of the method for controlling a disk device according to the present invention. In FIG. 3, 300 is a PAD diagram of WRITE processing according to the first embodiment of the control method of the disk device according to the present invention, 301 is a WRITE command receiving step, 302 is a WRITE buffer initialization step, and 303 is on the memory of the HDD. The step of checking whether the size of the address translation table exceeds the threshold specified separately, 304 is the step of selecting the least used entry for the number of entries specified separately, 305 is the step of adding the selected entry to the WRITE buffer, 306 is the step of converting the LBA specified by the host to PBA in the HDD, 307 is the step of adding the translated address to the address conversion table, 308 is the step of adding the user data in the WRITE command to the WRITE buffer, and 309 is the step of adding WRITE. The step of writing the contents of the buffer to the storage medium of the HDD, and 310 is the step of returning the execution result of WRITE to the host.
FIG. 4 is a data format according to the first embodiment of the method for controlling a disk device according to the present invention. In FIG. 4, 400 is the data format of the first embodiment according to the present invention, 401 is an image of the address space of the recording medium of the HDD, 402 is a single write unit, 403 is user data, 404 is a flag, and 405 is. Saved data of the address conversion table saved on the HDD recording medium, 406 manages the data structure inside the flag, 407 manages the address conversion table on the HDD cache memory, and 408 manages the address conversion table saved on the HDD storage medium. This is the physical block address management table on the cache memory of the HDD.
FIG. 5 is a PAD diagram of READ processing according to the first embodiment of the control method of the disk device according to the present invention. In FIG. 5, 500 is a PAD diagram of READ processing in the first embodiment of the control method of the disk device according to the present invention, 501 is a READ command receiving step, 502 is a READ buffer initialization step, and 503 is HDD memory. The step of checking whether the specified LBA exists in the above address conversion table, the step of 504 is the step of reading the PBA from the address conversion table in the memory of the HDD, and the step of 505 is the step of reading the PBA from the address conversion table saved in the storage medium of the HDD. , 506 are the steps to read from the HDD storage medium into the READ buffer, and 507 is the step to return the READ execution result to the host.
FIG. 14 is a block diagram of the hardware of the first embodiment of the write-once HDD according to the present invention. In FIG. 14, 1400 is a block diagram of the hardware of the first embodiment of the write-once HDD according to the present invention, 1401 is a flash rom, 1402 is a main memory, 1403 is a cache memory, 1404 is a microprocessor (MPU), and 1405. Is a hard disk controller (HDC) and SCSI protocol controller (SPC), 1406 is a servo controller, and 1407 is a read / write channel.
Figure 15 shows the SCSI WRITE (16) command. In FIG. 15, 1500 is the SCSI WRITE (16) command, 1501 is the operation code (OPERATION CODE), 1502 is the logical block address (LOGICAL BLOCK ADDRESS: LBA), and 1503 is the transfer length (TRANSFER LENGTH).
Figure 16 shows the SCSI READ (16) command. In FIG. 16, 1600 is the SCSI READ (16) command, 1601 is the operation code (OPERATION CODE), 1602 is the logical block address (LOGICAL BLOCK ADDRESS: LBA), and 1603 is the transfer length (TRANSFER LENGTH).
FIG. 17 is a conceptual diagram of a one-way linked list. In FIG. 17, 1700 is a conceptual diagram of a one-way linked list, and 1701 is a link from the shunt block of the current address translation table to the shunt block of the previous address translation table.
FIG. 18 is a conceptual diagram of a bidirectional linked list. In FIG. 18, 1800 is a conceptual diagram of a bidirectional linked list, and 1801 is a link from the shunt block of the previous address translation table to the shunt block of the current address translation table.
In the present embodiment, the physical block address (PBA) of the recording medium is assigned so as to be added to the end of the existing data on the recording medium of the HDD regardless of the value of the logical block address (LBA) specified by the host. It is characterized by controlling the HDD.
The software processing layer of the HDD according to the conventional technique shown in FIG. 2 is roughly divided into four layers: protocol processing 101, address translation 201, defective sector replacement 103, and physical access 104. Protocol processing 101 interprets commands such as ATA and SCSI, which are protocols used when the host communicates with the HDD, and translates them into control commands inside the HDD. The address translation 201 converts the LBA specified by the host into a PBA by performing mathematical expression processing. In the defective sector replacement 103, when the sector specified by the PBA converted by the address translation 201 is a defective sector, the PBA is replaced with a normal substitute sector. Then, the physical access 104 reads and writes to the sector specified by the PBA.
On the other hand, the software processing layer of the HDD of the present embodiment is characterized in that LBA is converted to PBA by log conversion 102 instead of address translation 201, as compared with the conventional technology, as shown in FIG. .. In the log conversion 102, the LBA is converted so that the end of the existing data can be accessed by the write-once method on the storage medium of the HDD. By performing address translation by log translation 102 instead of address translation 201 in this way, the existing program can be used for protocol processing 101 and defective sector replacement 103, so that the program development man-hours can be reduced.
The outline of the operation of the first embodiment of the write-once HDD according to the present invention will be described with reference to FIG. The control program of the write-once HDD is stored in the flash ROM 1401. When the MPU1404 is powered on, the MPU1404 reads the control program from the flash ROM 1401 and expands it to the main memory 1402. This control program includes the WRITE process in Fig. 3 and the READ process in Fig. 5.
The HDC / SPC1405 receives commands and sends responses from the host. This command includes the WRITE (16) command in Figure 15 and the READ (16) command in Figure 16. The SPC sends and receives commands and data in the SCSI protocol. In the WRITE process in Fig. 3, WRITE command reception step 301 and step 310 to return the WRITE execution result to the host, and in the READ process in Fig. 5, READ command reception step 501 and step 507 to return the READ execution result to the host are in the SPC. It becomes a process.
After the processing in SPC is completed, the processing moves to MPU1404. The MPU1404 performs the processing necessary to access the recording medium of the HDD according to the control program in the main memory 1402. In the WRITE process of FIG. 3, steps 302 to 308, and in the READ process of FIG. 5, steps 502 to 505 are the processes of MPU1404.
The WRITE data received from the host and the READ data read from the HDD recording medium are saved in the cache memory 1403. The cache memory 1403 also stores the address translation table 407 and the address translation table save address 408 shown in FIG.
The main memory 1402 also contains various variables required for processing in MPU1404, such as a threshold value used separately for determining the size of the address translation table used in step 303, a variable used in step 306 for managing which PBA was written to, and so on. save.
After the processing on MPU1404 is completed, the processing moves to HDC. In HDC, a command is sent to the servo controller 1406 according to the physical block address converted by MPU1404 to control the HDD head. After controlling the head, the HDC sends a command to the read / write channel 1407 to WRITE data to the recording medium and READ data from the recording medium. In the WRITE process of Fig. 3, the step 309 of writing the contents of the WRITE buffer to the HDD, and in the READ process of Fig. 5, the step of reading the contents of the WRITE buffer from the recording medium of the HDD into the READ buffer are the processes in HDC.
The structure of the SCSI command will be described with reference to FIGS. 15 and 16. The first byte of the command is the operation code. The operation code 1501 of the WRITE command stores 8Ah, and the operation code 1601 of the READ command stores 88h. The 2nd to 9th bytes are the logical block addresses (LBA) 1502 and 1602. The LBA1502 is translated into a physical block address (PBA) in step 306. LBA1602 is converted to PBA in steps 503 to 505. The 10th to 13th bytes are the transfer lengths 1503 and 1603. In step 302, the size of the WRITE buffer is determined by the size of the transfer length 1503 and initialized, and in step 308, the user data received in step 301 with the size of the transfer length 1503 is transferred to the WRITE buffer. In step 502, the READ buffer is initialized with the size of the transfer length 1603, and in step 506, the data read from the recording medium with the size of the transfer length 1603 is stored in the READ buffer.
Next, the WRITE procedure will be described with reference to FIG. The required data structure will be explained using Fig. 4. In FIG. 3, steps 303 to 307 correspond to log conversion 102.
The WRITE command from the host is received in step 301, the WRITE buffer is initialized in step 302, and the process proceeds to step 303.
Since the conversion process from LBA to PBA in the present embodiment assigns the address next to the previously assigned address instead of the mathematical expression process, the process is performed according to the internal state of the HDD. Therefore, it is necessary to manage the correspondence between LBA and PBA by the address translation table. In order to speed up the processing, it is desirable to store the address translation table on a medium that can be accessed at high speed such as a semiconductor memory. However, the size of the address translation table for all the LBAs that can be specified is very large and cannot be stored in the semiconductor memory that can be mounted on the HDD. Therefore, in the present embodiment, an address conversion table consisting of entries of LBA and PBA in FIG. 4 is constructed on the cache memory constructed from the semiconductor memory, and only frequently used LBAs are managed by LRU control. The entries overflowing from the address translation table 407 are saved on the storage medium.
In step 303, it is checked whether or not the number of entries indicating the correspondence between the LBA and the PBA registered in the address translation table 407 exceeds the threshold value specified separately. If it is exceeded, the process proceeds to step 304, and if it is not exceeded, the process proceeds to step 306. In step 304, the LRU method, that is, the least recently used entry is selected for the number of entries specified separately. It is desirable that the entries registered in the address translation table 407 be saved on the storage medium of the HDD at least once. Therefore, in addition to saving infrequently used entries from the address translation table 407 by the LRU method, each entry is provided with a flag to manage whether or not it has been saved to the storage medium, and there is free space in the WRITE buffer, etc. Controls to save entries that are frequently used but have not been saved. After the end of step 304, the process proceeds to step 305.
In step 305, a block for saving the address translation table 407 is secured in the same manner as in step 306 described later, and the PBA value of the save block and the entry selected in step 305 are added to the WRITE buffer. In addition, the PBA value of the backup block is registered in the table 408 that manages the backup address of the address translation table in the cache memory of the HDD. Furthermore, the PBA that saved at least the address translation table 407 last time is read from the management table 408 and added to the WRITE buffer. By recording the PBA that saved the address conversion table in this way, all the saved data will be connected by a linked list, so it is easy to connect all the saved data with a linked list without scanning all the data depending on the data type of flag 404. You can search the saved data. After the end of step 305, the process proceeds to step 306.
Here, the saved data is connected by the one-way linked list, but by connecting the saved data by the two-way linked list, the search can be performed more efficiently and with a higher degree of freedom.
FIG. 17 is a conceptual diagram of a one-way linked list. By saving the value of the PBA that saved the address translation table last time when saving the address translation table this time, it is possible to trace the PBA that saved the address translation table from the present to the past like link 1701. ..
FIG. 18 is a conceptual diagram of a bidirectional linked list. By adding the value of the PBA that saved the address translation table this time to the PBA that saved the address translation table last time in addition to the one-way linked list in Fig. 17, the address translation table can be changed from the past to the present like link 1801. You can follow the saved PBA. By using both link 1701 and link 1801, it is possible to trace the address translation table in both directions, present and past.
In step 306, the LBA specified by the host with the WRITE command is converted into the PBA when actually writing to the storage medium of the HDD. Since it is added to the end of the existing data, there is a variable in the working memory of the HDD that manages to which PBA the data was written. Determine the PBA to read the value from that variable and write to that address. The write management variables on the working memory are saved in the non-volatile management area of the HDD when the head is retracted or the power is cut off. When the power is turned on, the value saved in the non-volatile management area is read and the write management variables on the working memory are initialized. After the end of step 306, the process proceeds to step 307.
In step 307, the correspondence between the LBA specified by the host and the PBA determined in step 306 is registered in the address translation table 407 on the cache memory as one entry. After the end of step 307, the process proceeds to step 308.
In step 308, the PBA converted in step 306 and the user data specified by the host in the WRITE command are added to the WRITE buffer. After the end of step 308, the process proceeds to step 309.
In step 309, data is recorded on the storage medium based on the combination of PBA and data written in the WRITE buffer. After the end of step 309, the process proceeds to step 310.
In step 310, the result of writing to the recording medium is returned to the host as a response to the WRITE command.
As a method of specifying the threshold value used in step 303 and step 304 and the number of entries to be saved, a new entry is created in the SMART management entry and specified via that entry, and a new command is defined as a vendor definition command. Then, there is a method of specifying by the command, a method of encapsulating the management command in the data area of the normal WRITE command, and the like.
In the method using the normal WRITE command, the command is identified as a management command by performing WRITE on the LBA outside the range that can be used for normal access. As a method of determining the LBA used at this time, there is a method of using a value obtained by encoding an ID unique to the HDD or a value obtained by encoding the ID unique to the HDD and the ID of the management command to be executed. is there. In the case of a management command that requires multiple sequences to be executed, it is possible to prevent erroneous command execution by controlling the LBA to be accessed one after another according to a certain rule. In addition, by encrypting the management command encapsulated in the data area of the WRITE command, the risk of issuing the management command by an illegal means such as a virus can be reduced.
According to this embodiment, it is possible to write to the storage medium of the HDD in a write-once manner regardless of the LBA value specified by the host, and there is an effect that the WRITE performance is improved by reducing the seek time of the head.
Further, according to the present embodiment, even when the capacity of the cache memory is small and the entire address translation table cannot be saved in the cache memory, there is an effect that the PBA corresponding to the LBA can be efficiently searched.
Next, the data format on the recording medium will be described with reference to FIG. 401 shows an image of the address space of the recording medium of the HDD. When recording user data on a normal HDD, basically only user data is saved except for the ECC code for verification. On the other hand, the method of controlling the disk device according to the present embodiment is characterized in that the flag 404 is stored in addition to the user data 403. One writing unit to the recording medium of the HDD is 402, which is a combination of user data 403 or saved data 405 and flag 404.
The data structure for flag 404 looks like 406. LBA is the address specified by the host, and PBA is the address translated in step 306. The data type is an identifier that identifies the user data 403 for which the host has instructed to write and the saved data 405 of the address translation table. The state is used when managing the state of the user data 403 and the saved data 405 by reusing the area described in another embodiment. The writing time is the time when the user data 403 and the saved data 405 are written on the storage medium of the HDD. This writing time does not necessarily have to be a time synchronized with the outside as long as it can be used for verification of the integrity of the user data 403, and may be a sequence number that counts up for each writing. For example, if time is used, there is a method of using the total operating time of the HDD. The total operating time is calculated by a timer that keeps counting up from the initial operation of the HDD, and saved in the non-volatile management area of the HDD when the head is retracted or the power is cut off. If the value of the timer saved in the non-volatile management area is read and the timer is initialized when the power is turned on, a backup battery for the clock becomes unnecessary.
In the present embodiment, every time the address translation table 407 overflows, the address translation table is additionally written on the storage medium of the HDD in the form of saved data 405 as in the case of the user data 403, but other methods can also be used. good. For example, there is a method of saving the address translation table for all the specifiable LBAs on the storage medium of the HDD. The location of the address translation table at this time includes the non-volatile management area of the HDD and the user data space. For data security, it is desirable that the data is duplicated, and the method of additionally writing the saved data 405 on the storage medium of the HDD and the address conversion table for all the specifiable LBAs are written on the storage medium of the HDD. You may use it together with the method of saving in.
In the present embodiment, the flag 404 is placed immediately after the user data 403 or the save data 405 of the address translation table, but the present embodiment can be similarly applied to other placement methods. As an example of another arrangement method, there is an arrangement in front of the user data 403 or the save data 405, an arrangement in the management area of the HDD, and the like.
In this embodiment, the PBA of the block is recorded in the data structure 406 inside the flag. This is a measure for convenience such as debugging, and it is not always necessary to record the PBA in the data structure 406 inside the flag.
In order to verify and debug the data inside the HDD, it is necessary to directly refer to the data structure inside the HDD shown in FIG. 4, that is, all of the user data 403, the flag 404, the saved data 405, or only the flag 404. In that case, in addition to the method of specifying the management command by encapsulating it in the data area of SMART, vendor definition command, normal WRITE command, as well as specifying the threshold value and the number of entries to be saved, for example, SCSI If there is, there is a method to access with a LUN different from the volume of a normal HDD. When accessing the internal data structure by these methods, the LBA specified by the host is not converted to PBA using the address translation table 407, but LBA is directly converted to PBA or LBA is converted to PBA by mathematical expression conversion. To access the internal data structure.
Next, the READ procedure will be explained using Fig. 5. In FIG. 5, steps 503 to 505 correspond to log conversion 102.
Receive the READ command from the host in step 501 and initialize the READ buffer in step 502. After completing step 502, the process proceeds to step 503.
In step 503, the address translation table 407 is checked for an entry for the LBA specified by the host. If the entry exists, read the PBA corresponding to the LBA specified by the host in step 504. If the entry does not exist, in step 505, the PBA corresponding to the LBA specified by the host is read from the address translation table 405 saved on the storage medium of the HDD. As explained in step 305, if the PBA value of the previously saved block is also saved when the address conversion table is saved, all the saved data will be connected by a linked list, and all the saved data will be saved in order. You can search for blocks. As a result, even if the capacity of the PBA management table 408 of the saved address conversion table is too small to hold the PBA values of all the saved blocks, all data is scanned by relying on the data type written in flag 404. You can easily search the saved data without doing this. After the end of step 504 or step 505, the process proceeds to step 506.
In step 506, data is read from the read PBA to the READ buffer. After the end of step 506, the process proceeds to step 507. In step 507, the contents of the READ buffer are returned to the host in response to the READ command.
In the present embodiment, the control method of the HDD alone has been described, but it can be similarly applied to a large disk array device equipped with a more powerful processor and a large capacity memory.
FIG. 6 is a data format according to the second embodiment of the method for controlling a disk device according to the present invention. In FIG. 6, 600 is the data format of the second embodiment of the present invention, 601 is the flag, 602 is a single write unit, and 603 is the data structure inside the flag.
The present embodiment is characterized in that the data area required for the flag is reduced with respect to the first embodiment by optimizing the writing to consecutive addresses.
In the first embodiment, one flag 404 is assigned to one user data 403, whereas in the present embodiment, one flag 601 is assigned to a plurality of user data 403s. For example, when accessing the HDD in units of 4KB with a file system, if the size of one block is 512B, the area required for the flag can be reduced to 1/8.
In order to realize such control, as shown in the data structure 603 inside the flag, a plurality of LBAs consisting of consecutive addresses are coded by the offset of the LBA and the number of blocks.
One data writing unit 602 becomes one flag 601 and a plurality of user data 403. Since the number of blocks of the data structure 603 inside the flag is used to manage how many blocks are continuously written, the number of user data 403 to be written at one time is variable. In addition, the WRITE performance is improved by reducing the number of writes of the flag 601.
This embodiment has the effect of reducing the data area required for the flag, and has the effect of improving the WRITE performance by reducing the number of times the flag is written.
FIG. 7 is a PAD diagram of a method for recovering from a failure of an address translation table according to a third embodiment of the method for controlling a disk device according to the present invention. In FIG. 7, 700 is a PAD diagram of a method for recovering from a failure of an address conversion table according to the third embodiment of the disk device control method according to the present invention, 701 is an initialization step of the address conversion table, and 702 is the last saved address. The conversion table search step, 703 is the step of determining whether the search was successful, 704 is the step of returning the saved data 405 saved on the HDD to the address conversion table 407 on the cache memory, and 705 is the next block of the saved data. 706 is the step to seek to the beginning of the HDD, 710 is the step to loop to the upper limit of the PBA written to the HDD, 711 is the step to read the flag 404, 712 is the step to read the LBA and PBA from the data structure 406 inside the flag. The step of reading, creating an entry and registering it in the address translation table 407, and 713 is the step of seeking to the next block of the block currently being processed.
The contents of the address translation table 407 on the cache memory described in the first embodiment disappear when the power of the HDD is turned off. Therefore, the address conversion table 407 is saved in the non-volatile management area of the HDD when the head is saved or the power is cut off, and the address conversion table saved from the management area is read when the HDD is turned on to perform address conversion on the cache memory. A procedure is required to return to table 407. However, if the address translation table 407 cannot be saved due to a sudden power failure or runaway of the host or HDD system, it is necessary to rebuild the address translation table based on the information written on the HDD storage medium. .. In the present embodiment, the address translation table on the cache memory is reconstructed by using the address translation table last saved on the storage medium of the HDD and the flag information of the user data after the address translation table is saved. There is a feature.
In step 701, the address translation table 407 on the cache memory is initialized. After the end of step 701, the process proceeds to step 702.
In step 702, the address translation table last saved on the storage medium of the HDD is searched. An example of the search method is as follows. (1) Read the value of the last written PBA in the management area of the HDD and seek to that PBA. (2) Seek in the direction of increasing PBA value, read the block flag 404, and check if the block is unused. (3) Repeat (2) to check the PBA of the last block written to the HDD. Let the PBA of the last written block be the LPBA. (4) Seek in the direction in which the PBA value decreases by the number of entries that can be stored in the address translation table 407 (N ENTRY). Let the seeked PBA be SPBA. (5) Read the flag 404 of the block and check whether the block is the saved data 405. (6) If the saved data is 405, the process ends, and if it is not the saved data 405, seek in the direction in which the PBA value increases and return to the process of (5). If the saved data is not found even after seeking to LPBA, further N from SPBA Seek the PBA value in the direction of decreasing by the amount of ENTRY, and repeat the process of (5).
After the end of step 702, the process proceeds to step 703. In step 703, the condition for determining whether or not the saved data 405 is found is determined. If the saved data 405 is found, the process proceeds to step 704, and if not found, the process proceeds to step 706.
In step 704, the saved data 405 saved on the found HDD is returned to the address translation table 407 on the cache memory. Then proceed to step 705.
In step 705, seek to the next block of the saved data 405. Then proceed to step 710.
In step 706, seek to the PBA at the beginning of the HDD. If the saved data 405 is not stored on the storage medium, it is necessary to read all the block flags from the beginning of the storage medium and rebuild the address translation table 407. Then proceed to step 710.
In the subsequent processing, the address translation table 407 is reconstructed for the user data 403 written after the saved data 405 is written.
Step 710 is a loop that executes steps 711 to 713 up to LPBA.
Step 711 reads the block flag 404. Then proceed to step 712.
In step 712, the LBA and PBA of the read flag 404 are made into one entry and registered in the address translation table 407. Then proceed to step 713.
In step 713, seek to the next block.
According to this embodiment, there is an effect of reconstructing the address translation table at high speed by reading the saved data of the address translation table and the flag of the block which is the difference from the saved data and reconstructing the address translation table.
FIG. 8 is a PAD diagram of a method for recovering from a failure of an address translation table according to a fourth embodiment of the method for controlling a disk device according to the present invention. In FIG. 8, 800 is a PAD diagram of a method for recovering from a failure of an address conversion table according to a fourth embodiment of a disk device control method according to the present invention, and 801 is a step of seeking to the next block of a saved address conversion table, 810. Is a step that loops as long as the saved address conversion table exists, 811 is a step that reads the saved data 405 that is the saved address conversion table on the HDD, and 812 is the address conversion for all the specifiable LBAs on the HDD storage medium. The step of adding the saved data 405 read into the table, 813 is the step of checking whether the number of entries of the address conversion table 407 in the cache memory exceeds the threshold specified separately, and 814 is the entry specified separately when the threshold is exceeded. The step of deleting from the address conversion table 407 for a few minutes, the step of 815 is the step of adding the read backup data 405 to the address conversion table 407 on the cache memory, and the step 816 is the backup data saved after the currently read backup data 405. It is a step to seek to.
The embodiment of the present invention is characterized in that the address translation table is reconstructed from all the saved data 405 stored on the storage medium of the HDD. This method is especially useful when a complete address translation table that stores PBAs for all LBAs that can be specified by the host must be built at high speed on the storage medium of the HDD such as the user data space or management area. ..
In the first embodiment, a case where the saved data 405 is created as a one-way linked list by including the value of PBA in which the previous saved data 405 is saved in the saved data 405 has been described. In this one-way linked list, since the PBA is traced from the larger one to the smaller one, the saved data 405 written in chronological order is traced in the reverse direction. Since the registration algorithm in the address translation table is simpler when the saved data is read in chronological order, it is preferable that the saved data 405 is a bidirectional linked list that can be traced in chronological order.
You can change from a one-way linked list to a two-way linked list by following the steps below. (1) Read the last saved save data 405 (2) Store the PBA of the save data 405 (3) Read the PBA value of the last saved save data 405 from the read save data 405 (4) Save the last saved save Read data 405 (5) Record the PBA value of the saved data 405 stored in the saved saved data 405 that was read last time and write it back to the storage medium of the HDD (6) As long as there is saved data 405 that was read last time (6) Return to 2)
In step 701, the address translation table 407 on the cache memory is initialized, and the process proceeds to step 706. In step 706, seek to the beginning of the storage medium of the HDD, and proceed to step 810.
In step 810, as long as there is saved data 405 saved on the storage medium of the HDD, the loop from step 811 to step 816 is executed. This loop refers to the saved data 405 in the order written on the storage medium of the HDD. If the saved data 405 is a one-way linked list that follows in the reverse order of the time series, it is changed to a two-way linked list by the above procedure before executing the loop.
In step 811 the saved data 405 saved in the storage medium of the HDD is read from the address translation table, and the process proceeds to step 812.
In step 812, an entry is added from the read backup data to the complete address translation table that stores the PBAs for all LBAs that the host can specify, and the process proceeds to step 813.
In step 813, it is compared whether the number of entries registered in the address translation table 407 on the cache memory exceeds the threshold value specified separately. If the threshold is exceeded, the process proceeds to step 814. After the end of step 814 or if the threshold value has not been exceeded, the process proceeds to step 815.
In step 814, the number of entries specified separately from the address translation table 407 is deleted by the LRU method.
In step 815, the read backup data 405 is registered in the address translation table 407, and the process proceeds to step 816.
In step 816, the links are followed in the forward direction in which the PBA value of the bidirectional linked list included in the saved data 405 increases, and the saved saved data 405 is read after the saved data 405 currently being read.
After reading all the saved data 405 in the loop of step 810, the user data 403 not included in the saved data 405 is restored.
In step 801 it seeks to the next block of the saved data 405 and proceeds to step 710. After step 710, the address translation table is restored from the user data 403 in the same manner as after step 710 of the third embodiment.
According to this embodiment, by connecting the save data 405 in a list and reading only the save data 405, it is possible to read only the target save data 405 without scanning all the blocks, and all the blocks. It has the effect of rebuilding the address translation table faster than scanning.
Although the entry is deleted in step 814, it can be saved on the storage medium as described in FIG. In this case, in order to reserve an area for saving on the storage medium in advance, it is desirable to perform address translation from LBA to PBA so that an unused area is periodically created in the address space of PBA.
FIG. 9 is a PAD diagram of a snapshot construction method according to a fifth embodiment of the disk device control method according to the present invention. In FIG. 9, 900 is a PAD diagram of a snapshot construction method according to the fifth embodiment of the disk device control method according to the present invention, and 901 is a step of specifying SPBA, which is the upper limit address of the PBA for constructing a snapshot, 902. Is the step of initializing the address translation table for snapshot, 903 is the step of searching the save data 405 of the address translation table 407 on the cache memory that was last saved at a lower address than SPBA, and 904 is the step of searching the save data 405 for snapshot. The step of returning to the address translation table, 910 is the step of looping to SPBA.
The feature of this embodiment is that a snapshot is realized by setting an upper limit on the PBA to be processed and reconstructing the address translation table.
Since all writing to the HDD storage medium is performed in chronological order, if an address translation table is constructed within the range up to PBA specified separately, a snapshot that is an image of the HDD at a certain point in the past can be obtained. That is, if a step of specifying the upper limit PBA for constructing a snapshot is added to the method of recovering from the obstacle of the address translation table described in the third embodiment, the procedure for constructing the snapshot becomes.
In step 901, SPBA, which is the upper limit PBA for constructing a snapshot, is specified, and the process proceeds to step 902.
In step 902, the snapshot address translation table on the cache memory is initialized, and the process proceeds to step 903. In order to enable access to the snapshot while allowing access to the HDD as usual, an address translation table for snapshot is prepared separately from the address translation table 407 for normal access. In order for the host to be able to access the normal HDD volume and the snapshot volume at the same time, it is necessary to provide an access path for each volume. For example, when accessing using the SCSI protocol, there is a method of assigning different LUNs to the normal HDD volume and the snapshot volume.
The processing after step 903 is the same as the processing after step 702 in FIG. 7 except that LPBA is changed to SPBA.
In order to get a snapshot at the time the user wants, it is desirable to know the time written to the HDD from the time of the host. For this purpose, there is a method of including the time when the host issues the command in the write command from the host and adding the command issue time to the data structure 406 of the block flag 404.
This embodiment has the effect of constructing a snapshot that allows access to the snapshot volume while allowing access to the normal HDD volume. At the same time, by reading the saved data of the address translation table and the flag of the block which is the difference from the saved data and rebuilding the address translation table, there is an effect that a snapshot can be constructed at high speed.
FIG. 10 is a PAD diagram of the WRITE invalidation method according to the sixth embodiment of the disk device control method according to the present invention. In FIG. 10, 1000 is a PAD diagram of the WRITE invalidation method according to the sixth embodiment of the disk device control method according to the present invention, and 1001 is the upper limit of PBA left in the storage medium of the HDD (lower limit of PBA to start erasing). The step of specifying the DPBA, 1002 is the step of seeking to the DPBA, 1003 is the step of clearing the flag 404, and 1004 is the save data 405 of the address conversion table 407 on the cache memory that was last saved at a lower address than the DPBA. The search step, 1010, is the step that loops to the DPBA.
In the present embodiment, writing to a physical block address of a certain PBA or higher is invalidated, and the address conversion table is reconstructed at a physical block address of a certain PBA or lower, so that writing to the storage medium of the HDD after a certain point in time is performed. The feature is that it erases and rolls back to the state of the storage medium of the previous HDD.
Since all writing to the storage medium of the HDD is performed in chronological order, it is optional to invalidate the writing to the physical block address of PBA or higher specified separately and rebuild the address conversion table with the physical block address of PBA or lower specified separately. At this point, you can disable writing to the storage medium of the HDD and roll back to the previous state. That is, when the step of specifying the PBA to start invalidating WRITE and the step of invalidating the writing after the specified PBA are added to the method of recovering from the obstacle of the address translation table described in the third embodiment, , WRITE invalidation procedure.
In step 1001, the lower limit for starting invalidation of WRITE or the upper limit of the data not to be erased, DPBA, which is the PBA, is specified, and the process proceeds to step 1002.
In step 1002, seek to DPBA and proceed to step 710.
In the loop of step 710, the loop of step 1003 and step 713 is executed up to the upper limit PBA written, and the data written to the storage medium of the HDD is invalidated.
In step 1003, the user data 403 and the saved data 405 are invalidated by clearing the block flag 404. Here, the user data 403 and the saved data 405 are invalidated only by clearing the flag 404 for speeding up, but for safety, a dummy is written to the block in which the user data 403 and the saved data 405 are recorded. It is desirable to erase the recorded data.
The processing after step 701 is the same as the processing after step 701 in FIG. 7 except that LPBA is changed to DPBA.
When disabling WRITE, it is desirable to disable it so that the data in the HDD as seen from the host is consistent. It is most certain that the host writes the data to the HDD as data at what point in time, but if not, the HDD is a candidate for a consistent PBA by the following means. Can be judged. (1) Detect how often the host issues a write command (2) Detect whether a write command has been issued for a period specified separately since the last issue of the write command (3) Write command only for a period specified separately Is not issued, add an identifier to the data structure 406 of flag 404 of the most recently written physical block address to indicate that it is a candidate for data-consistent PBA.
This procedure takes advantage of the fact that the access from the host to the HDD is bursty due to the disk cache on the host, and means that the end of burst writing is regarded as a data-consistent candidate. Since PBA candidates with data consistency are selected in this procedure, it is desirable to perform a separate HDD consistency check from the host side when WRITE is disabled.
According to the embodiment of the present invention, by disabling the writing after writing to the HDD, there is an effect that the state of the HDD at an arbitrary time can be rolled back. At the same time, by reading the saved data of the address translation table and the flag of the block which is the difference from the saved data and reconstructing the address translation table, there is an effect that the rollback can be performed at high speed.
FIG. 11 is a PAD diagram of the area reuse method according to the seventh embodiment of the disk device control method according to the present invention. In FIG. 11, 1100 is a PAD diagram of the area reuse method according to the seventh embodiment, 1101 is a step of specifying GPBA which is the upper limit of PBA for collecting used area, and 1102 is for work in the cache memory. Initialize the address translation table, 1110 loop to GPBA, 1111 check the data type of data structure 406 with flag 404 and check if it is user data 403, 1112 is user data 403 In the subroutine, 1113 is a step to change the state of the data structure 406 of flag 404 to Dirty, and 1121 is a step to check the data type and state of the data structure 406 of flag 404 and check that they are user data 403 and Clean, respectively. , 1122 is a subroutine when user data 403 and Clean, 1123 is a step to check whether the data type of data structure 406 of flag 404 is saved data 405, 1103 is an address in the working address conversion table and cache memory. This is the step of replacing the conversion table 407.
FIG. 12 is a PAD diagram of the subroutine 1112 according to the seventh embodiment of the method for controlling a disk device according to the present invention. In FIG. 12, 1200 is a PAD diagram of subroutine 1112 according to the seventh embodiment of the disk device control method according to the present invention, 1201 is a step of reading LBA from the data structure 406 of flag 404, and 1202 is the latest corresponding to LBA. The step of searching for the PBA of the block in which the user data 403 of the above is written, and 1203 is the step of checking whether the block currently being processed is the PBA holding the latest user data 403.
FIG. 13 is a PAD diagram of subroutine 1122 according to the seventh embodiment of the disk device control method according to the present invention. In FIG. 13, 1300 is a PAD diagram of subroutine 1122 according to the seventh embodiment of the disk device control method according to the present invention, 1301 is a step of copying a block being processed in the low address direction, and 1302 is a data structure of flag 404. The step of modifying the PBA of 406 to the value of the PBA to which it was copied, 1303 is the step of checking whether the size of the working address translation table exceeds the threshold specified separately, and 1304 is the most used for the number of entries specified separately. The step of selecting an entry that has not been performed, 1305 is a step of saving the selected entry on the storage medium on the HDD, and 1306 is a step of adding the correspondence between the LBA and PBA after copying to the working address conversion table.
FIG. 19 is a conceptual diagram of the area reuse method according to the seventh embodiment. In FIG. 19, 1900 is an image of the address space of the recording medium of the HDD before the area is reused, 1901 is the GPBA which is the upper limit of the PBA for collecting the used area, and 1902 is the used block which is the target of the area reuse. , 1903 is a used block that is not subject to area reuse, 1904 is an unused block, 1910 is an image of the address space of the HDD recording medium after area reuse, and 1911 is the size due to area reuse. It is a used block, which has become smaller.
In the control method of the disk device according to the present invention, all the writings to the storage medium of the HDD are recorded in chronological order. That is, when repeatedly writing to the same LBA, the conventional HDD control method consumes only one block capacity, but the disk device control method according to the present invention consumes the block capacity for the number of times the writing is performed. Consume. Therefore, in order to effectively use the capacity of the storage medium of the HDD, it is necessary to appropriately collect the used capacity and make it reusable. However, if you collect only the latest state, you will not be able to use the snapshot and WRITE invalidation functions, so used capacity will be collected at addresses below a certain PBA, and used capacity will be collected at addresses above that PBA. It is necessary to control so that it does not occur.
The present embodiment is characterized in that the area can be reused while enabling the snapshot and WRITE invalidation functions by collecting the used capacity only at the address below a certain PBA.
The concept of area reuse is explained with reference to FIG. In the state 1900 before collecting the used area, the used area is divided into a block 1902 to be reused and a block 1903 not to be reused by GPBA1901, which is the upper limit of the PBA for collecting the used area. In the block 1902 to be reused, the area is shifted to the lower address side so as to overwrite the block that is overwritten and Dirty, that is, the block written in the higher PBA for the same LBA. To block 1911. Block 1903, which is not the target of reuse, shifts to the low address side so as to fill the vacant block because block 1902 becomes block 1911. These extend the area of unused block 1904.
In step 1101, GPBA, which is the upper limit of PBA for collecting used area, is specified. Then proceed to step 1102.
In step 1102, the working address translation table is initialized. The reason why the work address translation table is prepared separately from the address translation table 407 is that the area reuse process can be executed while allowing access to the normal HDD volume. After completing step 1102, proceed to step 706.
In step 706, seek to the beginning of the HDD and proceed to the loop of step 1110.
The loop in step 1110 executes step 711, steps 1111 to 1113, and step 713 from the beginning of the HDD toward the GPBA. After completing the execution of the loop in step 1110, the process proceeds to step 706. In step 711, the flag 404 is read and the process proceeds to step 1111.
In step 1111 the data type of the data structure 406 of flag 404 is read and checked for normal block or user data. In the case of a normal block, the subroutine proceeds to step 1112, otherwise the process proceeds to step 1113. After the end of step 1112 or step 1113, the process proceeds to step 713.
The subroutine in step 1112 executes steps 1201, 1203, and 1113.
Step 1201 reads the block LBA from the data structure 406 with flag 404 and proceeds to step 1202.
In step 1202, the latest PBA for the read LBA is searched, and the process proceeds to step 1203.
In step 1203, the PBA currently being processed is compared with the searched PBA, and if the two PBAs are equal, that is, the PBA currently being processed is the PBA that stores the latest data, the execution of subroutine 1112 is terminated. If not, the process proceeds to step 1113.
In step 1113, the state of data structure 406 with flag 404 is changed to Dirty, which means it is not the latest data.
If it is not a normal block in step 1111, it is saved data in the address translation table and cannot be used after the area is reused. Therefore, proceed to step 1113 and set the state to Dirty.
In step 706, seek to the beginning of the HDD and proceed to step 710.
In step 710, the loops of steps 1121 to 1123 and steps 1113 and 713 are executed. After completing the execution of the loop in step 710, the process proceeds to step 1103.
Step 1121 examines the data type and status of data structure 406 for block flag 404. Step 1122 if the data type is normal block and the state is not Dirty Clean, otherwise go to step 1123. After completing the subroutine in step 1122, the process proceeds to step 1123.
The subroutine in step 1122 executes steps 1301 to 1306.
In step 1301, the block currently being processed is copied in the direction of the PBA start address so as to overwrite the block whose state is Dirty. After the copy is completed, the state of the copy source block currently being processed is changed to Dirty, and the process proceeds to step 1302.
In step 1302, the PBA value in the flag information 406 of the flag 404 of the copied block is corrected to the PBA value of the copy destination block, and the process proceeds to step 1303.
In step 1303, it is checked whether the number of entries registered in the working address translation table exceeds a threshold value separately determined. If it is exceeded, the process proceeds to step 1304, and if it is not exceeded, the process proceeds to 1306.
In step 1304, the entries are selected in the order of least used for the number of entries specified separately, and the process proceeds to step 1305.
In step 1305, the entry selected in step 1304 is saved in the block whose state next to the block that copied the most recently block on the HDD is Dirty, and the selected entry is deleted from the working address translation table. After the end of step 1305, the process proceeds to step 1306.
In step 1306, the correspondence between the copied LBA and PBA is added to the working address translation table.
In step 1123, the data type of the data structure 406 of the block flag 404 is examined, and if the data type is the saved data 405, which is the saved address conversion table, the process proceeds to step 1113, and if not, the process proceeds to step 713.
In step 713, seek to the next block.
After the end of the loop in step 710, the process proceeds to step 1103.
In step 1103, the working address translation table and the address translation table 407 are exchanged so that the address translation table for which the area reuse processing has been completed can be referred to in the subsequent access.
If you want to translate the address according to the access from the host during the area reuse process, follow the procedure below. (1) Convert from LBA to PBA by referring to the address translation table 407. (2) Check if the converted PBA is larger than the address being worked on in loop 1110 or loop 710. (3) If it is larger than the address you are working on, use that PBA. (4) If it is smaller than the working address, refer to the working address translation table and use the PBA converted from LBA to PBA.
According to this embodiment, there is an effect that the area reuse process can be performed while allowing access to the normal HDD volume.
<figref num="1">The block diagram of the software processing layer of 1st Embodiment of the control method of a disk apparatus according to this invention.</figref><figref num="2">Block diagram of software processing layer of HDD control method by conventional technology.</figref><figref num="3">The PAD diagram of the WRITE process according to the 1st Embodiment of the control method of the disk apparatus according to this invention.</figref><figref num="4">The figure which shows the data format by 1st Embodiment of the control method of a disk apparatus by this invention.</figref><figref num="5">The PAD diagram of the READ process according to the 1st Embodiment of the control method of the disk apparatus according to this invention.</figref><figref num="6">The figure which shows the data format by the 2nd Embodiment of the control method of the disk apparatus by this invention.</figref><figref num="7">FIG. 5 is a PAD diagram of a method for recovering from a failure of an address translation table according to a third embodiment of the method for controlling a disk device according to the present invention.</figref><figref num="8">FIG. 5 is a PAD diagram of a method for recovering from a failure of an address translation table according to a fourth embodiment of the method for controlling a disk device according to the present invention.</figref><figref num="9">The PAD figure of the snapshot construction method according to the 5th Embodiment of the control method of the disk apparatus according to this invention.</figref><figref num="10">The PAD diagram of the WRITE invalidation method according to the sixth embodiment of the control method of a disk device according to the present invention.</figref><figref num="11">The PAD figure of the area reuse method by the 7th Embodiment of the control method of the disk apparatus by this invention.</figref><figref num="12">PAD diagram of subroutine 1112 according to the seventh embodiment of the control method of the disk device according to the present invention.</figref><figref num="13">PAD diagram of subroutine 1122 according to a seventh embodiment of the method for controlling a disk device according to the present invention.</figref><figref num="14">The block diagram of the hardware of the 1st Embodiment of the disk apparatus according to this invention.</figref><figref num="15">Diagram showing the SCSI WRITE (16) command.</figref><figref num="16">Diagram showing the SCSI READ (16) command.</figref><figref num="17">Conceptual diagram of a one-way linked list.</figref><figref num="18">Conceptual diagram of a bidirectional linked list.</figref><figref num="19">The conceptual diagram of the area reuse method by the 7th Embodiment of the disk apparatus by this invention.</figref>
Code description
100 Software processing layer 101 of the first embodiment of the control method of the disk device according to the present invention Protocol processing layer 102 that processes ATA and SCSI which are communication protocols between the host and the HDD Logical block address (LBA) log specified by the host. Log conversion layer to convert to physical block address (PBA) accessed in format 103 Defective sector replacement layer to replace a spare sector when the specified PBA is a defective sector 104 On the storage medium of the HDD with the specified PBA Physical access processing to access 201 Converting LBA specified by the host to PBA by mathematical processing Address conversion layer 400 Data format of the first embodiment according to the present invention 401 Image of address space of HDD recording medium 402 One-time writing Unit 403 User data 404 Flag 405 Saved data of the address conversion table saved on the recording medium of the HDD 406 Data structure inside the flag 407 Address conversion table on the cache memory of the HDD 408 Physical block address management table on the cache memory of the HDD that manages the address conversion table saved on the storage medium of the HDD 600 Data format of the second embodiment of the present invention 601 Flag 602 One write unit 603 Inside the flag Data Structure 1400 Hardware Blocks of First Embodiment of Disk Device According to the Invention Figure 1401 Flashrom 1402 Main Storage 1403 Cache Memory 1404 Microprocessor (MPU) 1405 Hard Disk Controller (HDC) and SCSI Protocol Controller (SPC) 1406 Servo Controller 1407 Read / Write Channel 1500 SCSI WRITE (16) Command 1501 OPERATION CODE 1502 LOGICAL BLOCK ADDRESS 1503 TRANSFER LENGTH 1600 SCSI READ (16) Command 1601 OPERATION CODE CODE) 1602 Logical block address (LOGICAL BLOCK ADDRESS) 1603 TRANSFER LENGTH 1700 One-way linked list conceptual diagram 1701 Link from the current address translation table's save block to the previous address translation table's save block 1800 Two-way linked list conceptual diagram 1801 Previous address translation Link from the table shelter block to the current address translation table shelter block
Every citation, both ways
| Document | Relation | Office | Cited during |
|---|---|---|---|
| US8363349B2 | Cited by | United States of America | Applicant |
| USRE48952E | Cited by | United States of America | Applicant |
| US8402235B2 | Cited by | United States of America | Applicant |
| JP2015026358A | Cited by | Japan | Examiner |
| US8416518B2 | Cited by | United States of America | Applicant |
| JP2012243385A | Cited by | Japan | Search report |
| JP2015026358A | Cited by | Japan | Search report |
| USRE48952E | Cited by | United States of America | Applicant |
2 priority claims, no other members on record
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 2004110413 | Japan | A | |
| JP20040110413 | – | – | – |
4 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Decision of refusalA02 | A02 | |
| Notification of reasons for refusalA131 | A131 | |
| Report on retrievalA977 | A977 | |
| Written request for application examinationA621 | A621 |
Numbers
- Publication
- 2005293774
- Publication, DOCDB
- 2005293774
- Publication, EPODOC
- JP2005293774
- Application
- 110413
- Application, DOCDB
- 2004110413
- Application, EPODOC
- JP20040110413
Titles3
- English
- CONTROL METHOD OF DISK UNIT
- Japanese
- ディスク装置の制御方法
- English
- Disk device control method
Classification
- CPC, 1
- G06F12/0223
- IPC, 6
- G11B20 12
- G06F12 02
- G06F12 08
- G11B20 10
- G11B27 00
- G11B27 10