中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-13 17:18
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS学习入门 & 精彩文章 (教学室) » Ten Great Tricks for Saving a Hard Drive
Printable Version  598 / 0
Floor1 doscommand Posted 2004-04-05 00:00
银牌会员 Posts 148 Credits 1,141
Every user's hard drive stores a large amount of useful data, and the hard drive is also a component that is prone to problems. To preserve the data on the hard drive effectively, besides backup work, you also need to learn how to revive the hard drive when it fails, or extract the useful data from it, so as to reduce losses to the minimum.


1. The system does not recognize the hard drive
This kind of fault is relatively common: the system cannot boot from the hard drive, and even after booting from drive A it still cannot access drive C. Using the automatic detection function in CMOS also cannot detect the existence of the hard drive. Most of these faults occur in the connection cable or the IDE port; the failure rate of the hard drive itself is very low. By unplugging and reconnecting the hard drive cable, or replacing the IDE port and cable for testing, the source of the fault can usually be found quickly. If a newly connected hard drive is not recognized, another common reason is the master/slave jumper on the drive. If the hard drive is connected in the master position on the IDE channel, then the hard drive must be set to master. If the jumper is set incorrectly, the hard drive generally cannot be detected.

2. Faults caused by CMOS
Whether CMOS is set correctly directly affects the normal use of the hard drive; this mainly refers to the hard drive type setting in it. Fortunately, current machines all support the "IDE auto detect" function, which can automatically detect the hard drive type. After connecting a new hard drive or replacing one, you should use this function to set the type again. Of course, some current motherboards can automatically recognize the hard drive type. When the hard drive type is set incorrectly, sometimes the system simply cannot boot, and sometimes it can boot but read/write errors occur. For example, if the hard drive type set in CMOS is smaller than the actual hard drive capacity, then the sectors at the back of the hard drive cannot be read or written, and if there are multiple partitions, some partitions will disappear. There is another important cause of faults: since current IDE drives all support logical parameter modes, the hard drive may use Normal, LBA, Large, etc. If data was installed under one mode and the CMOS is later changed to another mode, read/write errors will occur on the hard drive, because the mapping relationship of its physical geometry has changed, and the original correct hard drive locations can no longer be read.

3. Boot failures caused by the master boot program
The hard drive's master boot sector is one of the most sensitive parts of the hard drive, and the master boot program in it is one part of that sector. This program is mainly used to detect whether the hard drive partitioning is correct and to determine the active partition, and it is responsible for handing boot control over to the DOS or other operating system in the active partition. If this program is damaged, booting from the hard drive will be impossible, but the hard drive can still be read and written after booting from a floppy disk or CD-ROM. The method to repair this fault is fairly simple: using the fdisk from a higher DOS version is the most convenient. When run with the /mbr parameter, it will directly replace (rewrite) the hard drive's master boot program. In fact, the hard drive's master boot sector is exactly what this program creates; fdisk。exe contains a complete hard drive master boot program. Although DOS versions have been continuously updated, the hard drive master boot program has never changed, from DOS 3。x up to the current DOS in winDOS 95, so as long as you can find a DOS boot disk to start the system and run this program, it can be repaired. In addition, other tool software such as kv300 also has this function.

4. Boot failures caused by partition table errors
Partition table errors are serious hard drive errors, and different degrees of error will cause different levels of loss. If there is no active partition flag, the computer cannot boot. But after booting the system from a floppy disk or CD-ROM, the hard drive can still be read and written, and it can be repaired by resetting the active partition with fdisk. If a certain partition type is wrong, it can cause one partition to disappear. The fourth byte of the partition table is the partition type value. The normal bootable primary DOS partition larger than 32mb has a value of 06, and the extended DOS partition value is 05. If the primary DOS partition type is changed to 05, the system cannot boot, and the data in it also cannot be read or written. If 06 is changed to a type not recognized by DOS, such as efh, DOS will regard that partition as not being a DOS partition, and of course it cannot be read or written. Many people use this type value to implement encryption technology for a single partition; restoring the original correct type value will return that partition to normal. There is also other data in the partition table used to record the starting or ending addresses of partitions. Damage to this data will cause confusion or loss of that partition, and generally it cannot be restored manually. The only method is to rewrite the backup partition table data, or obtain partition table data from another hard drive of the same type and with the same partition layout; otherwise, other data may be permanently lost. When operating on the master boot sector, tool software such as nu can be used. It is very convenient and can directly read, write, or edit the hard drive master boot sector. Of course, debug can also be used, but the operation is cumbersome and somewhat risky.

