JP6276604B2 - Information processing apparatus and control method thereof - Google Patents

Information processing apparatus and control method thereof Download PDF

Info

Publication number
JP6276604B2
JP6276604B2 JP2014023772A JP2014023772A JP6276604B2 JP 6276604 B2 JP6276604 B2 JP 6276604B2 JP 2014023772 A JP2014023772 A JP 2014023772A JP 2014023772 A JP2014023772 A JP 2014023772A JP 6276604 B2 JP6276604 B2 JP 6276604B2
Authority
JP
Japan
Prior art keywords
file system
information processing
processing apparatus
backup
repair
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2014023772A
Other languages
Japanese (ja)
Other versions
JP2015152972A (en
JP2015152972A5 (en
Inventor
哲彦 矢尾
哲彦 矢尾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2014023772A priority Critical patent/JP6276604B2/en
Publication of JP2015152972A publication Critical patent/JP2015152972A/en
Publication of JP2015152972A5 publication Critical patent/JP2015152972A5/ja
Application granted granted Critical
Publication of JP6276604B2 publication Critical patent/JP6276604B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

本発明はファイルシステムの修復を行う情報処理装置およびその制御方法に関する。   The present invention relates to an information processing apparatus for repairing a file system and a control method thereof.

不揮発性メモリを含む情報処理装置において、不揮発性メモリへの書き込み処理中に電源遮断などによって書き込み処理が中断されると、ファイルシステム内の整合性が崩れる場合がある。   In an information processing apparatus including a nonvolatile memory, if the writing process is interrupted due to a power interruption or the like during the writing process to the nonvolatile memory, the consistency in the file system may be lost.

ファイルシステムとは、情報処理装置上で動作するオペレーティングシステム(OS)が提供する機能の一つであり、情報処理装置が保持するデータを管理するためのものである。ファイルシステムはデータのみでなく、不揮発性メモリ上でのデータ保存位置情報、ファイル名、作成・変更時間といった、データを管理するための情報(メタデータ)も保持している。   The file system is one of functions provided by an operating system (OS) that operates on the information processing apparatus, and is for managing data held by the information processing apparatus. The file system holds not only data but also information (metadata) for managing data such as data storage position information on the nonvolatile memory, file name, and creation / change time.

情報処理装置の電源遮断や故障等により、ファイルシステムへの書き込み処理が途中で中断され、メタデータに記載されているデータ保存位置情報と実際のデータ保存位置の整合性等が崩れると、以降はそのデータへのアクセスが不可能となることがある。このような不具合の発生を防ぐために、ジャーナリングと呼ばれる機構を搭載したファイルシステム(ジャーナリングファイルシステム)が存在する。   If the writing process to the file system is interrupted in the middle due to power failure or failure of the information processing device, and the consistency between the data storage location information described in the metadata and the actual data storage location is lost, etc. Access to the data may be impossible. In order to prevent such a problem from occurring, there is a file system (journaling file system) equipped with a mechanism called journaling.

ジャーナリングファイルシステムでは、実データの書き込み前にメタデータをジャーナルと呼ばれる領域に書き込んでおく。これにより、データの不整合が発生しても、ジャーナルを参照して不整合が発生する前のメタデータに強制的に戻すことにより、ファイルシステムの整合性を保ち、実データへのアクセスが不可能となる事態を防ぐことが出来る(例えば、特許文献1参照)。   In the journaling file system, metadata is written in an area called a journal before actual data is written. As a result, even if data inconsistency occurs, by referencing the journal and forcing it back to the metadata before the inconsistency occurred, the file system consistency is maintained and access to the actual data is lost. This makes it possible to prevent such a situation (see, for example, Patent Document 1).

しかし、ジャーナリングファイルシステムであっても、不揮発性メモリの故障や装置のシステム暴走によるメタデータ書き換え等に起因する不整合を防ぐことは出来ないため、ファイルシステムを修復して整合性を保つための手段が必要となる。そのために、ファイルシステム上に不整合が発生した場合の修復方法が提供されている(例えば、特許文献2参照)。   However, even with a journaling file system, it is impossible to prevent inconsistencies caused by non-volatile memory failure or metadata rewriting due to system runaway of the device. Means are needed. For this reason, there is provided a repair method when inconsistency occurs on the file system (see, for example, Patent Document 2).

Linux(登録商標)でも同等の機能を実現するために、ファイルシステムの不整合が発生した箇所を修正する、fsckと呼ばれるコマンドが用意されている。fsckには対話モードと一括適用モードが存在しており、対話モードの場合は、不整合発生箇所ごとに整合性をとるか否かをユーザに尋ね、一括適用モードの場合は全ての不整合発生箇所の修正を試みる。なお、fsckによる修正ができなかった場合、ファイルシステムの整合性を保つためにデータが削除され、正常なデータが破壊されてしまう可能性があるため、fsck実施前にはファイルシステムのバックアップを取っておくことが推奨されている。   In order to realize an equivalent function even in Linux (registered trademark), a command called fsck is prepared for correcting a portion where a file system inconsistency has occurred. fsck has an interactive mode and a batch application mode. In the interactive mode, the user is asked whether or not consistency occurs at each location where inconsistencies occur. In the batch application mode, all inconsistencies occur. Attempt to correct the location. If the file system cannot be corrected by fsck, the data may be deleted to maintain the integrity of the file system, and normal data may be destroyed. It is recommended to keep it.

特開2005-149248号公報JP 2005-149248 A 特開平1-270156号公報JP-A-1-270156

上述したように、ファイルシステムを修復前の状態に戻すには、ファイルシステムのバックアップを保存しておく必要がある。しかしながら上記従来の技術では、対象ファイルシステムの全領域を保存しなければならないため、必要なバックアップ容量が大きくなり、かつバックアップ時間も長くなってしまう。   As described above, in order to return the file system to the state before the repair, it is necessary to save a backup of the file system. However, in the above conventional technique, since the entire area of the target file system has to be saved, the required backup capacity increases and the backup time also increases.

本発明は上述した問題を解決するためになされたものであり、ファイルシステムの修復に必要となるバックアップ容量を削減することを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to reduce the backup capacity necessary for restoring the file system.

上記課題を解決するための一手段として、本発明の情報処理装置は以下の構成を備える。すなわち、情報処理装置であって、
ファイルシステムにおける修復の必要性を検知する検知手段と、
前記ファイルシステムの修復の必要性が検知された場合に、該ファイルシステムを構成するデータの一部のバックアップを作成するバックアップ手段と、
前記バックアップの作成後に、前記ファイルシステムの修復を行う修復手段と、
前記ファイルシステムの修復後に、前記情報処理装置のシステムの再起動を行う再起動手段と、
前記システムの再起動が正常に行われなかった場合に、前記バックアップから、前記修復の前且つ前記検知の後のファイルシステムを復元する復元手段と
を有することを特徴とする。
As a means for solving the above problems, an information processing apparatus according to the present invention has the following configuration. That is, an information processing apparatus,
A detection means for detecting the necessity of repair in the file system;
Backup means for creating a backup of a part of data constituting the file system when the necessity of repairing the file system is detected;
A repair means for repairing the file system after creating the backup;
Restart means for restarting the system of the information processing apparatus after the file system is repaired;
Restore means for restoring the file system before the restoration and after the detection from the backup when the system is not restarted normally .

さらに詳細には、前記ファイルシステムの修復後に、情報処理装置のシステムの再起動を行う再起動手段と、前記システムの再起動が正常に行われなかった場合に、前記バックアップから前記ファイルシステムを復元する復元手段と、を有することを特徴とする。   More specifically, after the file system is restored, a restart unit for restarting the system of the information processing apparatus, and the file system is restored from the backup when the system is not restarted normally. And restoring means.

本発明によれば、ファイルシステムの修復に必要となるバックアップ容量を削減することができる。   According to the present invention, it is possible to reduce the backup capacity required for file system repair.

本発明の一実施形態に係る情報処理装置の構成を示す概略図Schematic which shows the structure of the information processing apparatus which concerns on one Embodiment of this invention. 情報処理装置におけるハードウェア構成例を示す図The figure which shows the hardware structural example in information processing apparatus ファイルシステムの修復処理を示すフローチャートFlow chart showing file system repair processing ファイルシステムの構成を示す図Diagram showing the configuration of the file system ファイルシステム修復処理を示すフローチャートFlow chart showing file system repair processing 修正前のファイルシステムの構成例を示す図Diagram showing an example of the file system configuration before modification ファイルシステムバックアップデータの構成例を示す図Figure showing a configuration example of file system backup data

以下、本発明にかかる実施形態について、図面を参照して説明する。なお、以下の実施形態は特許請求の範囲に関わる本発明を限定するものではなく、また、本実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。   Hereinafter, embodiments according to the present invention will be described with reference to the drawings. The following embodiments do not limit the present invention related to the scope of claims, and all the combinations of features described in the present embodiments are not necessarily essential to the solution means of the present invention. Absent.

<第1実施形態>
●装置構成
図1は、本発明のファイルシステム修復を行う情報処理装置において、特にファイルシステム修復にかかる基本的な機能構成を示す。同図において、100は本発明を実装した情報処理装置を表す。
<First Embodiment>
Apparatus Configuration FIG. 1 shows a basic functional configuration particularly related to file system repair in an information processing apparatus for file system repair according to the present invention. In the figure, reference numeral 100 denotes an information processing apparatus implementing the present invention.

情報処理装置100において、101はファイルシステム110に修復の必要性があるか否かを確認する異常検知部である。異常検知部101は、電源投入等によるシステム起動時に、ファイルシステム110に不整合が発生しているかを調査する。そして不整合が発生した場合に修復の必要性があると判断し、その旨をファイルシステム情報バックアップ部102、ディレクトリ情報バックアップ部103、ファイル情報バックアップ部104のそれぞれに通知する。   In the information processing apparatus 100, reference numeral 101 denotes an abnormality detection unit that confirms whether or not the file system 110 needs to be repaired. The abnormality detection unit 101 investigates whether a mismatch occurs in the file system 110 at the time of system startup due to power-on or the like. When inconsistency occurs, it is determined that there is a need for repair, and the fact is notified to each of the file system information backup unit 102, the directory information backup unit 103, and the file information backup unit 104.

102は、ファイルシステム110のシステム情報を安全なメモリ上に保存するファイルシステム情報バックアップ部である。103はファイルシステム110に存在するディレクトリ情報を安全なメモリ上に保存するディレクトリ情報バックアップ部である。104は、ファイルシステム110に存在するファイル情報を安全なメモリ上に保存するファイル情報バックアップ部である。これら102、103、104の各バックアップ部は、異常検知部101からファイルシステム110における修復の必要性を通知された際に動作し、ファイルシステム110から対象の情報を取得してバックアップデータ109を生成する。そしてバックアップデータ109の作成後に、修復部105に対してバックアップ処理が終了した旨を通知する。   Reference numeral 102 denotes a file system information backup unit that stores system information of the file system 110 in a secure memory. Reference numeral 103 denotes a directory information backup unit that saves directory information existing in the file system 110 on a secure memory. A file information backup unit 104 saves file information existing in the file system 110 on a secure memory. Each of the backup units 102, 103, and 104 operates when the abnormality detection unit 101 is notified of the necessity of repair in the file system 110, and obtains target information from the file system 110 to generate backup data 109. To do. Then, after the backup data 109 is created, the restoration unit 105 is notified that the backup process has been completed.

105はファイルシステム110で発生している不整合の修復を試みる修復部であり、修復処理の終了後、再起動部106に修復処理が終了した旨を通知する。106は情報処理装置100におけるシステムの再起動を行う再起動部であり、システムの再起動後、起動結果検知部107に再起動処理が終了した旨を通知する。107はシステムが正常に起動し、動作しているかを確認する起動結果検知部であり、システムの起動失敗が検知されると、その旨をバックアップ復元部108に通知する。108はバックアップデータ109を用いて、ファイルシステム110を修復部105による修復処理以前の状態に復元するバックアップ復元部である。   Reference numeral 105 denotes a repair unit that attempts to repair an inconsistency occurring in the file system 110. After the repair process is completed, the repair unit 105 notifies the restart unit 106 that the repair process has ended. Reference numeral 106 denotes a restart unit that restarts the system in the information processing apparatus 100. After the system is restarted, the restart result detection unit 107 is notified that the restart process has been completed. Reference numeral 107 denotes an activation result detection unit that confirms whether the system is normally activated and operating. When a system activation failure is detected, the activation result detection unit 107 notifies the backup restoration unit 108 of that fact. A backup restoration unit 108 restores the file system 110 to a state before the restoration process by the restoration unit 105 using the backup data 109.

以上が本実施形態の情報処理装置におけるファイルシステム修復にかかる基本的な構成である。以下、本実施形態におけるシステム構成およびファイルシステムの復元処理手順について、システムがUNIX(登録商標)系のオペレーティングシステム(OS)であるLinux(登録商標)、ファイルシステムがext3形式である場合を想定して具体的に説明する。   The above is the basic configuration related to the file system restoration in the information processing apparatus of this embodiment. Hereinafter, regarding the system configuration and the file system restoration processing procedure in this embodiment, it is assumed that the system is Linux (registered trademark), which is a UNIX (registered trademark) operating system (OS), and the file system is ext3 format. Will be described in detail.

図2は、本実施形態の情報処理装置におけるハードウェア構成の一部を示すブロック図である。同図において、CPU201は、OSやプログラムを実行することで情報処理装置200の全体を制御する。なお、本実施形態におけるファイルシステムの復元処理は、CPU201でプログラムを実行することによって提供される。揮発性メモリ202は、プログラムやデータを一時記憶するランダムアクセスメモリ(RAM)であり、システムメモリとも称する。不揮発性メモリ203は、ハードディスクドライブ(HDD)のような、電源供給の遮断後もデータやプログラムを記録しておくことが可能な(不揮発な)記憶媒体である。本実施形態のファイルシステム110およびバックアップデータ109は不揮発性メモリ203に保持される。   FIG. 2 is a block diagram illustrating a part of the hardware configuration of the information processing apparatus according to the present embodiment. In the figure, a CPU 201 controls the entire information processing apparatus 200 by executing an OS and a program. Note that the file system restoration processing in this embodiment is provided by the CPU 201 executing a program. The volatile memory 202 is a random access memory (RAM) that temporarily stores programs and data, and is also referred to as a system memory. The non-volatile memory 203 is a (non-volatile) storage medium such as a hard disk drive (HDD) in which data and programs can be recorded even after power supply is cut off. The file system 110 and backup data 109 of this embodiment are held in the nonvolatile memory 203.

●ファイルシステム修復処理概要
以下、システムの起動時(または再起動時)におけるファイルシステム110の修復処理について、図3のフローチャートを用いて説明する。
Outline of File System Repair Processing Hereinafter, the repair processing of the file system 110 at the time of system startup (or restart) will be described using the flowchart of FIG.

まずS300でシステムが起動されると、S301で異常検知部101が、ファイルシステム110に修復の必要性があるか否かを確認する。具体的には、ファイルシステム110のメタデータ(ファイル管理情報)に不整合が発生しているかを確認し、不整合が発生していなければそのまま処理を終了する。不整合が発生していれば、S302でファイルシステム情報バックアップ部102、ディレクトリ情報バックアップ部103、ファイル情報バックアップ部104が、ファイルシステム110のバックアップ処理を行う。ファイルシステム110の不整合が発覚した場合、従来であれば当該ファイルシステム110の完全なコピーをバックアップとして保存していたが、本実施形態では、修復処理の対象となる部分のみをバックアップデータ109として保存することを特徴とする。このバックアップ処理の詳細については後述する。   First, when the system is activated in S300, the abnormality detection unit 101 confirms whether or not the file system 110 needs to be repaired in S301. Specifically, it is confirmed whether or not inconsistency occurs in the metadata (file management information) of the file system 110, and if there is no inconsistency, the processing is terminated as it is. If inconsistency occurs, the file system information backup unit 102, the directory information backup unit 103, and the file information backup unit 104 perform backup processing of the file system 110 in S302. When an inconsistency in the file system 110 is detected, conventionally, a complete copy of the file system 110 is stored as a backup. However, in the present embodiment, only the portion to be repaired is used as the backup data 109. It is characterized by storing. Details of this backup processing will be described later.

バックアップの作成終了後、S303で修復部105が、ファイルシステム110の不整合の修復をfsckコマンドを用いて行う。なおfsckコマンドによる修復処理の詳細については後述する。   After the creation of the backup is completed, in S303, the restoration unit 105 uses the fsck command to repair the inconsistency of the file system 110. Details of the repair process using the fsck command will be described later.

ファイルシステム110の修復後、S304で再起動部106がシステムの再起動を行い。S305で起動結果検知部107が、システムが正常に起動できたか否かを確認する。具体的には、システムの起動開始時または再起動開始時にウォッチドックタイマをセットし、システムの正常な起動が確認できた時にウォッチドックタイマを解除する。したがって、システムが正常に起動できない場合にはウォッチドックタイマが解除されず、所定時間の経過後にタイムアップとなる。システムが正常に起動できればそのまま図3の処理を終了するが、正常起動できなかった場合にはS306に進み、ファイルシステム110のバックアップ復元処理を行う。   After the file system 110 is repaired, the restart unit 106 restarts the system in S304. In S305, the activation result detection unit 107 confirms whether or not the system has been activated normally. Specifically, a watchdog timer is set at the start of system startup or restart, and the watchdog timer is canceled when normal startup of the system is confirmed. Therefore, when the system cannot be started normally, the watchdog timer is not canceled and the time is up after a predetermined time has elapsed. If the system can be started normally, the processing in FIG. 3 is terminated as it is. If the system has not been started normally, the process proceeds to S306, and the backup restoration processing of the file system 110 is performed.

S306ではバックアップ復元部108が、S302で保存したバックアップデータ109を用いてファイルシステム110をS303による修復処理前の状態に戻す。この復元は、従来であれば修復が施されたファイルシステムを、バックアップとして保存されたファイルシステムで完全に置き換えることで実現した。本実施形態ではファイルシステム110の復元を、バックアップとして保存したメタデータをファイルシステム110上の適切な箇所に戻すことのみによって行う。このバックアップ復元処理により、ファイルシステム110がS302での修復処理によって何らかの変更が加えられていた場合であっても、該修復前の状態に確実に戻すことができる。   In S306, the backup restoration unit 108 uses the backup data 109 saved in S302 to return the file system 110 to the state before the restoration processing in S303. This restoration was realized by completely replacing the file system that had been repaired in the past with a file system saved as a backup. In this embodiment, the file system 110 is restored only by returning the metadata stored as a backup to an appropriate location on the file system 110. By this backup restoration process, even if the file system 110 has been changed in some way by the repair process in S302, it can be reliably returned to the state before the repair.

なお、S301およびS305での各検知処理は、OSが起動する前段階、例えばブートローダの起動後に行われる。ただし、これらの検知処理をOSに組み込むことも可能である。   Each detection process in S301 and S305 is performed before the OS is started, for example, after the boot loader is started. However, these detection processes can be incorporated into the OS.

また、S306でファイルシステムが復元された後に、ファイルシステムに発生した障害内容の詳細な調査を行っても良いし、他の修復処理を試みても良い。また、ファイルシステムの異常はそのままにシステムを起動させても良い。   Further, after the file system is restored in S306, a detailed investigation of the content of the failure that has occurred in the file system may be performed, or other repair processing may be attempted. Further, the system may be started up with the file system abnormality intact.

●ext3ファイルシステム
ここで、本実施形態において不揮発性メモリ203にファイルシステム110として保持・利用されるext3ファイルシステムの構造について、図4を用いて説明する。同図において、400はブートブロックであり、システムを起動する際に必要となるデータを保持する。401、402は、ext3ファイルシステムを構成する複数のブロックグループである。
Ext3 File System Here, the structure of the ext3 file system held and used as the file system 110 in the nonvolatile memory 203 in this embodiment will be described with reference to FIG. In the figure, reference numeral 400 denotes a boot block, which holds data necessary for starting the system. 401 and 402 are a plurality of block groups constituting the ext3 file system.

次に、N番目のブロックグループ402(以下、単にブロックグループと称する)の詳細構成について説明する。スーパーブロック500はブロックグループ内に1ブロックのみ存在し、ファイルシステムの構成に関する様々な情報を表す。1つのファイルシステムは1つのスーパーブロックを保持し、すなわち全てのブロックグループは同一の値を持つスーパーブロックを保持する。   Next, a detailed configuration of the Nth block group 402 (hereinafter simply referred to as a block group) will be described. The super block 500 exists only in one block in the block group, and represents various information regarding the configuration of the file system. One file system holds one super block, that is, all block groups hold super blocks having the same value.

グループディスクリプタ501は、ブロックグループの管理情報を保持し、ファイルシステム内に存在するブロックグループの数だけ存在する。データブロックビットマップ502は、データブロック上の空きを管理し、ブロックグループ内に1ブロックのみ存在する。iノードビットマップ503は、iノードの空きを管理するためのビットマップであり、ブロックグループ内に1ブロックのみ存在する。iノードテーブル504はiノードを保持するテーブルであり、ブロックグループ内に複数存在し、1テーブルごとに32個のiノードを格納する。   The group descriptor 501 holds block group management information, and there are as many block groups as exist in the file system. The data block bitmap 502 manages the free space on the data block, and only one block exists in the block group. The i-node bitmap 503 is a bitmap for managing the vacancy of the i-node, and there is only one block in the block group. An i-node table 504 is a table that holds i-nodes. A plurality of i-node tables 504 exist in a block group, and 32 i-nodes are stored for each table.

以上のスーパーブロック500〜iノードテーブル504までの部分が、ファイルシステムのメタデータを表す。メタデータはすなわちファイル管理情報であり、ファイルシステムそのものの情報を示すファイルシステム情報と、ファイルごとの情報を示すファイル情報からなる。ファイルシステムが実際に管理するファイルおよびディレクトリ等のデータは、データブロック505に格納される。なお、ext3ではディレクトリもファイルの一種類として扱われ、ファイルのデータ部分に、ディレクトリに含まれるファイルをテーブル管理するディレクトリエントリが記録される。   The above-described parts from the super block 500 to the i-node table 504 represent file system metadata. The metadata is file management information, and includes file system information indicating information of the file system itself and file information indicating information for each file. Data such as files and directories actually managed by the file system is stored in the data block 505. In ext3, a directory is also handled as one type of file, and a directory entry for managing a table of files included in the directory is recorded in the data portion of the file.

ここで、iノードテーブル504が保持するiノードについて説明する。iノードは、ファイルの構成データを扱う。具体的には、ファイルの種類(通常ファイル、ディレクトリ、シンボリックリンク)、ファイルサイズ、アクセス時間、作成時間、修正時間、削除時間、ブロックサイズ、データブロック505へのポインタ、ハードリンク数を示す参照カウント、等を保持する。   Here, i-nodes stored in the i-node table 504 will be described. The i-node handles file configuration data. Specifically, file type (regular file, directory, symbolic link), file size, access time, creation time, modification time, deletion time, block size, pointer to data block 505, reference count indicating the number of hard links Hold, etc.

次に、ディレクトリエントリについて説明する。ディレクトリエントリとは、ファイルシステム内でのディレクトリ情報をテーブル管理するものであり、データブロック505上に作成される。具体的には1エントリごとに、iノード番号、レコード長、ファイルタイプ、ファイル名の長さ、ファイル名等を保持する。   Next, the directory entry will be described. The directory entry is used to manage the directory information in the file system as a table, and is created on the data block 505. Specifically, the i-node number, record length, file type, file name length, file name, etc. are held for each entry.

●ファイルシステム修復処理(S302)
以下、上記S302において修復部105で実行される、fsckによるext3ファイルシステムの修復処理について、図5のフローチャートを用いて説明する。
● File system repair processing (S302)
Hereinafter, the restoration process of the ext3 file system by fsck executed by the restoration unit 105 in S302 will be described with reference to the flowchart of FIG.

まずS600でiノードテーブルの検査を行い、不整合が存在しないかを確認する。   First, in step S600, the i-node table is checked to check whether there is any inconsistency.

そしてS601でディレクトリエントリの検査を行い、ディレクトリエントリが保持する値に不整合が発生していないかを確認する。次にS602でディレクトリエントリ間での接続性(コネクティビティ)を確認し、不整合が発生していないかを確認する。   In step S601, the directory entry is inspected to confirm whether or not inconsistency occurs in the value held in the directory entry. Next, in S602, the connectivity (connectivity) between the directory entries is confirmed, and it is confirmed whether any inconsistency has occurred.

そしてS603でiノードが保持する、ハードリンク数を示す参照カウントの検査を行い、不整合が発生していないかを確認する。そしてS604で、ディスク上のブロックとiノードビットマップに不整合が発生していないかを確認する。なおfsckによれば、上記各確認の後、不整合が発生していればその発生箇所の修復処理を直ちに行うことはもちろんである。   In step S603, the reference count indicating the number of hard links held by the i-node is inspected to confirm whether inconsistency has occurred. In S604, it is confirmed whether or not there is a mismatch between the block on the disk and the i-node bitmap. Of course, according to fsck, if any inconsistency occurs after each of the above confirmations, the repair processing of the occurrence location is immediately performed.

図5によれば、fsckではメタデータとディレクトリエントリのみに対して修復を試みていることが分かる。したがって本実施形態では、修復対象となるメタデータとディレクトリエントリのみを、バックアップ対象として保存する。   According to FIG. 5, it can be seen that fsck is trying to repair only metadata and directory entries. Therefore, in this embodiment, only metadata and directory entries to be repaired are stored as backup targets.

●バックアップ処理(S301)/バックアップ復元処理(S305)
以下、上記S301におけるバックアップ処理、および上記S305におけるバックアップ復元処理について説明する。
Backup processing (S301) / Backup restoration processing (S305)
Hereinafter, the backup process in S301 and the backup restoration process in S305 will be described.

図6に、バックアップ前、すなわちバックアップ対象となるext3ファイルシステム110の構成例を示す。700はext3ファイルシステム110の全体を表し、701、702、703、704がブロックグループ毎のメタデータを示す。また705、706、707、708,709が、ファイルシステム700に存在するディレクトリエントリを示す。   FIG. 6 shows a configuration example of the ext3 file system 110 before backup, that is, the backup target. 700 represents the entire ext3 file system 110, and 701, 702, 703, and 704 represent metadata for each block group. Reference numerals 705, 706, 707, 708, and 709 denote directory entries existing in the file system 700.

図7に、図6に示すファイルシステム700のバックアップデータ109の構成例を示す。800はバックアップデータ109の全体である。801は、ファイルシステム700上でのメタデータ701の保存先を示す保存先データであり、メタデータ701がファイルシステム700上の何処に存在していたかを示す。S305でバックアップ復元処理を実行する際には、保存先データ801を用いることで、メタデータ701をファイルシステム700上の正しい位置に戻すことができる。   FIG. 7 shows a configuration example of the backup data 109 of the file system 700 shown in FIG. Reference numeral 800 denotes the entire backup data 109. Reference numeral 801 denotes storage destination data indicating the storage destination of the metadata 701 on the file system 700, and indicates where the metadata 701 exists on the file system 700. When the backup restoration process is executed in S305, the metadata 701 can be returned to the correct position on the file system 700 by using the storage destination data 801.

図7によれば、バックアップデータ800には、図6に示すメタデータ701、702、703、704のそれぞれに保存先データ801、802、803、804が付されて保持されていることが分かる。ディレクトリエントリ705、706、707、708、709についても同様に、ファイルシステム700上での保存先を示す保存先データ805、806、807、808、809が付されて保持されている。これら保存先データにより、fsckでの修復対象となる各メタデータおよびディレクトリエントリがファイルシステム700上の正しい位置に修復される。なお、メタデータ701、702、703、704およびその保存先データ801、802、803、804はファイルシステム情報バックアップ部102およびファイル情報バックアップ部104によって作成される。また、ディレクトリエントリ705、706、707、708、709およびその保存先データ805、806、807、808、809はディレクトリ情報バックアップ部103によって作成される。   According to FIG. 7, it can be seen that the backup data 800 holds the metadata 701, 702, 703, and 704 shown in FIG. Similarly, the directory entries 705, 706, 707, 708, and 709 are stored with storage destination data 805, 806, 807, 808, and 809 indicating storage destinations on the file system 700. With these storage destination data, each metadata and directory entry to be restored by fsck is restored to the correct position on the file system 700. The metadata 701, 702, 703, and 704 and the storage destination data 801, 802, 803, and 804 are created by the file system information backup unit 102 and the file information backup unit 104. Directory entries 705, 706, 707, 708, and 709 and their storage destination data 805, 806, 807, 808, and 809 are created by the directory information backup unit 103.

以上説明したように本実施形態によれば、fsckでの修復対象となるメタデータとディレクトリエントリの情報のみをバックアップし、システム再起動時の修復失敗を検知してファイルシステムを修復前の状態に復元する。これにより、ファイルシステムの修復を安全に行うために必要となるバックアップ容量を減らしつつ、修復失敗によるデータの消失を防止してファイルシステムの保持を可能にする。したがって、メモリ制約が強い組み込み機器上においても、fsckによるファイルシステムの安全な修復作業が可能となる。   As described above, according to the present embodiment, only the metadata and directory entry information to be repaired by fsck are backed up, and a repair failure at the time of system restart is detected to bring the file system to the state before repair. Restore. As a result, it is possible to maintain the file system by preventing the loss of data due to the repair failure while reducing the backup capacity required for the safe repair of the file system. Therefore, the file system can be safely repaired by fsck even on an embedded device having a strong memory constraint.

<他の実施形態>
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(コンピュータ可読のプログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給する。そして、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
<Other embodiments>
The present invention can also be realized by executing the following processing. That is, software (computer-readable program) that implements the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media. The system or apparatus computer (or CPU, MPU, or the like) reads out and executes the program.

Claims (13)

情報処理装置であって、
ファイルシステムにおける修復の必要性を検知する検知手段と、
前記ファイルシステムの修復の必要性が検知された場合に、該ファイルシステムを構成するデータの一部のバックアップを作成するバックアップ手段と、
前記バックアップの作成後に、前記ファイルシステムの修復を行う修復手段と、
前記ファイルシステムの修復後に、前記情報処理装置のシステムの再起動を行う再起動手段と、
前記システムの再起動が正常に行われなかった場合に、前記バックアップから、前記修復の前且つ前記検知の後のファイルシステムを復元する復元手段と
を有することを特徴とする情報処理装置。
An information processing apparatus,
A detection means for detecting the necessity of repair in the file system;
Backup means for creating a backup of a part of data constituting the file system when the necessity of repairing the file system is detected;
A repair means for repairing the file system after creating the backup;
Restart means for restarting the system of the information processing apparatus after the file system is repaired;
Restoration means for restoring a file system before the restoration and after the detection from the backup when the system is not restarted normally. apparatus.
前記ファイルシステムを構成するデータの一部は、前記修復手段での修復対象となる部分であることを特徴とする請求項1に記載の情報処理装置。   2. The information processing apparatus according to claim 1, wherein a part of the data constituting the file system is a part to be repaired by the repair unit. 前記バックアップ手段は、前記ファイルシステムのシステム情報、ディレクトリ情報、およびファイル情報から、前記バックアップを作成することを特徴とする請求項1又は2に記載の情報処理装置。 It said backup means, the system information of the file system, directory information, and file information, the information processing apparatus according to claim 1 or 2, characterized in that to create the backup. 前記ファイルシステムを構成するデータの一部は、前記ファイルシステムにおけるシステム情報およびファイル情報を示すメタデータ、並びにディレクトリに含まれるファイルの情報を示すディレクトリエントリであることを特徴とする請求項1乃至のいずれか1項に記載の情報処理装置。 Said part of the data constituting the file system, according to claim 1 to 3, wherein the metadata indicating the system information and file information in the file system, and a directory entry showing information of files contained in the directory The information processing apparatus according to any one of the above. 前記修復手段は、前記メタデータおよび前記ディレクトリエントリを修復対象とすることを特徴とする請求項に記載の情報処理装置。 The information processing apparatus according to claim 4 , wherein the repair unit sets the metadata and the directory entry as repair targets. 前記修復手段は、fsckコマンドにより前記ファイルシステムの修復を行うことを特徴とする請求項に記載の情報処理装置。 The information processing apparatus according to claim 5 , wherein the repair unit repairs the file system using an fsck command. 前記ファイルシステムはext3形式であることを特徴とする請求項に記載の情報処理装置。 The information processing apparatus according to claim 6 , wherein the file system is ext3 format. さらに、前記再起動手段による前記情報処理装置のシステムの再起動にかかる時間に基づき、該システムの再起動が正常に行われたか否かを検知する起動結果検知手段を有することを特徴とする請求項に記載の情報処理装置。 The information processing apparatus further comprises start result detection means for detecting whether or not the restart of the system has been normally performed based on a time required for restarting the system of the information processing apparatus by the restart means. Item 4. The information processing apparatus according to Item 1 . 前記検知手段は、前記ファイルシステムにおけるメタデータの不整合を検知することを特徴とする請求項1乃至のいずれか1項に記載の情報処理装置。 It said detection means, the information processing apparatus according to any one of claims 1 to 8, characterized in that to detect the inconsistency of the metadata in the file system. 前記検知手段は、前記情報処理装置のシステムの起動時に前記検知を行うことを特徴とする請求項1乃至のいずれか1項に記載の情報処理装置。 It said detection means, the information processing apparatus according to any one of claims 1 to 9, characterized in that said sensing at system startup of the information processing apparatus. 検知手段、バックアップ手段、修復手段、再起動手段、復元手段を有する情報処理装置の制御方法であって、
前記検知手段が、ファイルシステムにおける修復の必要性を検知し、
前記バックアップ手段が、前記ファイルシステムの修復の必要性が検知された場合に、該ファイルシステムを構成するデータの一部のバックアップを作成し、
前記修復手段が、前記バックアップの作成終了後に、前記ファイルシステムの修復を行い、
前記再起動手段が、前記ファイルシステムの修復後に、前記情報処理装置のシステムの再起動を行い、
前記復元手段が、前記システムの再起動が正常に行われなかった場合に、前記バックアップから、前記修復の前且つ前記検知の後のファイルシステムを復元することを特徴とする情報処理装置の制御方法。
A control method for an information processing apparatus having detection means, backup means, repair means , restart means, and restore means ,
The detection means detects the necessity of repair in the file system;
When the backup means detects that the file system needs to be repaired, it creates a backup of a part of the data constituting the file system,
Said repair means, after the creation end the backup, have line repair of the file system,
The restarting means restarts the system of the information processing apparatus after repairing the file system,
The information processing apparatus control method , wherein the restoration unit restores the file system before the restoration and after the detection from the backup when the system is not restarted normally. .
コンピュータ装置で実行されることにより、該コンピュータ装置を請求項1乃至10のいずれか1項に記載の情報処理装置の各手段として機能させるためのプログラム。 A program for causing a computer device to function as each unit of the information processing device according to any one of claims 1 to 10 , when the computer device is executed. 請求項12に記載のプログラムを記憶したことを特徴とするコンピュータ可読な記憶媒体。 A computer-readable storage medium storing the program according to claim 12 .
JP2014023772A 2014-02-10 2014-02-10 Information processing apparatus and control method thereof Expired - Fee Related JP6276604B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014023772A JP6276604B2 (en) 2014-02-10 2014-02-10 Information processing apparatus and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014023772A JP6276604B2 (en) 2014-02-10 2014-02-10 Information processing apparatus and control method thereof

Publications (3)

Publication Number Publication Date
JP2015152972A JP2015152972A (en) 2015-08-24
JP2015152972A5 JP2015152972A5 (en) 2017-03-09
JP6276604B2 true JP6276604B2 (en) 2018-02-07

Family

ID=53895196

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014023772A Expired - Fee Related JP6276604B2 (en) 2014-02-10 2014-02-10 Information processing apparatus and control method thereof

Country Status (1)

Country Link
JP (1) JP6276604B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3195107B2 (en) * 1993-02-15 2001-08-06 三菱化学株式会社 Information recording medium and initialization method thereof
US9053060B2 (en) * 2009-09-29 2015-06-09 Canon Kabushiki Kaisha Information processing apparatus having file system consistency recovery function, and control method and storage medium therefor

Also Published As

Publication number Publication date
JP2015152972A (en) 2015-08-24

Similar Documents

Publication Publication Date Title
JP5705309B2 (en) Method, system and computer program for processing a backup process
US8543548B2 (en) Hierarchical management storage system and storage system operating method
US10911065B2 (en) Computer system and method including selectively compressing data files and directories based on an operator indication and representing the amount of available free space
JP4483342B2 (en) System recovery method
US10671568B2 (en) De-duplicating attachments on message delivery and automated repair of attachments
JP5077726B1 (en) Computer, control method thereof and program
JP4696171B2 (en) Storage device, data storage method, and data storage program
JP2014142852A (en) Storage system and control device
JP4940599B2 (en) Information processing apparatus, information processing apparatus control program, and information processing apparatus control method
CN101196839A (en) Data renovation and synchronization process of double-flash read-only memory
JP2014106567A (en) Storage device, restoration method, and restoration program
US9430485B2 (en) Information processor and backup method
US20140156943A1 (en) Information processing apparatus, information processing method, and program
KR20130050588A (en) Apparatus and method for recovering embedded system firmware of nas server
TW201516655A (en) System and method for recovering distributed file system
JP6276604B2 (en) Information processing apparatus and control method thereof
US10671488B2 (en) Database in-memory protection system
US8990618B2 (en) Partial fault tolerance in an embedded appliance
Cisco Managing the RDU Database
JP6327028B2 (en) Object storage system, control method thereof, and control program thereof
JP6160688B2 (en) Information processing apparatus, information processing method, and information processing program
KR101461650B1 (en) Apparatus and method for managing file system of a computing device
JP6767662B2 (en) Storage device, file replication system, file replication method, and computer program
JP6011687B1 (en) Storage device and control method thereof
JP2014006845A (en) Management method, management device and management program

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170203

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170203

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171016

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20171027

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171204

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20171215

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180112

R151 Written notification of patent or utility model registration

Ref document number: 6276604

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees