TestDisk шаг за шагом

From CGSecurity

Jump to: navigation, search

En.png english version De.png deutsche Version Es.png versión español Fr.png version française Ru.png Русская версия Ua.png Українська версія


Этот пример проблемной (Пример восстановления) ситуации представляет собой пошаговые действия при работе с TestDisk, позволяющие восстановить и исправить поврежденные/ый раздел/ы.

Translation of this TestDisk manual to other languages are welcome.

Contents

Пример проблемы

Мы имеем жесткий диск объемом 36GB, содержащий 3 раздела. К сожалению:

  • загрузочный сектор на основном разделе NTFS был поврежден, и
  • логический раздел NTFS был случайно удален.

Этот пример восстановления покажет пошаговые действия использования TestDisk, чтобы восстановить эти 'потерянные' разделы:

  • перезапись поврежденного загрузочного сектора, и
  • восстановление случайно удаленного логического раздела NTFS.

Восстановление раздела FAT32 (вместо приведенного в данном руководстве NTFS раздела) может быть достигнуто, если проделывать такие же действия.
Другие примеры восстановления также доступны просмотра /чтения recovery examples.
Для получения информации о FAT12, FAT16, ext2/ext3, HFS +, ReiserFS и других типов разделов, читайте Запуск TestDisk. Running the TestDisk Program.

Одним из условий при работе в программе является:
  • Запуск программы должен осуществляться с привилегиями / правами "администратора".
Важные моменты для использования TestDisk:
  • Чтобы перейти в TestDisk, используйте клавиши стрелки Вверх/Вниз и PageUp/PageDown.
  • Чтобы продолжить, подтвердите свой выбор нажатием клавиши Enter.
  • Чтобы вернуться к предыдущему дисплею или выйти TestDisk, используйте клавишу Q (выход).
  • Чтобы сохранить изменения в сделанные при работе TestDisk, вы должны подтвердить их клавишей Y (да) и / или Enter
  • Для записи данных в раздел MBR, вам необходимо выбрать "Write" посредством выбора с клавиатуры и нажмите клавишу Enter.

Признаки

1. Если на жестком диске первичный раздел содержит операционную систему, то, скорее всего, которая больше не загрузиться; из-за в первичном разделе загрузочного сектора.
2. Если жесткий диск содержит вторичные разделы, к которым невозможно получить доступ или вы можете подключаете свой диск на второй канал в другом компьютере (обычно там подключены CD / DVD привод),и наблюдаются следующие симптомы следующие симптомы бы отметил следующее:

  1. Проводник Windows или Дисковый менеджер отображает первый первичный раздел как raw неотформатированный и Windows показывает:
    The drive is not formatted, do you want to format it now? [Ваш диск неотформатирован. Отформатировать его сейчас?]
  2. Логический раздел отсутствует. В ПРОВОДНИКЕ Windows логический диск не доступен. В Оснастке Управление дисками отображает только "незанятое пространство", на месте где этот логический раздел был расположен.

Running TestDisk executable

If TestDisk is not yet installed, it can be downloaded from TestDisk Download. Extract the files from the archive including the sub-directories.

To recover lost partition or repair filesystem from hard disk, USB key, Smart Card..., you need enough rights to access physical device.

  • dos.png Under Dos, run TestDisk.exe
  • win.png Under Windows, start TestDisk (ie testdisk-6.9/win/testdisk_win.exe) from an account in the Administrator Group. Under Vista, use right-click "run as administrator" to launch TestDisk.
  • linux.png Under Unix/Linux/BSD, you need to be root to run TestDisk (ie. sudo testdisk-6.9/linux/testdisk_static)
  • macosx.png Under MacOSX, if you are not root, TestDisk (ie testdisk-6.9/darwin/TestDisk) will restart itself using sudo after confirmation on your part.
  • os2.png Under OS/2, TestDisk doesn't handle physical device, only disk image, sorry.

To recover partition from a media image or repair a filesystem image, run

  • testdisk image.dd to carve a raw disk image
  • testdisk image.E01 to recover files from an Encase EWF image
  • testdisk 'image.*' if the Encase image is splitted in several files.

linux.png macosx.png To repair a filesystem not listed by TestDisk, run testdisk device, i.e.

  • testdisk /dev/mapper/truecrypt0 or testdisk /dev/loop0 to repair the NTFS or FAT32 boot sector files from a TrueCrypt partition. The same method works with filesystem encrypted with cryptsetup/dm-crypt/LUKS.
  • testdisk /dev/md0 to repair a filesystem on top of a Linux Raid device.

Log creation

menu create
  • Choose Create unless you have a reason to append data to the log or if you execute TestDisk from a read only media and nowhere else to create it.
  • Press Enter to proceed.

Выбор диска

Все жесткие диски должны быть определены TestDisk'ом и перечислены, их размер должен быть указан правильно:

disk selection
  • Пользуйтесь кнопками стрелок вниз/вверх для выбора "проблемного" жесткого диска.
  • Нажмите Ввод (Enter) для продолжения.

