TW569131B - Hard disk data backup and recovery method - Google Patents
Hard disk data backup and recovery method Download PDFInfo
- Publication number
- TW569131B TW569131B TW90128490A TW90128490A TW569131B TW 569131 B TW569131 B TW 569131B TW 90128490 A TW90128490 A TW 90128490A TW 90128490 A TW90128490 A TW 90128490A TW 569131 B TW569131 B TW 569131B
- Authority
- TW
- Taiwan
- Prior art keywords
- hard disk
- partition
- data
- area
- backup
- Prior art date
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
Abstract
Description
569131 A7569131 A7
技術領域 本發明涉及-種計算機硬碟數據備份與恢復方法。 背景技術 ^更碟作為計算機的-種最常用的外部儲存器,用於儲存 操作系統的信息和大量的數據資料,其安全性和可靠性是 十分重要的。而用戶的誤操作、硬碟數據管理軟體的缺陷 和計算機病毒的襲擊都有可能破壞硬碟上的有用數據。所 以對硬碟數據的備份顯得十分重要,以便在必要的時候可 以恢復一些關鍵的數據内容。 在目前採用的硬碟數據備份方法中,有一種是將分區或 硬碟的信息備份成一個文件,恢復時打開該文件,將備份 的内容恢復到原分區或硬碟中去,這種備份方法是建立在 文件系統的基礎上的,一旦文件系統被破壞,如果由於病 毒的襲擊而使保存該備份文件的分區被刪除,或者該分區 被破壞以至不能再讀出該文#,則不可能恢復所備份的信 息。該備份要依賴於備份文件所在的分區的完整性和備份 文件本身的完整性,因此這種備份本身的安全性得不到保 目則所採用的硬碟數據備份方法中,其備份和恢復都存 在一些局限性,即要麼備份整個硬碟,要麼備份一個分 區,恢復時按照備份時的方式恢復整個硬碟或一個分區, -4-TECHNICAL FIELD The present invention relates to a computer hard disk data backup and recovery method. BACKGROUND OF THE INVENTION As a computer, one of the most commonly used external storage devices, it is used to store operating system information and a large amount of data. Its security and reliability are very important. Misoperations by users, defects in data management software on the hard disk, and attacks by computer viruses can all destroy useful data on the hard disk. Therefore, it is very important to back up the hard disk data so that some critical data content can be restored when necessary. Among the currently used hard disk data backup methods, one is to back up the partition or hard disk information into a file, open the file when restoring, and restore the backup content to the original partition or hard disk. This backup method It is based on the file system. Once the file system is damaged, if the partition holding the backup file is deleted due to a virus attack, or the partition is damaged so that the text # can no longer be read, it is impossible to recover Backed up information. This backup depends on the integrity of the partition where the backup file is located and the integrity of the backup file itself. Therefore, the security of this backup itself cannot be guaranteed. In the hard disk data backup method used, its backup and recovery are both There are some limitations, that is, either the entire hard disk or a partition is backed up. When restoring, the entire hard disk or a partition is restored in the same way as when backing up.
O:\75\75029.DOC\WCK 本紙張尺度適财目國家標準(CNS) A4規格(210X297公釐) 569131O: \ 75 \ 75029.DOC \ WCK This paper is a national standard (CNS) A4 size (210X297 mm) 569131
而如果用戶有多種需求,比如有時候需要恢復整個硬碟, 有時候僅需要恢復其中的一個分區,而按照整個硬碟做的 備份不能實現僅恢復一個分區,按照分區進行的備份不能 實現恢復整個硬碟。要想實現既能恢復整個分區,又能恢 復正俩硬碟’則就要進行兩次備份,一次備份一個分區, 另一次備份整個硬碟,造成了備份的冗餘,既浪費了人力 和時間,也浪費了硬碟的空間。 發明内容 本發明的目的在於提供一種計算機硬碟數據備份與恢復 方法’對硬碟中的數據進行安全可靠的備份與恢復,計算 機用戶利用本發明可以非常方便地備份硬碟上的數據,使 得因各種原因而導致破壞的硬碟數據能夠得以迅速地恢 復,以提高數據的安全性。 本發明的技術方案如下: 根據本發明的一種硬碟數據備份方法,用於對硬碟中的 用戶數據進行備份,包括以下步驟: (1) 在該硬碟上的劃分出至少一段硬碟空間作為數據備 份區; (2) 將硬碟上的分區狀態和至少一個分區的需備份數據 備份到該數據備份區; (3 )對該數據備份區加鎖,以禁止其它應用軟體或操作 -5-And if the user has multiple needs, for example, sometimes the entire hard disk needs to be restored, sometimes only one of the partitions needs to be restored, and the backup based on the entire hard disk cannot be restored to only one partition, and the backup based on the partition cannot restore the entire Hard drive. If you want to recover both the entire partition and the two hard disks, you need to perform two backups, one partition at a time, and the entire hard disk again, resulting in redundancy of the backup, which wastes manpower and time. It also wastes hard disk space. SUMMARY OF THE INVENTION The object of the present invention is to provide a computer hard disk data backup and recovery method 'to perform safe and reliable backup and recovery of data in a hard disk. Computer users can use the present invention to back up data on a hard disk very conveniently, so that Damaged hard disk data for various reasons can be quickly recovered to improve data security. The technical solution of the present invention is as follows: A hard disk data backup method according to the present invention, which is used for backing up user data in the hard disk, includes the following steps: (1) Allocating at least one hard disk space on the hard disk As a data backup area; (2) Back up the partition status on the hard disk and at least one partition to be backed up to the data backup area; (3) Lock the data backup area to prevent other application software or operations-5 -
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) A4規格(210X297公釐) 569131 A7 B7 五 發明説明( 系統對數據備份區的訪問。 在本發明的數據備份方法中,所述的數據備份區可以是 在硬碟上的邏輯地址高端之區域空間。但本發明並非限於 此,一般來說,本發明的數據備份區可設置在硬碟中的任 何一個區域中。但由於IDE硬碟之標準(例如ata5及 其以後的IDE硬碟之規範)所支持的硬碟區域保護功能 (Host Protected Area Feature)只能保護其高端區 域,因此,本發明優選的是將數據備份區設置在其中的高 端區域。該數據備份區可以是硬碟中的一段或多段空間。 在本發明的數據備份方法中,所述的對數據備份區的加 鎖和數據備份區的設置可以通過設置硬碟的最大地址來實 見並且了以疋自動元成的,該取大地址小於該硬碟的實 際最大空間地址。該硬嗖的最大地址被設置成功後,硬碟 中大於所設置之最大地址、小於實際最大空間地址之間的 扇區將不也被誇問。在加鎖狀態下任何軟體都不可能訪問 或修改在加鎖區中的内容,將該區域保護加載和解除需要 特殊的命令,從而確保備份數據的安全可靠。也可以利用 其它的加鎖手段實現對數據備份區的禁止訪問。 設置硬碟的最大地址,可利用硬碟本身所具有的硬碟 區域保護功能所支持的SET MAX命令,將硬碟中大於 该最大地址之鬲端區域劃分出來作為數據備份區;硬碟中 小於該取大地址之區域作為用戶可用的數據區。 -6 -O: \ 75 \ 75029.DOC \ WCK This paper size applies the Chinese National Standard (CNS) A4 specification (210X297 mm) 569131 A7 B7 Five invention instructions (system access to the data backup area. In the data backup method of the present invention The data backup area may be a high-end area of a logical address on a hard disk. However, the present invention is not limited to this. In general, the data backup area of the present invention may be set in any one region of the hard disk. However, since the hard disk area protection function (Host Protected Area Feature) supported by the IDE hard disk standard (such as the ata5 and later IDE hard disk specifications) can only protect its high-end area, it is preferred in the present invention to save data The high-end area is set in the backup area. The data backup area may be one or more spaces in the hard disk. In the data backup method of the present invention, the locking of the data backup area and the setting of the data backup area may be The actual address is set by setting the maximum address of the hard disk and it is automatically set to 疋. The larger address is smaller than the actual maximum space address of the hard disk. The maximum address of the hard disk is After the installation is successful, the sectors in the hard disk that are larger than the set maximum address and smaller than the actual maximum space address will not be exaggerated. Under the locked state, no software can access or modify the locked area. Content, loading and unloading the area protection requires special commands to ensure the safety and reliability of the backup data. Other locks can also be used to prevent access to the data backup area. Set the maximum address of the hard disk and use the hard disk The SET MAX command supported by its own hard disk area protection function divides the end area of the hard disk larger than the maximum address as a data backup area; the area of the hard disk smaller than the larger address is used as data available to the user District -6-
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) A4規格(210X 297公釐) 569131 A7 ______B7_____ 五、發明説明(4 ) 在本發明的數據備份方法中,該數據備份區的大小可以 如硬碟上的數據資料實際佔用的空間大小而確定。該數據 備份區可以大於數據實際佔用空間。實際上,本發明只備 份實際佔用空間的數據,不會備份閒置空間。因此可以計 算出至少所需的硬碟備份空間的大小,在硬碟上劃分出相 應所需大小的數據備份區。 在進行數據備份時,硬碟數據可連同控制信息一起被寫 入數據備份區,該控制信息可包括備份區域的大小、備份 區域的起始地址、備份的原分區的大小、原分區的數量、 分區的類型、硬碟分區表的大小、備份區是否已成功加鎖 的標記之信息。這些控制信息是在進行硬碟數據恢復功能 和加鎖功能時的依據。 在本發明的數據備份方法中,對數據備份區的加鎖方式 可包括以下兩種: (1) 永久性加鎖:加鎖後將不能訪問高端加鎖的數據備 份區,即使是在硬碟斷電後再啟動時仍然看不到加 鎖的數據備份區; (2) 臨時性加鎖:加鎖後將不能訪問高端加鎖的數據備 份區,但在硬碟斷電後再啟動時的加鎖狀態則為該 硬碟最近一次設置的永久性加鎖之狀態值。 上述的兩種加鎖方式可對應於SET MAX命令的兩種 設置方式,即永久性設置方式和臨時性設置方式。 O:\75\75029.DOC\WCK _ "7 _ ^紙張尺度適用中國國家標準(CNS) A4規X 297@---—--— 在本發明的數據備俗士4Α 區 象1甫h万法中,數據備份時可在數據備份 品存入個表不加鎖狀態的標記,該標記可被設置為待 加鎖標記和成功加鎖標記,分別表示已實現的臨時性加鎖 和永久性加鎖。 田更碟被啟動時’如果所述的標記是待加鎖標記,可對 更碟進仃永久性加鎖,加鎖成功後可將該標記設置為成功 加鎖標記。 在本發明的數據備份方法中,所述的將數據備份到數據 備份區之步騾可包括: (1) 讀出硬碟的主引導記錄; (2) 如主引導記錄中的硬碟分區信息表找到各個分區的 信息; (3) 如每個分區的FAT表的情況計算出每個分區中的 數據占用量,計算出備份分區所需的容量,在硬碟 的高端空閒空間劃分出備份數據區; (4) 將各個分區中的FAT表和引導記錄扇區保存到數 據備份區; (5 )對每一個分區,如ρ a T表的佔用情況,將分區數 據區中已使用的叢集保存到數據備份區。 如本發明的一種硬碟數據恢復方法,用於將備份在硬碟 中並被加鎖的數據從數據備份區恢復到可基於操作系統訪 問的分區中,包括·· -8 -O: \ 75 \ 75029.DOC \ WCK This paper size applies the Chinese National Standard (CNS) A4 specification (210X 297 mm) 569131 A7 ______B7_____ V. Description of the invention (4) In the data backup method of the present invention, the data is backed up The size of the area can be determined based on the actual space occupied by the data on the hard disk. The data backup area can be larger than the actual space occupied by the data. In fact, the present invention only backs up data that actually takes up space, and does not back up idle space. Therefore, at least the required hard disk backup space can be calculated, and the data backup area of the corresponding required size can be divided on the hard disk. When performing data backup, hard disk data can be written into the data backup area together with control information. The control information can include the size of the backup area, the starting address of the backup area, the size of the original partition to be backed up, the number of original partitions, Information about the type of partition, the size of the hard disk partition table, and whether the backup area was successfully locked. This control information is the basis for the hard disk data recovery function and the lock function. In the data backup method of the present invention, the method of locking the data backup area may include the following two methods: (1) Permanent lock: After the lock, the high-end locked data backup area cannot be accessed, even on a hard disk. The locked data backup area is still not visible when restarted after power failure; (2) Temporary lock: After locking, the high-end locked data backup area cannot be accessed, but when the hard disk is powered off and then restarted, The lock status is the last permanent lock status value set for the hard disk. The two lock modes mentioned above can correspond to the two setting modes of the SET MAX command, namely, the permanent setting mode and the temporary setting mode. O: \ 75 \ 75029.DOC \ WCK _ " 7 _ ^ Paper size applies Chinese National Standards (CNS) A4 regulations X 297 @ ------- In the data preparation of the present invention, the layman 4A area like 1 In the H Wan method, when the data is backed up, a mark can be stored in the data backup product for the unlocked state. This mark can be set as a to-be-locked mark and a successful lock mark, which respectively indicate that the temporary lock has been implemented and Permanently locked. When the Tianchang dish is started ’, if the mark is a mark to be locked, the lock can be permanently locked. After the lock is successfully set, the mark can be set as a successful lock mark. In the data backup method of the present invention, the step of backing up data to the data backup area may include: (1) reading a master boot record of a hard disk; (2) hard disk partition information in the master boot record Table to find information about each partition; (3) Calculate the data occupation in each partition, such as the FAT table of each partition, calculate the required capacity of the backup partition, and divide the backup data in the high-end free space of the hard disk. (4) Save the FAT table and boot record sectors in each partition to the data backup area; (5) For each partition, such as the occupation of the ρ a T table, save the used clusters in the partition data area Go to the data backup area. A hard disk data recovery method according to the present invention is used for restoring locked data on a hard disk from a data backup area to a partition accessible by an operating system, including ... -8-
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) A4規格(210X297公釐) 569131O: \ 75 \ 75029.DOC \ WCK This paper size applies to China National Standard (CNS) A4 (210X297 mm) 569131
(1) 將該數據備份區解鎖; (2) 如數據備份區中所儲存的控制信息’將數據備份區 中的數據恢復到對應的硬碟分區中,該步驟包括以 下可由用戶選擇執行的步驟: (a) 恢復硬碟單個分區步驟:.對數據備份區中所備 份的硬碟内容中的某一個分區之數據進行恢 復; (b) 恢復整個硬碟内容步驟:將硬碟的分區狀態恢 復到備份時的狀態,並將數據備份區的數據資 料恢復到對應的每一個硬碟分區中,也即將每 一個硬碟分區中的數據全部恢復到備份時的狀 態。 在本發明的數據恢復方法中,所述的對數據備份區的加 鎖是通過設置該硬碟的最大地址來實現,該最大地址小於 該硬碟的實際最大空間地址;所述的解鎖步驟可以是將該 硬碟的實際最大空間地址設置為最大地址,以使數據備份 區可被訪問。 在本發明的數據恢復方法中,恢復硬碟單個分區步驟可 包括: 將數據備份區的數據從根目錄開始,依次按文件方式綠 出來,將每個文件的備份按照當前分區的叢集的大小重新 分成若干個叢集,將每個文件重新組成叢集鏈存放到當前 O:\75\75029.DOC\WCK · 9 ·(1) Unlock the data backup area; (2) If the control information stored in the data backup area 'restores the data in the data backup area to the corresponding hard disk partition, this step includes the following steps that can be selected by the user to execute : (A) Steps of recovering a single partition of a hard disk: Restore the data of one partition in the content of the hard disk backed up in the data backup area; (b) Steps of recovering the entire hard disk content: Restore the partition status of the hard disk To the state at the time of backup, and restore the data in the data backup area to each corresponding hard disk partition, that is, to restore all the data in each hard disk partition to the state at the time of backup. In the data recovery method of the present invention, the locking of the data backup area is achieved by setting a maximum address of the hard disk, the maximum address being smaller than the actual maximum space address of the hard disk; the unlocking step may be The actual maximum space address of the hard disk is set to the maximum address so that the data backup area can be accessed. In the data recovery method of the present invention, the step of restoring a single partition of the hard disk may include: starting the data in the data backup area from the root directory, sequentially greening out according to the file mode, and re-creating the backup of each file according to the size of the cluster of the current partition Divide into several clusters, and reorganize each file into a cluster chain and store it in the current O: \ 75 \ 75029.DOC \ WCK · 9 ·
569131 A7569131 A7
分區中去,同時修改目錄中丈杜 ^ ^ , 邱〒又件仏息,使之在恢復後的分 區中能夠指向正確的首叢焦·慰 〜、、,百裹集’對於子目錄除了把目錄本身 重新組成叢集鏈存放到分區中去 u τ舌以外,還把其目錄中的各 個又件及子目錄也重新組成叢集鏈存人分區中去。這種方 式是基於文件佔用方式對單個分區進行恢復的方法。 在本發明的數據恢復方法中’恢復硬碟單個分區步驟可 包括: 當要恢復的分區和備份時的分區的結構和每叢集扇區數 都相同時,按照備份時的FAT表將分區中用到的叢集恢 復到分區中去’同時將備份FAT表中叢集的佔用情況恢 復到刀區的F A T表中’把分區F a τ表中其它沒有用到的 叢集信息填人空叢集標諸。這種方式是基# fat (文件 分配表)佔用方式對單個分區進行恢復的方法。 在根據本發明之數據恢復方法的一個實施例中,先將硬 碟的備份數據區中保存的硬碟的分區狀態讀出,將當前硬 參碟的分區狀態設為備份時的狀態,然後對每一個分區,如 備份時的FAT表的佔用情況,將每一個分區在備份區的 内容恢復到分區的相應位置,從而實現對整個硬碟之數據 的恢復。 在根據本發明之數據恢復方法的一個實施例中,控制實 現所述的硬碟數據備份方法和數據恢復方法之各步驟的計 算機程序是加入在計算機内的系統BI〇s (基本輸入輸出 -10-Go to the partition, and modify the contents of the directory ^ ^ ^, Qiu Qi also took a breath, so that in the restored partition, it can point to the correct first cluster focus. Consolation, ~ ,, 100 wrapped set 'For subdirectories in addition to The directory itself is reorganized into a cluster chain and stored in the partitions, and each component and subdirectory in the directory is also reorganized into a cluster chain and stored in the partition. This method is a method of recovering a single partition based on the file occupation method. In the data recovery method of the present invention, the step of 'recovering a single partition of a hard disk may include: When the structure of the partition to be restored and the partition at the time of backup and the number of sectors in each cluster are the same, the partition is used according to the FAT table at the time of backup. The recovered clusters are restored to the partitions. 'At the same time, the occupancy of the clusters in the backup FAT table is restored to the FAT table in the blade area.' Fill in the empty clusters with other unused cluster information in the partition Faa table. This method is based on the # fat (file allocation table) occupation method to recover a single partition. In one embodiment of the data recovery method according to the present invention, the partition status of the hard disk stored in the backup data area of the hard disk is read out first, the current partition status of the hard parameter disk is set to the status at the time of backup, and then Each partition, such as the occupancy of the FAT table at the time of backup, restores the content of each partition in the backup area to the corresponding location of the partition, thereby achieving the recovery of the entire hard disk data. In one embodiment of the data recovery method according to the present invention, the computer program that controls each step of the hard disk data backup method and data recovery method is a system BI0s (basic input output -10) added to the computer. -
O:\75\75029.DOC\WCK 本紙張尺度適用巾ϋ @家鮮(CNS) A4規格(㈣χ撕公董) 569131 A7 〜-------------B7 五、發明説明(8 ) 〜---- 系統)程序内,該程序在計算機啟動時執行。 ,本發明能夠對㈣中的數據進行安全可靠的備份與恢 復,計算機用戶利用本發明可以非常方便地備份硬碟上的 數據,使得因各種原因(嚴重的物理、機械、儲存介質損 袠原因除外)而導致破壞或丟失的硬碟數據能夠得以迅速 的恢復。本發明可利用ATA5硬碟規範對高端區域的加 鎖控制功能,將硬碟的數據備份到硬碟空間高端的一個受 保護的區域,該區域既不依賴於硬碟分區,也不依賴於操 作系統,因此不能被應用軟體或操作系統訪問,在整個硬 碟受到計算機病毒攻擊時也能夠不受侵襲,使硬碟的備份 數據不受侵害,保證了備份數據的安全性。 本發明利用硬碟加鎖功能及加鎖標記,可以確保在啟動 的情況下硬碟的高端地址數據備份區不會被訪問和破壞, 同時解決了單次加鎖可能失效的問題和大批量生產時母盤 複製的問題。做完母盤後,硬碟進行了臨時加鎖,使數據 備份區的數據處於受保護狀態,確保了備份區的安全;而 硬碟沒有永久加鎖,所以可以取下進行硬碟的正常拷貝, 批量複製硬碟。待再次啟動時,會將硬碟永久加鎖,此時 數據區處於受保護狀態,即使取下硬碟拿到另一個系統上 備份區仍是不能訪問的。因此,本發明之對硬碟數據備份 區的加鎖方法既保證了數據的安全,又充分考慮了系統廠 商大批量生產複製帶有備份數據内容的硬碟的需求,從而 -11-O: \ 75 \ 75029.DOC \ WCK Applicable paper size @ 家 鲜 (CNS) A4 size (㈣χ㈣ 公 董) 569131 A7 ~ ------------- B7 V. Invention Note (8) ~ ---- System) This program is executed when the computer starts. The invention can safely and reliably back up and restore the data in the storage. Computer users can use the invention to back up the data on the hard disk very conveniently, so that for various reasons (except for severe physical, mechanical, and storage media damage) ) Damaged or lost hard drive data can be quickly recovered. The invention can use the ATA5 hard disk specification to lock the high-end area to back up the data of the hard disk to a protected area at the high end of the hard disk space. This area does not depend on the hard disk partition or operation. The system can't be accessed by application software or operating system. The entire hard disk can also be protected from attack when a computer virus attacks, so that the backup data of the hard disk is not infringed and the security of the backup data is guaranteed. The invention uses the hard disk lock function and the lock mark to ensure that the high-end address data backup area of the hard disk will not be accessed and destroyed under the condition of startup, and at the same time, it solves the problem that a single lock may fail and mass production The problem of master disk replication. After the master disk is finished, the hard disk is temporarily locked to keep the data in the data backup area in a protected state to ensure the safety of the backup area. The hard disk is not permanently locked, so you can remove it for a normal copy of the hard disk. , Copy hard disks in batches. When it starts again, the hard disk will be permanently locked. At this time, the data area is protected. Even if the hard disk is removed and taken to another system, the backup area is still inaccessible. Therefore, the method for locking the hard disk data backup area of the present invention not only ensures data security, but also fully considers the need for system manufacturers to mass-produce hard disks with backup data content, thus -11-
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) A4规格(210X297公釐) 569131 A7 ____B7 I、發明説明(9~) 解決了大批量生產和數據安全之間的矛盾。 實現本發明之計算機程序可集成在計算機系統B T 〇s 中,穩定、可靠,恢復和備份的算法本身非常令全。採用 在硬碟高端儲存加鎖的方式,確保了備份數據的安全。 本發明既能一次備份一個硬碟分區之數據,也可以一次 備份整個硬碟之數據,備份後用戶可以採用靈活的方式來 完成各種恢復功能,如在備份了整個硬碟後,用户可以直 接使用備伤的數據只恢復其中的一個分區,而不需為了實 現單個为區的恢復而再去備份這個分區,節省了硬碟空 間,又實現了多種功能。 應用本發明的方法對硬碟數據進行備份,並對硬碟數據 的備份區域進行加鎖,其優點是明顯的及多方面的。例 如’用戶在應用中可能出現以下情況: (1)在某種條件下,如遭到計算機病毒襲機或不小心誤 刪除了關鍵文件,整個硬碟數據丟失,可能通過本 發明的恢復方法將硬碟所有的分區和數據恢復到備 份時的狀態。 (2 )在某種條件下,如遇病毒或不小心誤刪除了關鍵文 件甚至誤操作對系統分區進行了完全格式化,文件 部分或全部丟失,系統不能正常啟動,採用本發明 的方法將備份數據的系統部分完全恢復,系統可以 正常啟動’而硬碟數據區的内容不受影響。 O:\75\75029.DOC\WCK 〜-12 本紙張尺度適用中國國家標準(CNS) A4規格(21〇 χ 297公釐) 569131O: \ 75 \ 75029.DOC \ WCK This paper size is applicable to Chinese National Standard (CNS) A4 specification (210X297 mm) 569131 A7 ____B7 I. Invention description (9 ~) Solve the contradiction between mass production and data security . The computer program for implementing the present invention can be integrated in the computer system B T os. The algorithm is stable and reliable, and the algorithms for recovery and backup are very comprehensive. The high-end storage lock method is used to ensure the safety of backup data. The present invention can back up data of one hard disk partition at a time, or back up data of the entire hard disk at a time. After the backup, the user can use various flexible methods to complete various recovery functions. The injured data is restored to only one of the partitions, and there is no need to back up this partition in order to achieve a single recovery of the partition, which saves hard disk space and implements multiple functions. Applying the method of the present invention to back up the hard disk data and lock the backup area of the hard disk data has the advantages of obvious and many aspects. For example, 'The user may have the following situations in the application: (1) Under certain conditions, such as when a computer virus attack or accidentally deletes a critical file, the entire hard disk data is lost, which may be lost through the recovery method of the present invention. All partitions and data of the hard disk are restored to the state at the time of backup. (2) Under certain conditions, if a key file is deleted by accident or accidentally, the system partition is completely formatted, some or all of the files are lost, and the system cannot start normally. The method of the present invention is used to back up data. Part of the system is fully restored, the system can boot normally 'and the contents of the hard disk data area are not affected. O: \ 75 \ 75029.DOC \ WCK ~ -12 This paper size applies to China National Standard (CNS) A4 (21〇 χ 297 mm) 569131
(3 )用戶重新劃分了硬碟的分區,將硬碟系統分區和數 據分區的大小都發生了變化,這時可以通過本發明 的恢復方法將操作系統按備份的方式拷貝到新分區 上省卻了 士裝操作系統的時間,也節省了因增加 恢復光盤的成本。 (4) 用戶重新劃分了硬碟的分區,將硬碟系統分區和數 據分區的大小都發生了變化,用戶在新的系統區安 裝了新的操作系統,並且在其它分區裝了大量的數 據,當用戶想把原來的操作系統恢復時,可以使用 本發明的單個分區恢復功能恢復系統分區,不影響 其他分區的内容。 (5) 將硬碟拿到另外一個計算機系統上重新將硬碟分區 和格式化,這時由於備份區的内容是加鎖的,所以 在該系統上看不到該加鎖的隱藏區,其中的數據還 保存完好,用戶將該硬碟再拿回本來的機器上時, 可以按一個熱鍵啟動本發明,即可將該盤上原來的 内容恢復回來。 (6) 電腦生產廠商採用本發明的方法在生產時就將硬碟 系統内谷備伤,使用備份後的硬碟進行多個同類硬 碟的複製,然後採用本發明的方法進行加鎖,電腦 賣到用戶手中時,可能由於若干原因系統被破壞不 能正常啟動’則用戶可以方便地使用恢復功能將硬 O:\75\75029.DOC\WCK -13-(3) The user re-divided the partition of the hard disk, and changed the size of the hard disk system partition and the data partition. At this time, the operating system can be copied to the new partition as a backup through the recovery method of the present invention. Installing the operating system also saves costs due to increased recovery discs. (4) The user re-divided the hard disk partition, the size of the hard disk system partition and the data partition changed. The user installed a new operating system in the new system area and loaded a large amount of data in other partitions. When the user wants to recover the original operating system, the single partition recovery function of the present invention can be used to recover the system partition without affecting the contents of other partitions. (5) Take the hard disk to another computer system to re-partition and format the hard disk. At this time, because the content of the backup area is locked, the locked hidden area cannot be seen on the system. The data is still intact. When the user returns the hard disk to the original machine, he can press a hot key to start the invention, and the original content on the disk can be restored. (6) The computer manufacturer uses the method of the present invention to prepare the valley in the hard disk system during production, uses the backed up hard disk to copy multiple similar hard disks, and then uses the method of the present invention to lock the computer. When sold to the user, the system may be damaged and cannot be started normally due to several reasons. Then the user can easily use the recovery function to hard O: \ 75 \ 75029.DOC \ WCK -13-
569131 A7 B7 五、發明説明(”569131 A7 B7 V. Description of the invention ("
碟恢復到出廠狀態,也可以採用只恢復系統分區的 方法將操作系統恢復到出廠狀態而不影響其它分區 的大小和内容。 以下結合附圖和實施例進一步說明本發明。 附圖簡述 圖1是實現本發明之一實施例的B I 0 S系統程序的運行 流桂圖; 圖2如本發明之實施例的硬碟數據備份區的加鎖流程 ST · 圓, 圖3 A和圖3 B是如本發明之實施例的硬碟數據備份的 流程圖; 圖4 A和圖4 B是如本發明之實施例的硬碟單個分區的 數據恢復之流程圖; 圖5是如本發明之實施例的整個硬碟之數據恢復的流程 圑, 圖6是如本發明之實施例的硬碟一個分區的數據備份之 流程圖; 圖7是在一個實施例中恢復整個硬碟數據時、恢復一個 分區的流程圖; 圖8是如本發明對硬碟單個分區數據進行恢復之一實施 例的流程圖;The disk is restored to the factory state. You can also restore the operating system to the factory state by only restoring the system partition without affecting the size and content of other partitions. The invention is further described below with reference to the drawings and embodiments. Brief Description of the Drawings Fig. 1 is a flowchart showing the operation flow of a BI 0 S system program for realizing one embodiment of the present invention; Fig. 2 is a locking process ST circle of a hard disk data backup area according to an embodiment of the present invention; A and FIG. 3B are flowcharts of hard disk data backup according to an embodiment of the present invention; FIGS. 4A and 4B are flowcharts of data recovery of a single partition of a hard disk according to an embodiment of the present invention; FIG. 5 is As in the embodiment of the present invention, the entire data recovery process of a hard disk is shown. FIG. 6 is a flowchart of data backup for one partition of the hard disk according to the embodiment of the present invention. FIG. 7 is a flowchart of restoring the entire hard disk in one embodiment. FIG. 8 is a flowchart of recovering data of a single partition of a hard disk according to the present invention;
O:\75\75029.DOC\WCK -14 - 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公着)O: \ 75 \ 75029.DOC \ WCK -14-This paper size applies to China National Standard (CNS) A4 (210 X 297)
裝 訂Binding
線 569131 A7 ________B7 五、發明説明(12 ) " -- 圖9A和目9B是如本發明對硬碟單個分區數據進行恢 復之另一實施例的流程圖。 如圖1所7JT,在本發明的一個實施例中,控制計算機實 現本發明之數據備份及恢復的程序置於BI〇s之flash ROM心片中,在運行BI〇s之過程中實現ide硬碟數據 的備份和恢復。用戶在計算機的啟動過程中可以按下備份 熱鍵進入備份功能菜單,或者按下恢復熱鍵進入恢復功能 菜單。在備伤功能菜單中可以實現對整個硬碟的分區信息 和分區中數據的備份,在恢復功能菜單中可以實現將備份 的數據#息按照用戶的意願恢復到硬碟上去。 在 BIOS 的 POST (P〇wer 〇n SelfTest,上電自 檢)過程中,如圖1所示,如果用戶按下了系統恢復熱鍵 或系統備份熱键則B I 0 S會設置相應的標誌,在完成系統 各硬件的檢測和實始化之後,在啟動操作系統之前, B I 0 S會查看設置的標誌,如果用戶沒有按任何熱鍵,則 會進行硬碟備份區加鎖的一系列操作;如果用戶在此前按 下了硬碟備份熱鍵,則進行硬碟備份的一系列操作;而如 果用戶在此前按下了硬碟恢復熱鍵,則進行硬碟恢復的一 系列操作’完成硬碟恢復的操作後,再進行硬碟備份區加 鎖的一系列操作。硬碟加鎖後開始引導操作系統,Β Ϊ 〇 S 的P O S T過程結束。 本發明特別適用於當前的符合A T A 5及其後規範的 -15-Line 569131 A7 ________B7 V. Description of the Invention (12) "-Figures 9A and 9B are flowcharts of another embodiment for restoring data on a single partition of a hard disk according to the present invention. As shown in FIG. 7JT, in one embodiment of the present invention, the program for controlling the computer to implement the data backup and recovery of the present invention is placed in the flash ROM chip of BI0s, and the ide hard disk is implemented during the process of running BI0s. Backup and restore of disc data. During the startup process of the computer, the user can press the backup hot key to enter the backup function menu, or press the recovery hot key to enter the recovery function menu. The backup function menu can be used to backup the entire hard disk partition information and data in the partition. In the recovery function menu, the backup data can be restored to the hard disk according to the user's wishes. During the BIOS POST (P〇wer 〇n SelfTest), as shown in Figure 1, if the user presses the system recovery hot key or the system backup hot key, BI 0 S will set the corresponding flag, After completing the detection and implementation of each hardware of the system, before starting the operating system, BI 0 S will check the set flag. If the user does not press any hot key, a series of operations will be performed to lock the hard disk backup area; If the user has previously pressed the hard disk backup hot key, a series of operations for hard disk backup will be performed; and if the user has previously pressed the hard disk recovery hot key, a series of operations for hard disk recovery will be performed 'Finish the hard disk After the recovery operation, a series of operations to lock the hard disk backup area is performed. After the hard disk is locked, the operating system starts to boot, and the PO OST process of B 〇 〇s ends. The present invention is particularly applicable to current A T A 5 and later specifications -15-
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 569131 A7 ___________ B7 五、發明説明(13 ) IDE硬碟,使用其特有的SET MAX命令將備份數據區 加鎖’在加鎖狀態下任何軟體都不可能訪問或修改在加鎖 區中的内容’從而確保了備份數據的安全可靠。本發明的 對硬碟備份數據區的加鎖方法既保證了數據的安全,又完 全滿足了系統廠商大批量生產複製帶有備份數據内容的硬 碟的需求。 圖2是如本發明之實施例對數據備份區進行加鎖的方 法。在該實施例中,對硬碟高端區域的加鎖方法是如 ΑΤΑ 5的規範,採用SET ΜΑχ命令來實現的。該命令 作用是設置硬碟的最大地址,設置成功後,硬碟中大於該 设置地址的扇區將不能被訪問,該命令就是通過這種方式 實現對硬碟高端區域的加鎖,該命令對硬碟高端區域的加 鎖的万式有兩種:永久性加鎖和臨時性加鎖。兩種加鎖方 式設置後對硬碟訪問控制的加鎖效果是一樣的,不一樣的 只是加鎖的持續時間,臨時性加鎖的方式只是在硬碟不斷 電的情況下有效,可以多次設置;而永久性加鎖的方式在 硬碟斷電後仍有效。但是永久性加鎖方式的設置在硬碟的 一次上電周期内只能進行一次,第二次再試圖進行永久性 加鎖設置時無效。系統廠商是使用硬碟複製機來進行大批 量生產的,而硬碟複製機使用軟體來訪問硬碟空間,在生 產時如果设置了加鎖,則高端的數據備份區不能進行有效O: \ 75 \ 75029.DOC \ WCK This paper size applies to Chinese National Standard (CNS) A4 specification (210 X 297 mm) 569131 A7 ___________ B7 V. Description of the invention (13) IDE hard disk, using its unique SET MAX The command locks the backup data area 'No software can access or modify the contents in the locked area' in the locked state, thereby ensuring the safety and reliability of the backup data. The method for locking the backup data area of the hard disk of the present invention not only ensures data security, but also fully meets the needs of system manufacturers for mass production of hard disks with backup data content. Fig. 2 is a method for locking a data backup area according to an embodiment of the present invention. In this embodiment, the locking method for the high-end area of the hard disk is implemented as the ATAA 5 specification by using the SET Μχ command. This command is used to set the maximum address of the hard disk. After the setting is successful, sectors larger than the set address in the hard disk will not be accessible. This command is used to lock the high-end area of the hard disk in this way. There are two types of locks in the high-end area of hard disks: permanent locks and temporary locks. After the two locking methods are set, the locking effect on the hard disk access control is the same. The difference is only the duration of the lock. The temporary locking method is only effective when the hard disk is powered on. Setting; the permanent lock mode is still effective after the hard disk is powered off. However, the setting of the permanent lock mode can only be performed once during one power-on cycle of the hard disk, and it is invalid when the second attempt is made to set the permanent lock. System manufacturers use hard disk duplicators for mass production, and hard disk duplicators use software to access hard disk space. If locks are set during production, high-end data backup areas cannot be effectively used.
0 :\7 5\75029. DOCVWCK -16- 569131 A7 B70: \ 7 5 \ 75029. DOCVWCK -16- 569131 A7 B7
因而本實施例採用了如下的方法: 在對硬碟進行備份時,為了利於生產,只對硬碟進行臨 時加鎖。在備份時在備份的區域中存下了 一個“待加鎖” 標記,該標記的含義是本硬碟已進行了數據備份,但是硬 碟的備份數據區還沒有進行永久性加鎖,而臨時性加鎖既 保證了在本次上電周期中數據的安全,也可以讓系統廠商 在備份完成後,關斷電源,取下硬碟,裝到硬碟複製機上 進行完整的硬碟複製(此時雖然硬碟經過臨時加鎖,但斷 電後無效,因此硬碟複製機軟體可以訪問備份數據區)。 在之後的計算機系統啟動時,系統B j 〇 S會檢查該標 記,若該標記為”待加鎖”,則將硬碟進行永久性加鎖,若 加鎖成功,則將該標記設置”成功加鎖狀態”,若永久性加 鎖不成功,則不更改該加鎖標記,而對硬碟設置臨時性加 鎖,待下次啟動時再進行永久性加鎖,直至成功將高,永 久加鎖。在永久性加鎖不成功時設置臨時性加鎖,保證了 數據在本次上電周期的安全。而加鎖標記的設置可以讓計 算機在每次啟動時都去進行加鎖,直至加鎖成功。 如圖2所示,對數據備份區設置加鎖時,不需要用戶干 預’對每一個硬碟都進行如下的操作: 使用臨時SET MAX命令將其最容量設硬碟的實際 谷量,然後謂出該硬碟中的控制信息,若控制信息中的標 忒表明m硬碟處在“待加鎖”狀態,則對該硬碟的備份數 -17-Therefore, this embodiment adopts the following method: When backing up the hard disk, in order to facilitate production, only the hard disk is temporarily locked. During the backup, a "lock to be locked" mark is stored in the backup area. The meaning of this mark is that the hard disk has been backed up, but the backup data area of the hard disk has not been permanently locked. Sexual locking not only guarantees the security of data during this power-up cycle, but also allows system manufacturers to turn off the power after the backup is complete, remove the hard disk, and install it on a hard disk duplicator for a complete hard disk copy ( At this time, although the hard disk is temporarily locked, it is invalid after power failure, so the hard disk duplicator software can access the backup data area). When the subsequent computer system is started, the system B j 〇 will check the mark, if the mark is "to be locked", the hard disk is permanently locked, if the lock is successful, the mark is set "successful" "Lock status", if the permanent lock is unsuccessful, do not change the lock flag, and set a temporary lock on the hard disk, and then perform a permanent lock at the next startup until the success will be high, permanent lock lock. Setting a temporary lock when the permanent lock is unsuccessful ensures the safety of the data during this power-up cycle. The setting of the lock flag allows the computer to lock each time it is started until the lock is successful. As shown in Figure 2, when setting a lock on the data backup area, no user intervention is required. 'Each hard disk is subjected to the following operations: Use the temporary SET MAX command to set its maximum capacity to the actual valley of the hard disk, and then call The control information in the hard disk is displayed. If the mark in the control information indicates that the m hard disk is in a state of "to be locked", the number of backups of the hard disk is -17-
O:\75\75029.DOC\WCK ^紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐)""""— 一 ·.--:— 569131O: \ 75 \ 75029.DOC \ WCK ^ The paper size applies to the Chinese National Standard (CNS) A4 specification (210 X 297 mm) " " " " — — · .--: — 569131
據區進行永久性加鎖,若加鎖成功,則設置“成功加鎖” 標誌,若不·成功,則使用臨時SET ΜΑχ命令將備份數 據區加鎖。 在本發明之數據備份方法之實施例中,如圖3Α和圖 3 Β所示,因為用戶的系統可能會安裝有多個硬碟,所以 在進行硬碟備份的操作時,首先讓用戶選擇要進行操作的 硬碟,選定硬碟後,因為該硬碟可能以前進行過備份,進 行過加鎖的動作,所以要訪問所有的硬碟數據就必須將其 解鎖,因而使用臨時SET MAX命令將硬碟的容量設為 硬碟的實際最大容量,將硬碟中的加鎖區域解鎖;然後, 讀出硬碟的第一個邏輯扇區即主引導記錄(MBr),如 主引導"I己錄中的硬碟分區信息表可以找到該硬碟的各個分 區的信息。首先如每個分區的FAT表的情況計算出每個 分區中的數據佔用扇區數,累加起來就得到硬碟各分區備 份所需的空間大小,可以在這個扇區數的基礎上加上 5 0 0 ’作為備份數據區所需空間的大小,這5 〇 〇個扇區是 為儲存控制信息和一些不屬於任何分區的有用扇區如 Μ B R等扇區預留的。在計算出數據備份區所需空間後, 再檢查一下硬碟中的高端有沒有足夠的空間劃分出這個數 據備份區,若沒有足夠的空間,則此硬碟不能進行數據備 份;若有足夠的S間’則如計算出數據備份區所需的容 量,在硬碟的高端空間空間劃分出數據備份區;然後如各 -18-The data area is permanently locked. If the lock is successful, the “successful lock” flag is set. If it is not successful, then the temporary SET Μχ command is used to lock the backup data area. In the embodiment of the data backup method of the present invention, as shown in FIG. 3A and FIG. 3B, because a user's system may have multiple hard disks installed, when performing a hard disk backup operation, first let the user choose For the hard disk to be operated, after selecting the hard disk, because the hard disk may have been backed up and locked before, all the hard disk data must be unlocked to access the data. Therefore, using the temporary SET MAX command will harden the hard disk. The capacity of the hard disk is set to the actual maximum capacity of the hard disk, and the locked area in the hard disk is unlocked; then, the first logical sector of the hard disk is read out as the master boot record (MBr), such as the master boot " I own The hard disk partition information table in the record can find the information of each partition of the hard disk. First, as the FAT table of each partition, calculate the number of sectors occupied by the data in each partition, and add up to get the space required for each partition of the hard disk. You can add 5 to this sector number. 0 0 'As the size of the space required for the backup data area, these 500 sectors are reserved for storing control information and some useful sectors that do not belong to any partition, such as MBR and other sectors. After calculating the space required for the data backup area, check whether there is enough space in the high end of the hard disk to divide the data backup area. If there is not enough space, the hard disk cannot perform data backup; if there is sufficient S ', such as calculating the required capacity of the data backup area, divide the data backup area in the high-end space of the hard disk;
裝 訂Binding
線line
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) Α4規格(210 X 297公釐) 569131 五 A7 ^______ B7 、明(16 ) ' ~ 個分區FAT中的信息,將各個分區中的數據信息讀出, 保存到數據備份區;最後將數據備份區加鎖,使備份的數 據處在受保護狀態。 圖6是備份硬碟中一個分區的詳細流程,這個過程將分 區中的有用數據讀出,備份到劃分出的數據備份區域,這 些有用數據包括:分區的引導記錄、分區的FAT表、以 及分區的數據區中保存了數據的叢集。對於數據區中的一 個叢集是否存了有用數據,是通過對FAT中的記錄確定 的,若FAT表中該叢集的信息0,則表明該叢集沒有被 佔用,不用保存;若該叢集的信息〇非零,則將該叢集讀 出’保存在備份數據區。 . 將所有的分區保存完畢後,將Μ B R和備份的控制信息 也存入數據備份區,此時備份完成,設置備份成功標誌, 並設置“待加鎖,,標誌。 最後使用臨時SET MAX命令將數據備份區加鎖,加 鎖的目的是為了保護硬碟備份數據區中的數據,而使用臨 時SET MAX命令的目的是本次備份成功後,系統廠商 可以用來大批量複製硬碟用於生產,而如果將該區域永久 加鎖,則系統廠商取下硬碟後,備份數據區仍處於加鎖狀 態,不能複製備份數據區的内容。而由於我們設置的“待 加鎖”標誌,則在使用該硬碟再次啟動時,B I 0 S會自動 識別該標誌並將硬碟設置為永久加鎖。 -19-O: \ 75 \ 75029.DOC \ WCK This paper size applies the Chinese National Standard (CNS) Α4 specification (210 X 297 mm) 569131 Five A7 ^ ______ B7, Ming (16) '~ The information in the partition FAT will be The data information in each partition is read out and saved to the data backup area. Finally, the data backup area is locked to make the backup data in a protected state. Figure 6 is a detailed process of backing up a partition in a hard disk. This process reads out the useful data in the partition and backs it up to the divided data backup area. These useful data include: the partition's boot record, the partition's FAT table, and the partition. A cluster of data is stored in the data area of. Whether or not useful data is stored in a cluster in the data area is determined by recording in the FAT. If the cluster information in the FAT table is 0, it indicates that the cluster is not occupied and does not need to be saved; if the cluster information is If it is non-zero, the cluster reads 'Save in the backup data area'. After all the partitions are saved, the MBR and the backup control information are also stored in the data backup area. At this time, the backup is completed, the backup success flag is set, and the "to be locked," flag is set. Finally, use the temporary SET MAX command. The data backup area is locked. The purpose of the lock is to protect the data in the hard disk backup data area. The purpose of using the temporary SET MAX command is that after the backup is successful, the system manufacturer can use it to copy the hard disks in large quantities. Production, and if the area is permanently locked, after the system manufacturer removes the hard disk, the backup data area is still locked, and the contents of the backup data area cannot be copied. Because of the "to be locked" flag we set, When using the hard disk to boot up again, BI 0 S will automatically recognize the logo and set the hard disk to be permanently locked. -19-
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 569131 A7 B7O: \ 75 \ 75029.DOC \ WCK This paper size applies to China National Standard (CNS) A4 (210 X 297 mm) 569131 A7 B7
本發明的備份數據之恢復方法可以有兩種方式來實現, 分別滿足用戶的不同需求,即恢復硬碟單個分區和恢復全 部硬碟内容’如圖4A和圖4B和圖5所示。 如果在BIOS的上電自檢過程中用戶按下了硬碟恢復熱 鍵,則會進行硬碟恢復的操作,首先會讓用戶選擇是哪種 恢復方式,如果選擇了恢復單個分區的恢復方式,則進行 恢復所選擇的單個分區,如圖4 A和圖4 B所示,不影響 硬碟的分區狀態和其它分區的内容;如果選擇了恢復整個 硬碟的恢復方式,則按備份時的狀態將硬碟的分區狀態和 各個分區的内容恢復,如圖5所示。 對於僅恢復硬碟單個分區的方式,是實現將備份區中備 份的硬碟内容中的某一個分區的恢復,而不更改硬碟的分 區狀態,也不影響硬碟中的其它分區的内容。即使用戶在 備份後改變了分區的大小,只要改變後分區的容量大於備 份的容量’就可以將該分區按備份的内容恢復。這種恢復 方法是通過將分區的内容轉化為文件的方式來實現的,在 分區的大小改變而分區的每叢集的大小不變的情況下,本 發明還提供了一種不依賴於文件的簡便的方法來實現單個 分區的恢復。 在進行恢復單個分區的動作時,如圖4 A和圖4 B,首 先讓用戶選擇要操作的硬碟,然後使用臨時S E T M A X 命令將該硬碟妁容量設為該硬碟的實際容量,讀出備份數 O:\75\75029.DOC\WCK - 20 .The method for restoring backup data of the present invention can be implemented in two ways, which respectively meet different needs of users, namely, recovering a single partition of a hard disk and restoring all hard disk contents, as shown in FIG. 4A and FIG. 4B and FIG. 5. If the user presses the hard disk recovery hot key during the BIOS power-on self-test, the hard disk recovery operation will be performed. The user will first be asked to choose the recovery method. If the recovery method for a single partition is selected, Then the selected single partition is restored, as shown in Figure 4 A and Figure 4 B. It does not affect the partition status of the hard disk and the contents of other partitions. If the recovery method for restoring the entire hard disk is selected, the status at the time of backup is selected. Restore the hard disk partition status and the contents of each partition, as shown in Figure 5. The method of restoring only a single partition of the hard disk is to restore one of the hard disk contents backed up in the backup area without changing the partition status of the hard disk and without affecting the contents of other partitions in the hard disk. Even if the user changes the size of the partition after the backup, as long as the capacity of the partition is greater than the capacity of the backup after the change, the partition can be restored according to the contents of the backup. This recovery method is implemented by converting the content of the partition into a file. When the size of the partition changes and the size of each cluster of the partition does not change, the present invention also provides a simple and independent method that does not depend on the file. Method to achieve single partition recovery. When performing the action of recovering a single partition, as shown in Figure 4 A and Figure 4 B, first let the user select the hard disk to be operated, and then use the temporary SETMAX command to set the capacity of the hard disk to the actual capacity of the hard disk. Number of backups O: \ 75 \ 75029.DOC \ WCK-20.
569131 A7 _______B7 五、發明説明(18) ' — 據區中的控制信息,若控制信息合法且控制信息表明本硬 碟中有備份信息’則進行下面的操作,否則不能進行恢 復。 讓用戶選擇要恢復的分區,因為用戶可能調整了分區的 大小,所以要讀出硬碟中該分區當前的大小,和備份分區 中儲存的數據量比較,看當前的分區能否容納下備份數據 的内容。若當前的分區足夠容納備份的分區的數據,則進 行恢復單個分區的動作,否則不能進行恢復這個分區的操 作。 此時可以通過兩種方法中的一種來實現對單個分區恢復 的操作,基於文件的方法比較複雜一些,而基於fat的 方式程序實現起來較為簡便,但是有一些限制,它除了要 求當前的分區能夠容納下備份的數據以外,還要求當前的 分區和備份時的分區結構和叢集的大小是相同的。我們可 以來判斷一下,若當前分區的結構及叢集的大小相同,則 進行基於FAT的方式;否則進行基於文件的操作。 這兩種方法的介紹如下·· (i)基於文件佔用方式的恢復方法 如圖9A和圖9B所示,將備份區的數據從根目錄 開始’依次按文件方式讀出來,將每個文件的備份按 照當前分區的叢集的大小重新分成若干個叢集,將每 個文件重新組成叢集鏈存放到當前分區中去,同時修 O:\75\75029.DOC\WCK 2! 本紙張尺度適用中_家標準(CNS) Μ規格(咖X 297公董) 569131569131 A7 _______B7 V. Description of the invention (18) '— According to the control information in the area, if the control information is legal and the control information indicates that there is backup information in this hard disk', perform the following operations, otherwise recovery cannot be performed. Let the user select the partition to be restored. Because the user may have adjusted the size of the partition, the current size of the partition on the hard disk must be read out. Compare with the amount of data stored in the backup partition to see if the current partition can hold the backup data. Content. If the current partition is sufficient to hold the data of the backup partition, restore the single partition. Otherwise, you cannot restore this partition. At this time, you can use one of two methods to achieve the recovery of a single partition. The file-based method is more complicated, and the fat-based method is simpler to implement, but there are some restrictions. In addition to requiring the current partition to be able to In addition to accommodating the data to be backed up, the current partition and the partition structure and cluster size at the time of backup are required to be the same. We can judge for a long time if the structure of the current partition and the size of the cluster are the same, then use the FAT-based method; otherwise, perform the file-based operation. The introduction of these two methods is as follows: (i) The recovery method based on the file occupation method is shown in Figure 9A and Figure 9B. The data in the backup area is started from the root directory. The backup is divided into several clusters according to the size of the cluster in the current partition, and each file is reassembled into a cluster chain and stored in the current partition. At the same time, O: \ 75 \ 75029.DOC \ WCK 2! Standard (CNS) M specifications (coffee X 297 public director) 569131
改目錄中文件信息,使之在恢復後的分區中能夠指向 正確的首叢集。對於子目綠除了把目錄本身重新組成 叢集鏈存放到分區中去以外,還把其目錄中的各個文 件及子目錄也重新組成叢集鏈存入分區中去。這樣, 在分區中就建了和備份時一樣的文件系統,這就完 成了從備份到分區的按文件方式的恢復。 (i i)基於F A T佔用方式的恢復方法 如圖8所示,這種方式的前提是要恢復的分區和備 份時分區的結構和每叢集扇區數都是相同的,分區的 大小可以不同。分區結構和叢集的大小相同,則可以 把數據區的數據直接恢復到備份時的狀態,而分區的 大小不同,F A T的大小也不同,只需將叢集的佔用情 況按備份時的情況恢復。所以這種備份方法按照備份 時的FAT表將分區中用到的叢集恢復到分區中去, 同將備份F A T表中叢集的佔用情況恢復到分區的 FAT表中,把分區FAT表中沒有用到的叢集填入空 叢集標誌、。 對於恢復全部硬碟内容的方式,可以實現將硬碟的 分區狀態和每個分區的數據資料恢復到備份時的狀 態,如圖5和圖7所示。 這種恢復方法首先將硬碟的備份數據區中保存的硬 碟的分區狀態讀出,將當前硬碟的分區狀態設備份Change the file information in the directory so that it can point to the correct first cluster in the recovered partition. For the subhead green, in addition to reorganizing the directory itself into a cluster chain and storing it in the partition, the files and subdirectories in its directory are also reorganized into a cluster chain and stored in the partition. In this way, the same file system is created in the partition as in the backup, which completes the file-by-file recovery from backup to partition. (i i) Recovery method based on FAT occupation method As shown in Figure 8, the premise of this method is that the partition to be restored and the partition structure and the number of sectors per cluster are the same when the backup is performed, and the partition sizes can be different. The partition structure and the size of the cluster are the same, you can directly restore the data in the data area to the state at the time of backup, and the size of the partition is different, and the size of FAT is also different. You only need to restore the cluster occupation according to the situation at the time of backup. Therefore, this backup method restores the clusters used in the partition to the partition according to the FAT table at the time of the backup, and restores the occupancy of the clusters in the backup FAT table to the partition FAT table. The partition FAT table is not used. The cluster is filled with the empty cluster flag. With regard to the method of restoring the contents of all hard disks, the partition status of the hard disk and the data of each partition can be restored to the state at the time of backup, as shown in Figure 5 and Figure 7. This recovery method first reads the partition status of the hard disk saved in the backup data area of the hard disk, and copies the current partition status of the hard disk to the device.
O:\75\75029.DOC\WCK -22- 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐)O: \ 75 \ 75029.DOC \ WCK -22- This paper size applies to China National Standard (CNS) A4 (210 X 297 mm)
裝 訂Binding
569131569131
時的狀態,然後對每一個分區,如備份時的F A τ表 的佔用情況,將每一個分區在備份區的内容恢復到分 區的相應位置。 首先讓用戶選擇要進行操作的硬碟,使用S Ε τ MAX命令將其容量設為硬碟的實際容量,以便能夠 訪問到硬碟的備份數據區。讀出在備份數據區中的控 制信息’若當前的硬碟中沒有備份數據,則不能進行 恢復的動作;若硬碟中有備份數據,則從備份數據區 中讀出備份的硬碟第一個分區即Μ B R,從中找到備 份時硬碟的分區狀態,將將該MB R恢復到當前硬碟 中〇 按照備份時的分區狀態,對每一個分區從備份數據 區讀出備份的該分區的基本信息,如分區的p B R、分 區的隱藏扇區等,將其恢復;然後讀出在備份數據區 中備份的該分區的文件分配表(F A T ),如F A τ中 的叢集的佔用情況,將該分區中備份的叢集讀出恢 復,並恢復該FAT,對所有備份的分區恢復完成後就 將整個硬碟恢復到了備份時的狀態。 -23-Time, then for each partition, such as the occupancy of the F A τ table during backup, restore the content of each partition in the backup area to the corresponding location in the partition. First let the user select the hard disk to be operated, and use the Ε τ MAX command to set its capacity to the actual capacity of the hard disk so that it can access the backup data area of the hard disk. Read out the control information in the backup data area 'If there is no backup data in the current hard disk, you cannot restore it. If there is backup data in the hard disk, read the backup hard disk from the backup data area first. This partition is the MBR. From it, the partition status of the hard disk at the time of backup will be found, and the MBR will be restored to the current hard disk. According to the partition status at the time of backup, read the backup of the partition from the backup data area for each partition. Basic information, such as p BR of the partition, hidden sectors of the partition, etc., restore it; then read out the file allocation table (FAT) of the partition backed up in the backup data area, such as the cluster occupation in FA τ, Read and restore the backup cluster in the partition, and restore the FAT. After restoring all the backup partitions, the entire hard disk is restored to the state at the time of backup. -twenty three-
O:\75\75029.DOC\WCK 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐)O: \ 75 \ 75029.DOC \ WCK This paper size applies to China National Standard (CNS) A4 (210 X 297 mm)
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW90128490A TW569131B (en) | 2001-11-16 | 2001-11-16 | Hard disk data backup and recovery method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW90128490A TW569131B (en) | 2001-11-16 | 2001-11-16 | Hard disk data backup and recovery method |
Publications (1)
Publication Number | Publication Date |
---|---|
TW569131B true TW569131B (en) | 2004-01-01 |
Family
ID=32590187
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW90128490A TW569131B (en) | 2001-11-16 | 2001-11-16 | Hard disk data backup and recovery method |
Country Status (1)
Country | Link |
---|---|
TW (1) | TW569131B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI409634B (en) * | 2008-11-28 | 2013-09-21 | Shrisinha Technology Corp | Data hiding protection method and its hardware |
CN103678517A (en) * | 2013-11-27 | 2014-03-26 | 华为技术有限公司 | Method for fixing logical errors of hard disk and controller |
TWI674545B (en) * | 2018-11-15 | 2019-10-11 | 華南商業銀行股份有限公司 | Data management method and system thereof |
-
2001
- 2001-11-16 TW TW90128490A patent/TW569131B/en not_active IP Right Cessation
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI409634B (en) * | 2008-11-28 | 2013-09-21 | Shrisinha Technology Corp | Data hiding protection method and its hardware |
CN103678517A (en) * | 2013-11-27 | 2014-03-26 | 华为技术有限公司 | Method for fixing logical errors of hard disk and controller |
CN103678517B (en) * | 2013-11-27 | 2017-01-18 | 华为技术有限公司 | Method for fixing logical errors of hard disk and controller |
TWI674545B (en) * | 2018-11-15 | 2019-10-11 | 華南商業銀行股份有限公司 | Data management method and system thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2003042840A1 (en) | A method for backing up and recovering data in a hard disk | |
US6615365B1 (en) | Storing a computer disk image within an imaged partition | |
US5086502A (en) | Method of operating a data processing system | |
US6845464B2 (en) | Performing operating system recovery from external back-up media in a headless computer entity | |
EP1770513B1 (en) | Method and system for booting and automatically updating software, and recovering from update error | |
US9606875B2 (en) | Migration of computer data | |
US8732121B1 (en) | Method and system for backup to a hidden backup storage | |
EP2115602B1 (en) | Nonvolatile disk cache for data security | |
US20120254107A1 (en) | Hierarchical management storage system and storage system operating method | |
WO2000020971A1 (en) | Recovery of file systems after modification failure | |
US8775783B2 (en) | Method and apparatus for creating a self booting operating system image backup on an external USB hard disk drive that is capable of performing a complete restore to an internal system disk | |
TW200428196A (en) | Reliable and secure updating and recovery of firmware from a mass storage device | |
KR100692473B1 (en) | Information processing apparatus, information processing apparatus control program, and information processing apparatus control method | |
US20120221892A1 (en) | Computer system, control method thereof and recording medium storing computer program thereof | |
TW569131B (en) | Hard disk data backup and recovery method | |
JP7059691B2 (en) | Electronics and programs | |
AU633775B2 (en) | A method of operating a data processing system | |
US20030037279A1 (en) | HDD data backup and recovery method | |
JP2004362221A (en) | Hard disk backup recovery system, hard disk backup recovery method and information processing device | |
JP2633614B2 (en) | File protection device | |
TWI416319B (en) | Boot method for computer system using redundant array of independent disks | |
JP2002082821A (en) | Device and method for managing file and recording medium | |
PARTITION | J enevein et ai. | |
TWI237791B (en) | Control method for automatically installing operating system and automatically restoring system file | |
TW200823653A (en) | Method for repairing the data of double flash ROMs and synchronizing data between the two flash ROMs |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
GD4A | Issue of patent certificate for granted invention patent | ||
MM4A | Annulment or lapse of patent due to non-payment of fees |