home *** CD-ROM | disk | FTP | other *** search
- *TestDisk Data Recovery Utility*
-
-
-
-
- TestDisk Documentation
-
-
-
-
- Documentation by Christophe Grenier,
- Simone Brandt and Daniel B. Sedory
-
-
- Contents
-
- TestDisk *License* <#LIC>
- *Warning* <#WARN>
- TestDisk *Features* <#TDFeat>
- *Help* for Novices <#Novice>
- Running (Executing) the TestDisk *Program* <#RUN>
- TestDisk *Menus* <#TDMenu>
- *Source Code* and *Compiling* TestDisk for DOS, Linux and BSD <#Comp>
- TestDisk *Development* Group <#TDDev>
- ------------------------------------------------------------------------
-
-
- License
-
- TestDisk, http://www.cgsecurity.org <http://www.cgsecurity.org/>, is
- OpenSource software and is licensed under the GNU Public License,
- http://www.gnu.org/licenses/gpl.html.
-
-
- *TestDisk Features*
-
- *TestDisk* was primarily designed to help *recover lost partitions*
- and/or *make non-booting disks bootable again* /when/ these symptoms are
- caused by /faulty software/, certain types of /viruses/ or /human error/
- (such as /accidentally/ erasing your Partition Table). You can also use
- TestDisk to help analyze the sectors copied from a hard drive with
- physical problems onto a good drive.
-
-
- Damaged harddisk
-
- If there are bad sector on your hard disk, you need another disk to copy
- the data ont it. The new disk can be bigger, it's usually not a problem
- because the number of heads per cylinder (255) and sectors per head (63)
- will be the same if both disk use LBA mode. Under Linux, run |dd
- if=/dev/old_disk of=/dev/new_disk conv=noerror| to copy the data.
-
-
- Hard Disk image
-
- Linux version of TestDisk can work on disk image. The disk image must be
- avaible under hdimage name in the working directory.
-
- *TestDisk* can */run/* under *DOS* (either /real/ or in a Win9x
- DOS-box), *Linux* or *FreeBSD* (see the section below on *Compiling*
- <#Comp> ). */But/* TestDisk will */find/* lost partitions for all of
- these types:
-
- * BeFS ( BeOS )
- * DOS/Windows FAT12, FAT16 and FAT32
- * Ext2 and Ext3 ( Linux)
- * Linux Swap (versions 1 and 2)
- * Netware
- * NTFS ( Windows NT/2K/XP )
- * ReiserFS (versions 1 and 2)
- * UFS ( BSD )
-
- TestDisk is a true 32-bit program (compiled under DJGPP), so a DPMI
- server program (cwsdpmi.exe) is included in the download which allows
- TestDisk to run under 16-bit DOS.
-
- TestDisk queries the BIOS ( DOS/Win9x) or the OS ( Linux, FreeBSD) in
- order to find the Hard Disks and their characteristics ( LBA size and
- CHS geometry). TestDisk does a quick check of your disk's structure and
- compares it with your Partition Table for entry errors. If the Partition
- Table has entry errors, TestDisk can repair them. If you have missing
- partitions or a completely empty Partition Table, TestDisk can search
- for partitions and create a new Table or even a new MBR if necessary.
-
- /However/, it's up to the user to look over the list of /possible/
- partitions found by TestDisk and to select the one(s) which were being
- used just before the drive failed to boot or the partition(s) were
- /lost/. In some cases, especially after initiating a detailed search for
- lost partitions, TestDisk may show partition data which is simply from
- the /remnants/ of a partition that had been deleted and overwritten long
- ago. Because of this possibility, one should always 1) Give each new
- partition a unique label name, and 2) Whenever you decide to /delete all
- existing partitions/ on a drive in order to /'start all over again'/ to
- 'zero-out' every byte on the disk first. This procedure will remove all
- remnants of previously existing partitions (manufacturers often include
- routines to 'zero-out' a drive in a utility program downloads section on
- their web sites). If one isn't available, or if you're *not* removing
- /all/ of the partitions from a drive, you could at least use a '/wipe/
- free space' utility /after/ installing a new OS or /resizing/ a drive's
- partitions.
-
- TestDisk has features for both novices and experts. For those who know
- little or nothing about data recovery techniques, the command line
- parameters */log* and */debug* can be used to collect detailed
- information about a non-booting drive which can then be sent to a tech
- for further analysis. Those more familiar with such procedures should
- find TestDisk a handy tool in performing onsite recovery.
-
- *Warning:* If you use TestDisk to recover lost partitions on a target
- hard drive by connecting the drive to a computer other than the one it
- was originally partitioned and formatted on, you risk the chance of
- having */incorrect data/* about the drive passed along to TestDisk from
- the *BIOS* of this other computer. BIOS chips have /at least/ two
- /different ways of translating disk geometry/, and using the wrong data
- may make it impossble for TestDisk to correctly recover a drive's lost
- partitions; or worse, you may write the wrong data to the drive's MBR,
- boot up the disk and then incorrectly write data to the disk leading to
- further corruption and loss of data. ( This may not apply to all file
- systems.)
-
- ------------------------------------------------------------------------
-
-
- If you don't understand how to use TestDisk,
-
- - run "*testdisk /log /debug*" (make sure to hit the space bar once
- before each slash),
- - select the faulty hard disk using arrow keys then press the ENTER key,
- - after TestDisk is finished (Note: you may need to press the ENTER key
- a couple more times during its processing), choose *Search!* to restart
- the analyse.
- - just send the file which TestDisk creates, *testdisk.log*, to
- grenier@cgsecurity.org <mailto:grenier@cgsecurity.org>
- ( Note: TestDisk */appends/* new information to *testdisk.log*; it
- does not overwrite an existing file.)
-
- ------------------------------------------------------------------------
-
-
- Executing the TestDisk Program
-
- When TestDisk is executed, you may see the phrase "Please wait..." on
- your screen until it has gathered enough data from the BIOS or OS to
- list the disk drives on the system.
-
- ------------------------------------------------------------------------
-
-
- TestDisk Menu Items
-
-
- *Analyse*
-
- Analyzes a drive's current partition structure and searches
- partition making it possible to recover lost partitions.
-
- TestDisk assumes the existence of partitions and scans all relevant
- drive cylinders for them. A primary partition starts at the beginning of
- a cylinder (head=0, sector=1), while a logical partition starts a little
- further along (head=1, sector=1). For each possible partition starting
- location, TestDisk can search for the presence of a partition header,
- which confirms the presence of a known partition type. Thus, the size of
- a partition is determined directly from its structure on the disk. Each
- partition that TestDisk discovers is added to a list of found partitions.
-
- Once the analysis is complete, TestDisk generates a report of found
- partitions.
-
- You can list files of FAT/EXT2/EXT3/RFS partition by pressing |P| (FAT
- directory listing is limited to 5 clusters, some files may not appears).
-
- You can also change the partition type with |T| or add another partition
- with |A|. With the left/right arrow key, you can change the status of
- the selected partition between *P*rimary, *** bootable, *L*ogical,
- *D*eleted. |Structure: Ok| should appear if everything is ok, i.e. no
- primary partition between two extended, one or less bootable partition,
- no partition using the same disk space.
-
- TestDisk gives the user a choice of writing that data to the drive's
- Partition Table, or of running a more detailed analysis; one in which
- the option "Paranoid" (see *Options* <#OPT> below) will be set to search
- for a partition at every possible location.
-
- * *Quit*
- Quits (exits) from the TestDisk program without making any
- changes (unless you pressed the ENTER key while *Write* was
- 'highlighted').
- * *Search!*
- TestDisk is an intuitive program. When you ask it to
- */search/* for the existence of any possible partitions on the
- drive, it will automatically set the options "*Paranoid*" and
- "*Mode*" to the most effective settings. This means you rarely
- need to bother with the *Options* Menu.
- * *Write*
- Writes the changes that have been made in TestDisk's memory
- buffer to the hard drive. If you are unsure of the changes (often
- to the MBR's Partition Table), then don't use this function!
-
- Anyway TestDisk ask you to confirm the Write operation.
-
-
- Delete
-
- Deletes all partition data from the Partition Table only (by filling it
- with zero bytes). Both the MBR Code and the signature bytes (if any)
- remain the same.
-
-
- MBR Code
-
- TestDisk overwrites the code and MBR signature (the hex Word 0xAA55)
- with a copy of the Standard Master Boot Record (similar to MS-DOS's
- *fdisk* with the 'undocumented' */MBR* switch). This might be useful if
- your system doesn't boot at all, /and/ you've tried everything else!
- [ For a fully-commented copy of the Standard (or 'classic') MBR code,
- see: An Examination of the Standard MBR
- <http://www.cgsecurity.org/testdisk/STDMBR.htm> (edited copy at
- CGSecurity.org; France) or: An Examination of the Standard MBR
- <http://www.geocities.com/thestarman3/asm/mbr/STDMBR.htm> (original USA
- site). ]
-
-
- Disk Geometry
-
- Change hard disk geometry parameters (Cylinders, Heads, Sectors). *For
- Experts only.*
-
- Skip this unless you're familiar with changing disk geometry. These
- numbers change the way that TestDisk looks for partitions and calculates
- their sizes, etc. It does not affect the hard drive itself, /unless/ you
- actually write data about lost partitions to the drive. Choosing the
- wrong geometry settings and then saving any lost partitions based on
- those faulty settings might make it impossible to recover your data.
-
- To access data, the BIOS often uses a geometry (Cylinder/Heads/Sector)
- different than the physical geometry.
-
- The i386 partition handling programs very often make partitions end on
- cylinder boundaries. A method uses by BIOS is to read the partition
- table and to guess the number of heads. When the partition table is
- cleared or corrupted, the physical disk geometry may be used instead. It
- become hard for partition recovery utilities to find lost partitions on
- the hard disk.
-
- This problem is not limited to DOS users. Linux users can also affected.
- Under Linux, run |dmesg| and search for |Partition check|. In the
- following exemple, the geometry of harddisk |hdc| is determined by the
- partition table (|PTBL|).
-
- Partition check:
- hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 hda9 hda10 hda11 hda12 hda13 >
- hda3: <bsd: hda14 hda15 hda16 hda17 >
- hdc: [PTBL] [7476/255/63] hdc1 < hdc5 hdc6 hdc7 hdc8 hdc9 hdc10 hdc11 hdc12 hdc13 >
-
- Under TestDisk, uses the |Geometry| menu to change the logical number of
- heads. Try 255, 240, 128, 64, 32 and 16 heads until you found the
- correct geometry.
-
-
- *Options*
-
- Can be changed by first 'highlighting' the Option and then /toggling/
- the ENTER key, or by just toggling the underlined letter in the Option
- name on the keyboard; whether highlighted or not.
-
- * *_P_aranoid*: Search for all possible partitions (Scan each
- cylinder) (default: *No*) The default
- setting speeds searches by allowing TestDisk to jump to the
- end of any 'found partitions'
- before searching again. If set to 'Yes,' TestDisk will also
- search for lost partitions that
- might be hidden /inside of/ another partition!
- * *_D_ump*: Dumps essential sectors (default: *No*)
- * *_C_ylinder Boundary*: Partitions are aligned on cylinder boundary
- (default: *Yes*)
- * *Mode*: *_F_ast* (default) -- Search for possible partitions only
- in common locations. *Medium* -- Include searching
- where /backup copies/ of Boot Records (Win9x or
- NTFS) or equivalents (e.g., a superblock for EXT2)
- might be.
- *Slow* -- Search for partitions in every possible
- location on the disk!
- ( Note: the '*F*' or ENTER keys cycle through
- 'Fast,' 'Medium' and 'Slow' choices.)
- * *_A_llow partial last Cylinder*: (default: *No*)
- * *Ask Partition Table _o_rder*: Order of Entries can be rearranged
- (default: *No*)
- * *Halt on _e_rrors*: Halt on Disk I/O errors (default: *Yes*)
- * *_M_aximize extended part*: If there is logical partition, the
- extended partition will used all avaible disk space.(default: *No*
- * *_Q_uit*: Save Option changes and return to main Menu.
-
-
- Advanced
-
- Only for expert use in trying to recover and repair OS Boot sectors!
-
- TestDisk let you manipulate the boot sector of FAT and NTFS partitions.
- Select the partition you want to modify and choose |Boot|.
-
- If the boot sector and backup boot sector mismatches (FAT32 and NTFS
- only), you can copy overwrite the backup boot sector with the boot
- sector or vice versa. You can also rebuild FAT boot sector or dump the
- boot sector content.
-
-
-
-
- When TestDisk try to rebuild a FAT boot sector, the steps are
-
- * assume filesystem size is egal to partition size
- * find the FAT type (FAT12/16/32), the fat length and the number of
- reserved sectors (usually 1 for FAT12/FAT16, 32 for FAT32)
- * if FAT12 or FAT16, find the root directory size
- * calculate the cluster size
- * if FAT32, find the root cluster
- * create a boot sector with this information
- * ask the user if he want to write it or not
-
- ------------------------------------------------------------------------
-
-
- Additional notes
-
- If the superblock of a reiserfs partition is missing, it can be rebuild
- with |reiserfsck --rebuild-sb device|.
-
- When run, Microsoft Fdisk destroys some data. While "checking disk
- integrity", FDISK writes hexadecimal F6h into the first and 7th sectors
- on each track. If you have accidentally deleted a volume, do not run
- fdisk! More info here
- <http://www.geocities.com/thestarman3/asm/mbr/FDISK98.htm>
-
-
- TestDisk Source Compilation
-
- Read Compile_DOS.html
- <http://www.cgsecurity.org/testdisk_doc/Compile_DOS.html>,
- Compile_Linux.html
- <http://www.cgsecurity.org/testdisk_doc/Compile_Linux.html> or
- Compile_BSD.html <http://www.cgsecurity.org/testdisk_doc/Compile_BSD.html>
-
-
- Make a bootdisk
-
- * DOS <http://www.cgsecurity.org/testdisk_doc/DOS_BootDisk.html>
- bootdisk
- * Linux <http://www.cgsecurity.org/testdisk_doc/Linux_BootDisk.html>
- bootdisk
-
- ------------------------------------------------------------------------
-
-
- TestDiskDev - The TestDisk Development Mailing List
-
- If you want to subscribe to TestDiskDev, send a mail to
- sympa@sympa.global-asp.net
- <mailto:sympa@sympa.global-asp.net?subject=subscribe%20testdisk-dev>
- with "subscribe testdisk-dev" in the body or in the subject
- Our mailing list is about:
- - bugtracking and developing TestDisk
- - developing new functionality
- - various other data recovery related issues
-
- We're interested in people to team up with who:
- - are familiar with programming
- - are familiar with data recovery or
- - are interested in doing tests on computers they can access
-
-
- TO DO List
-
- - Solaris recovery
- - Windows 2000/NT port
- - Save/Undo function
- - a partition copy function
- - a disk copy function
- - a save/restore MBR function
-
- ------------------------------------------------------------------------
-
-
- Recovery Example -- Linux Platform
-
- Some examples of data recovery can be found here
- <http://www.cgsecurity.org/testdisk_doc/examples.html>.
-
-
-
-
-
-
-