macosx.png По возможности, выбирайте низкоуровневые (raw) /dev/rdisk* устройства вместо логических /dev/disk* для повышения скорости передачи данных.

Выбор типа Таблицы Разделов

TestDisk отображает типы Таблицы Разделов (Partition Table types).

menu partition table type
  • Выберите нужный тип Таблицы Разделов. Обычно правильное значение уже выбрано "по умолчанию", поскольку TestDisk при анализе определяет тип таблицы автоматически.
  • Нажмите Ввод (Enter) для продолжения.

Статус Таблицы Разделов текущего диска

TestDisk отображает следующее меню (см. также TestDisk Menu Items).

menus
  • Выберите пункт меню "Анализ" ("Analyse") для проверки структуры разделов текущего диска и поиска "потерянных" разделов.
  • Нажмите Enter для продолжения.

Далее будет отображена текущая структура разделов. Изучите её на предмет отсутствия разделов или ошибки.

Analyse

Первый раздел отображен в списке дважды, что указывает на поврежденный раздел или недействительную запись таблицы разделов,
сообщение Invalid NTFS boot указывает на неисправный загрузочный сектор NTFS, что говорит о неисправной файловой системе.
В расширенном разделе доступен только один логический раздел с меткой [Partition 2]. Второй логический раздел отсутствует.

  • Нажмите Quick Search (Быстрый поиск) для продолжения.

Быстрый поиск разделов

vista check
  • Ответьте на вопрос Should TestDisk search for partition created under Vista? (Производить поиск разделов созданных под ОС Vista?).

Если не знаете или не уверены рекомендуется ответить утвердительно. TestDisk отображает результаты поиска в режиме реального времени.

quick search

TestDisk нашел два раздела, включая потерянный логический с меткой Partition 3.

first results
  • Выберите этот раздел и нажмите p для отображения списка файлов (Для выхода из режима отображения списка файлов, нажмите q).

Все папки и файлы отображаются нормально. (Утилита не понимает русский язык, поэтому файлы с русскими именами будут отображены не корректно)

  • Нажмите Ввод (Enter) для продолжения.

Save the partition table or search for more partitions?

menu search!
  • When all partitions are available and data correctly listed, you should go to the menu Write to save the partition structure. The menu Extd Part gives you the opportunity to decide if the extended partition will use all available disk space or only the required (minimal) space.
  • Since a partition, the first one, is still missing, highlight the menu Deeper Search (if already not done automatically) and Нажмите Ввод (Enter) для продолжения.

A partition is still missing: Deeper Search

Deeper Search will also search for FAT32 backup boot sector, NTFS backup boot superblock, ext2/ext3 backup superblock to detect more partitions,

it will scan each cylinder
quick search
(click on thumb).

After the Deeper Search, the results are displayed as follows:
The first partition "Partition 1" was found by using backup boot sector. In the last line of your display, you can read the message "NTFS found using backup sector!" and the size of your partition. The "partition 2" is displayed twice with different size.
Both partitions are listed with status D for deleted, because they overlap each other.

results deeper search!
  • Highlight the first partition Partition 2 and press p to list its data.
The file system of the upper logical partition (label Partition 2) is damaged
damaged file system
(click on thumb).
  • Press q for Quit to go back to the previous display.
  • Let this partition Partition 2 with a damaged file system marked as D(deleted).
  • Highlight the second partition Partition 2 below
  • Press p to list its files.
list files

It works, you have found the correct partition!

  • Use the left/right arrow to navigate into your folders and watch your files for more verification

Note: FAT directory listing is limited to 10 clusters, some files may not appears but it doesn't affect recovery.

  • Press q for Quit to go back to the previous display.
  • The available status are Primary, * bootable, Logical and Deleted.

Using the left/right arrow keys, change the status of the selected partition to L(ogical)

set partition to recover

Hint: read How to recognize primary and logical partitions?
Note: If a partition is listed *(bootable) but if you don't boot from this partition, you can change it to Primary partition.

  • Нажмите Ввод (Enter) для продолжения.

Partition table recovery

It's now possible to write the new partition structure.
Note: The extended partition is automatically set. TestDisk recognizes this using the different Partition structure.

menu write
  • Confirm at Write with Enter, y and and Ok.

Now, all partitions are registered in the partition table.

NTFS Boot sector recovery

The boot sector of the first partition named Partition 1 is still damaged. It's time to fix it. The status of the NTFS boot sector is bad and the backup boot sector is valid. Boot sectors are not identical.

backup bs
  • To copy the backup of the boot sector over the boot sector, select Backup BS, validate with Enter, use y to confirm and next Ok.

More Information about repairing your boot sector under TestDisk Menu Items. The following message is displayed:

after backup bs

The boot sector and its backup are now both ok and identical: the NTFS boot sector has been successfully recovered.

  • Press Enter to quit.
reboot
  • TestDisk displays You have to restart your Computer to access your data so press Enter a last time and reboot your computer.

Recover deleted files

TestDisk can undelete

If it doesn't work or for other filesystem, try PhotoRec, a signature based file recovery utility.

Return to TestDisk main page

Personal tools
Data Recovery
Security