5. Hard drive faults caused by an incorrect valid signature
There is another important part in the hard drive master boot sector, namely its last two bytes: 55aah. This is the sector's valid signature. When booting from a hard drive, floppy disk, or CD-ROM, these two bytes will be checked. If they are present, the hard drive is considered to exist; otherwise, the hard drive will not be recognized. If this signature is missing, booting from the hard drive will enter rom basic or prompt you to insert a floppy disk. When booting from a floppy disk, it will not be able to transfer to the hard drive. This can be used for whole-hard-drive encryption technology. The debug method can be used for recovery. In addition, the DOS boot sector also has such a signature. When the DOS boot sector has no boot signature, the system startup will display: "missing operating system". The repair method can use the same master boot sector repair method as above, only the address is different; an even more convenient method is to use the DOS general repair method below.

6. Boot failures caused by the DOS boot system
The DOS boot system is mainly composed of the DOS boot sector and DOS system files. The system files mainly include iosys、msdos.sys、command.com, among which command.com is the DOS shell file and can be replaced with other similar files, but under the default state it is a required file for DOS startup. In the DOS system bundled with Windows 95, msdos.sys is a text file and is required to start windows. But when starting only DOS, this file is not needed. However, when DOS booting goes wrong, you can boot the system from a floppy disk or CD-ROM, and then use sys c: to transfer the system and repair the fault. Both the boot sector and the system files can be automatically restored to normal.

7. Read/write faults caused by the fat table
The fat table records the storage addresses of data on the hard drive. Every file has a linked fat chain specifying the cluster addresses where it is stored. Damage to the fat table means the loss of file contents. Fortunately, the DOS system itself provides two fat tables. If the currently used fat table is damaged, the second one can be used to overwrite and repair it. But because disks of different specifications have different fat table lengths, and the address of the second fat table is also not fixed, during repair its correct location must be found correctly. Some tool software such as nu itself has this repair function, and it is very convenient to use. This can also be done with debug, that is, by using its m command to move the second fat table to the position of the first one. If the second fat table is also damaged, then the hard drive cannot be restored to its original state, but the file data is still stored in the hard drive's data area. You can use the chkdsk or scandisk command to repair it, and in the end obtain *。chk files. These are the sector data of lost fat chains. If they are text files, data can be extracted from them and merged into complete files. If they are binary data files, it is very difficult to recover complete files.

8. Boot faults caused by damage to the directory table
The directory table records data such as filenames on the hard drive. The most important item is the starting cluster number of the file. Since the directory table has no automatic backup function, if the directory is damaged, a large number of files will be lost. One way to reduce losses is to use the chkdsk or scandisk method mentioned above to search out chk files from the hard drive. When the directory table is damaged, the first cluster number is lost. If the fat is not damaged, the chk files formed are generally fairly complete file data. Each chk file is one complete file; changing it back to the original name can restore most files.

9. Recovering data after deleting a partition by mistake
When a hard drive partition is deleted with fdisk, the apparent result is that the data on the hard drive has completely disappeared. Before formatting, entering the hard drive will show an invalid drive. If you understand how fdisk works, you will know that fdisk only rewrites the contents in the hard drive's master boot sector (side 0, track 0, sector 1). Specifically, it deletes the hard drive partition table information, while the data in every partition on the hard drive remains unchanged. You can imitate the repair method for the above partition table errors, that is, find a way to restore the partition table data, and the original partitions and data can be recovered. But this is limited to after deleting a partition or rebuilding a partition. If the partition has already been formatted with format, then after restoring the partition first, restore the partition data by the following method.

10. Recovering data from a hard drive formatted by mistake
Under higher versions of DOS, the format operation creates disk information for restoring the format under the default state. In fact, it copies all the contents of the disk's DOS boot sector, fat partition table, and directory table to the last few sectors of the disk (because the sectors at the end are seldom used), while the contents in the data area are not changed at all. Thus, by running "unformat c:" you can restore the original file allocation table and directory table, thereby recovering the hard drive information. In addition, DOS also provides a miror command to record the current disk information for recovery after formatting or deletion. This method is also quite effective.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023