home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 July / PCpro_2004_07.ISO / docs / testdisk / testdisk.txt < prev   
Encoding:
Text File  |  2003-10-11  |  15.4 KB  |  393 lines

  1. *TestDisk   Data   Recovery   Utility*
  2.  
  3.     
  4.  
  5.  
  6.   TestDisk Documentation
  7.  
  8.     
  9.  
  10.  
  11. Documentation by Christophe Grenier,
  12. Simone Brandt and Daniel B. Sedory
  13.  
  14.  
  15.     Contents
  16.  
  17. TestDisk *License* <#LIC>
  18. *Warning* <#WARN>
  19. TestDisk *Features* <#TDFeat>
  20. *Help* for Novices <#Novice>
  21. Running (Executing) the TestDisk *Program* <#RUN>
  22. TestDisk *Menus* <#TDMenu>
  23. *Source Code* and *Compiling* TestDisk for DOS, Linux and BSD <#Comp>
  24. TestDisk *Development* Group <#TDDev>
  25. ------------------------------------------------------------------------
  26.  
  27.  
  28.     License
  29.  
  30. TestDisk, http://www.cgsecurity.org <http://www.cgsecurity.org/>, is
  31. OpenSource software and is licensed under the GNU Public License,
  32. http://www.gnu.org/licenses/gpl.html.
  33.  
  34.  
  35.   *TestDisk Features*
  36.  
  37. *TestDisk* was primarily designed to help *recover lost partitions*
  38. and/or *make non-booting disks bootable again* /when/ these symptoms are
  39. caused by /faulty software/, certain types of /viruses/ or /human error/
  40. (such as /accidentally/ erasing your Partition Table). You can also use
  41. TestDisk to help analyze the sectors copied from a hard drive with
  42. physical problems onto a good drive.
  43.  
  44.  
  45.   Damaged harddisk
  46.  
  47. If there are bad sector on your hard disk, you need another disk to copy
  48. the data ont it. The new disk can be bigger, it's usually not a problem
  49. because the number of heads per cylinder (255) and sectors per head (63)
  50. will be the same if both disk use LBA mode. Under Linux, run |dd
  51. if=/dev/old_disk of=/dev/new_disk conv=noerror| to copy the data.
  52.  
  53.  
  54.   Hard Disk image
  55.  
  56. Linux version of TestDisk can work on disk image. The disk image must be
  57. avaible under hdimage name in the working directory.
  58.  
  59. *TestDisk* can */run/* under *DOS* (either /real/ or in a Win9x
  60. DOS-box), *Linux* or *FreeBSD* (see the section below on *Compiling*
  61. <#Comp> ). */But/* TestDisk will   */find/*   lost partitions for all of
  62. these types:
  63.  
  64.     * BeFS ( BeOS )
  65.     * DOS/Windows FAT12, FAT16 and FAT32
  66.     * Ext2 and Ext3 ( Linux)
  67.     * Linux Swap (versions 1 and 2)
  68.     * Netware
  69.     * NTFS ( Windows NT/2K/XP )
  70.     * ReiserFS (versions 1 and 2)
  71.     * UFS ( BSD )
  72.  
  73. TestDisk is a true 32-bit program (compiled under DJGPP), so a DPMI
  74. server program (cwsdpmi.exe) is included in the download which allows
  75. TestDisk to run under 16-bit DOS.
  76.  
  77. TestDisk queries the BIOS ( DOS/Win9x) or the OS ( Linux, FreeBSD) in
  78. order to find the Hard Disks and their characteristics ( LBA size and
  79. CHS geometry). TestDisk does a quick check of your disk's structure and
  80. compares it with your Partition Table for entry errors. If the Partition
  81. Table has entry errors, TestDisk can repair them. If you have missing
  82. partitions or a completely empty Partition Table, TestDisk can search
  83. for partitions and create a new Table or even a new MBR if necessary.
  84.  
  85. /However/, it's up to the user to look over the list of /possible/
  86. partitions found by TestDisk and to select the one(s) which were being
  87. used just before the drive failed to boot or the partition(s) were
  88. /lost/. In some cases, especially after initiating a detailed search for
  89. lost partitions, TestDisk may show partition data which is simply from
  90. the /remnants/ of a partition that had been deleted and overwritten long
  91. ago. Because of this possibility, one should always 1) Give each new
  92. partition a unique label name, and 2) Whenever you decide to /delete all
  93. existing partitions/ on a drive in order to /'start all over again'/ to
  94. 'zero-out' every byte on the disk first. This procedure will remove all
  95. remnants of previously existing partitions (manufacturers often include
  96. routines to 'zero-out' a drive in a utility program downloads section on
  97. their web sites). If one isn't available, or if you're *not* removing
  98. /all/ of the partitions from a drive, you could at least use a '/wipe/
  99. free space' utility /after/ installing a new OS or /resizing/ a drive's
  100. partitions.
  101.  
  102. TestDisk has features for both novices and experts. For those who know
  103. little or nothing about data recovery techniques, the command line
  104. parameters */log* and */debug* can be used to collect detailed
  105. information about a non-booting drive which can then be sent to a tech
  106. for further analysis. Those more familiar with such procedures should
  107. find TestDisk a handy tool in performing onsite recovery.
  108.  
  109. *Warning:* If you use TestDisk to recover lost partitions on a target
  110. hard drive by connecting the drive to a computer other than the one it
  111. was originally partitioned and formatted on, you risk the chance of
  112. having */incorrect data/* about the drive passed along to TestDisk from
  113. the *BIOS* of this other computer. BIOS chips have /at least/ two
  114. /different ways of translating disk geometry/, and using the wrong data
  115. may make it impossble for TestDisk to correctly recover a drive's lost
  116. partitions; or worse, you may write the wrong data to the drive's MBR,
  117. boot up the disk and then incorrectly write data to the disk leading to
  118. further corruption and loss of data. ( This may not apply to all file
  119. systems.)
  120.  
  121. ------------------------------------------------------------------------
  122.  
  123.  
  124.     If you don't understand how to use TestDisk,
  125.  
  126. - run "*testdisk  /log  /debug*" (make sure to hit the space bar once
  127. before each slash),
  128. - select the faulty hard disk using arrow keys then press the ENTER key,
  129. - after TestDisk is finished (Note: you may need to press the ENTER key
  130. a couple more times during its processing), choose *Search!* to restart
  131. the analyse.
  132. - just send the file which TestDisk creates, *testdisk.log*, to
  133. grenier@cgsecurity.org <mailto:grenier@cgsecurity.org>
  134.   ( Note: TestDisk */appends/* new information to *testdisk.log*; it
  135. does not overwrite an existing file.)
  136.  
  137. ------------------------------------------------------------------------
  138.  
  139.  
  140.   Executing the TestDisk Program
  141.  
  142. When TestDisk is executed, you may see the phrase "Please wait..." on
  143. your screen until it has gathered enough data from the BIOS or OS to
  144. list the disk drives on the system.
  145.  
  146. ------------------------------------------------------------------------
  147.  
  148.  
  149.   TestDisk Menu Items
  150.  
  151.  
  152.     *Analyse*
  153.  
  154.     Analyzes a drive's current partition structure and searches
  155. partition making it possible to recover lost partitions.
  156.  
  157.     TestDisk assumes the existence of partitions and scans all relevant
  158. drive cylinders for them. A primary partition starts at the beginning of
  159. a cylinder (head=0, sector=1), while a logical partition starts a little
  160. further along (head=1, sector=1). For each possible partition starting
  161. location, TestDisk can search for the presence of a partition header,
  162. which confirms the presence of a known partition type. Thus, the size of
  163. a partition is determined directly from its structure on the disk. Each
  164. partition that TestDisk discovers is added to a list of found partitions.
  165.  
  166.     Once the analysis is complete, TestDisk generates a report of found
  167. partitions.
  168.  
  169. You can list files of FAT/EXT2/EXT3/RFS partition by pressing |P| (FAT
  170. directory listing is limited to 5 clusters, some files may not appears).
  171.  
  172. You can also change the partition type with |T| or add another partition
  173. with |A|. With the left/right arrow key, you can change the status of
  174. the selected partition between *P*rimary, *** bootable, *L*ogical,
  175. *D*eleted. |Structure: Ok| should appear if everything is ok, i.e. no
  176. primary partition between two extended, one or less bootable partition,
  177. no partition using the same disk space.
  178.  
  179. TestDisk gives the user a choice of writing that data to the drive's
  180. Partition Table, or of running a more detailed analysis; one in which
  181. the option "Paranoid" (see *Options* <#OPT> below) will be set to search
  182. for a partition at every possible location.
  183.  
  184.     * *Quit*
  185.           Quits (exits) from the TestDisk program without making any
  186.       changes (unless you pressed the ENTER key while *Write* was
  187.       'highlighted').
  188.     * *Search!*
  189.           TestDisk is an intuitive program. When you ask it to
  190.       */search/* for the existence of any possible partitions on the
  191.       drive, it will automatically set the options "*Paranoid*" and
  192.       "*Mode*" to the most effective settings. This means you rarely
  193.       need to bother with the *Options* Menu.
  194.     * *Write*
  195.           Writes the changes that have been made in TestDisk's memory
  196.       buffer to the hard drive. If you are unsure of the changes (often
  197.       to the MBR's Partition Table), then don't use this function!
  198.  
  199. Anyway TestDisk ask you to confirm the Write operation.
  200.  
  201.  
  202.     Delete
  203.  
  204. Deletes all partition data from the Partition Table only (by filling it
  205. with zero bytes). Both the MBR Code and the signature bytes (if any)
  206. remain the same.
  207.  
  208.  
  209.     MBR Code
  210.  
  211. TestDisk overwrites the code and MBR signature (the hex Word 0xAA55)
  212. with a copy of the Standard Master Boot Record (similar to MS-DOS's
  213. *fdisk* with the 'undocumented' */MBR* switch). This might be useful if
  214. your system doesn't boot at all, /and/ you've tried everything else!
  215. [ For a fully-commented copy of the Standard (or 'classic') MBR code,
  216. see: An Examination of the Standard MBR
  217. <http://www.cgsecurity.org/testdisk/STDMBR.htm> (edited copy at
  218. CGSecurity.org; France) or: An Examination of the Standard MBR
  219. <http://www.geocities.com/thestarman3/asm/mbr/STDMBR.htm> (original USA
  220. site). ]
  221.  
  222.  
  223.     Disk Geometry
  224.  
  225. Change hard disk geometry parameters (Cylinders, Heads, Sectors). *For
  226. Experts only.*
  227.  
  228. Skip this unless you're familiar with changing disk geometry. These
  229. numbers change the way that TestDisk looks for partitions and calculates
  230. their sizes, etc. It does not affect the hard drive itself, /unless/ you
  231. actually write data about lost partitions to the drive. Choosing the
  232. wrong geometry settings and then saving any lost partitions based on
  233. those faulty settings might make it impossible to recover your data.
  234.  
  235. To access data, the BIOS often uses a geometry (Cylinder/Heads/Sector)
  236. different than the physical geometry.
  237.  
  238. The i386 partition handling programs very often make partitions end on
  239. cylinder boundaries. A method uses by BIOS is to read the partition
  240. table and to guess the number of heads. When the partition table is
  241. cleared or corrupted, the physical disk geometry may be used instead. It
  242. become hard for partition recovery utilities to find lost partitions on
  243. the hard disk.
  244.  
  245. This problem is not limited to DOS users. Linux users can also affected.
  246. Under Linux, run |dmesg| and search for |Partition check|. In the
  247. following exemple, the geometry of harddisk |hdc| is determined by the
  248. partition table (|PTBL|).
  249.  
  250. Partition check:
  251.  hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 hda9 hda10 hda11 hda12 hda13 >
  252.  hda3: <bsd: hda14 hda15 hda16 hda17 >
  253.  hdc: [PTBL] [7476/255/63] hdc1 < hdc5 hdc6 hdc7 hdc8 hdc9 hdc10 hdc11 hdc12 hdc13 >
  254.  
  255. Under TestDisk, uses the |Geometry| menu to change the logical number of
  256. heads. Try 255, 240, 128, 64, 32 and 16 heads until you found the
  257. correct geometry.
  258.  
  259.  
  260.     *Options*
  261.  
  262. Can be changed by first 'highlighting' the Option and then /toggling/
  263. the ENTER key, or by just toggling the underlined letter in the Option
  264. name on the keyboard; whether highlighted or not.
  265.  
  266.     * *_P_aranoid*: Search for all possible partitions (Scan each
  267.       cylinder) (default: *No*)   The default
  268.           setting speeds searches by allowing TestDisk to jump to the
  269.       end of any 'found partitions'
  270.           before searching again. If set to 'Yes,' TestDisk will also
  271.       search for lost partitions that
  272.           might be hidden /inside of/ another partition!
  273.     * *_D_ump*: Dumps essential sectors (default: *No*)
  274.     * *_C_ylinder Boundary*: Partitions are aligned on cylinder boundary
  275.       (default: *Yes*)
  276.     * *Mode*: *_F_ast* (default) -- Search for possible partitions only
  277.       in common locations.             *Medium* -- Include searching
  278.       where /backup copies/ of Boot Records (Win9x or
  279.                       NTFS) or equivalents (e.g., a superblock for EXT2)
  280.       might be.
  281.                   *Slow* -- Search for partitions in every possible
  282.       location on the disk!
  283.                       ( Note: the '*F*' or ENTER keys cycle through
  284.       'Fast,' 'Medium' and 'Slow' choices.)
  285.     * *_A_llow partial last Cylinder*: (default: *No*)
  286.     * *Ask Partition Table _o_rder*: Order of Entries can be rearranged
  287.       (default: *No*)
  288.     * *Halt on _e_rrors*: Halt on Disk I/O errors (default: *Yes*)
  289.     * *_M_aximize extended part*: If there is logical partition, the
  290.       extended partition will used all avaible disk space.(default: *No*
  291.     * *_Q_uit*: Save Option changes and return to main Menu.
  292.  
  293.  
  294.     Advanced
  295.  
  296. Only for expert use in trying to recover and repair OS Boot sectors!
  297.  
  298. TestDisk let you manipulate the boot sector of FAT and NTFS partitions.
  299. Select the partition you want to modify and choose |Boot|.
  300.  
  301. If the boot sector and backup boot sector mismatches (FAT32 and NTFS
  302. only), you can copy overwrite the backup boot sector with the boot
  303. sector or vice versa. You can also rebuild FAT boot sector or dump the
  304. boot sector content.
  305.  
  306.  
  307.  
  308.  
  309. When TestDisk try to rebuild a FAT boot sector, the steps are
  310.  
  311.     * assume filesystem size is egal to partition size
  312.     * find the FAT type (FAT12/16/32), the fat length and the number of
  313.       reserved sectors (usually 1 for FAT12/FAT16, 32 for FAT32)
  314.     * if FAT12 or FAT16, find the root directory size
  315.     * calculate the cluster size
  316.     * if FAT32, find the root cluster
  317.     * create a boot sector with this information
  318.     * ask the user if he want to write it or not
  319.  
  320. ------------------------------------------------------------------------
  321.  
  322.  
  323.   Additional notes
  324.  
  325. If the superblock of a reiserfs partition is missing, it can be rebuild
  326. with |reiserfsck --rebuild-sb device|.
  327.  
  328. When run, Microsoft Fdisk destroys some data. While "checking disk
  329. integrity", FDISK writes hexadecimal F6h into the first and 7th sectors
  330. on each track. If you have accidentally deleted a volume, do not run
  331. fdisk! More info here
  332. <http://www.geocities.com/thestarman3/asm/mbr/FDISK98.htm>
  333.  
  334.  
  335.   TestDisk Source Compilation
  336.  
  337. Read Compile_DOS.html
  338. <http://www.cgsecurity.org/testdisk_doc/Compile_DOS.html>,
  339. Compile_Linux.html
  340. <http://www.cgsecurity.org/testdisk_doc/Compile_Linux.html> or
  341. Compile_BSD.html <http://www.cgsecurity.org/testdisk_doc/Compile_BSD.html>
  342.  
  343.  
  344.   Make a bootdisk
  345.  
  346.     * DOS <http://www.cgsecurity.org/testdisk_doc/DOS_BootDisk.html>
  347.       bootdisk
  348.     * Linux <http://www.cgsecurity.org/testdisk_doc/Linux_BootDisk.html>
  349.       bootdisk
  350.  
  351. ------------------------------------------------------------------------
  352.  
  353.  
  354.     TestDiskDev - The TestDisk Development Mailing List
  355.  
  356. If you want to subscribe to TestDiskDev, send a mail to
  357. sympa@sympa.global-asp.net
  358. <mailto:sympa@sympa.global-asp.net?subject=subscribe%20testdisk-dev>
  359. with "subscribe testdisk-dev" in the body or in the subject
  360. Our mailing list is about:
  361. - bugtracking and developing TestDisk
  362. - developing new functionality
  363. - various other data recovery related issues
  364.  
  365. We're interested in people to team up with who:
  366. - are familiar with programming
  367. - are familiar with data recovery or
  368. - are interested in doing tests on computers they can access
  369.  
  370.  
  371.   TO DO List
  372.  
  373. - Solaris recovery
  374. - Windows 2000/NT port
  375. - Save/Undo function
  376. - a partition copy function
  377. - a disk copy function
  378. - a save/restore MBR function
  379.  
  380. ------------------------------------------------------------------------
  381.  
  382.  
  383.   Recovery Example -- Linux Platform
  384.  
  385. Some examples of data recovery can be found here
  386. <http://www.cgsecurity.org/testdisk_doc/examples.html>.
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.