Solution:
Kod: Zaznacz cały
sudo apt-get install testdisk
Kod: Zaznacz cały
sudo apt-get install testdisk
sudo apt-get install testdisk
A tu masz jeszcze coś w języku angielskimTestDisk, PhotoRescue, DD - odzyskiwanie danych i naprawa bad sektorów
Opracowanie: Michał Mrówczyński
Na podstawie materiałów zawartch na stronie: http://www.cgsecurity.org/
I. Prace wstępne.
Na początek najlepiej wykonać obraz dysku, w celu pracy na nim bez ryzyka zwiększenia zniszczeń na uszkodzonym lub sformatowanym nośniku czy też na nośniku z którego skasowano niewłaściwe dane.
Wykonanie obrazu dysku możemy wykonać za pomocą wbudowanej funkcji w Testdisk lub programem dd lub dd_rescue (patrz. wpis DD, DD_RESCUE).
W celu sprawdzenia jaki jest układ partycji korzystamy z polecenia fdisk -l, fdisk -l /dev/s??
I. 1. Wykonujemy obraz dysku lub interesującej nas partycji (Test Disk).
sudo testdisk
Wybieramy interesujący nas dysk (strzałkami góra/dół) i zatwierdzamy przycisk [Procced] (strzałki lewo/prawo)
Wybieramy typ tabeli partycji (zazwyczaj będzie to: [Intel ] Intel/PC partition)
Następnie wybieramy opcję [ Advanced ] Filesystem Utils
Strzałkami góra/dół wybieramy partycję do wykonania obrazu, a strzałkami lewo/prawo wybieramy opcję [Image Creation]. Pojawi się nam zawartość dysku (pliki i katalogi), dzięki czemu możemy się upewnić, że jest to ta właściwa partycja. Operację zatwierdzamy klawiszem y.
UWAGA! Dane zostaną zapisane w katalogu domowym użytkownika.
Aby obraz znajdował się w katalogu np. /media/disk1/Odzyskane, musimy wcześniej przejść do tego katalogu.
cd /media/disk1/Odzyskane
I. 2.
DD, DD_RESCUE (backup całego dysku i pozbywanie się bad sektorów)
Jako rot wykonujemy polecenie (kopia 1:1)
dd if=/dev/old_disk of=/dev/new_disk conv=noerror,sync
gdzie old_disk to uszkodzony dysk/partycja new_disk to dysk partycja na którą będziemy wykonywać kopię 1:1 uszkodzonego dysku.
conv=noerror,sync
Jako rot wykonujemy polecenie (wykonanie obrazu dysku)
dd if=/dev/old_disk of=image_file conv=noerror
Aby obraz znajdował się w katalogu np. /media/disk1/Odzyskane, musimy wcześniej przejść do tego katalogu.
cd /media/disk1/Odzyskane
UWAGA! Bądź ostrożny, jeśli kopiujesz cały dysk (np. /dev/sda) dyskiem docelowym musi być inny dysk twardy (fizyczny) a nie partycja na tym samym dysku czy partycja (logiczna) na innym dysku (dane znajdujące się na dysku zostaną skasowane).
W przypadku kopiowania partycji (logicznej), partycja docelowa musi być wystarczająco duża.
Kopiowanie całego dysku jest zalecane.
Jeśli na dysku występuje bardzo duża ilość bad sektorów, należy skorzystać z programu
II. Odzyskiwanie skasowanych danych.
II. 1. NTFS i FAT oraz EXT2 (EXT3/4 należy zamontować najpierw jako EXT2)
sudo testdisk
Wybieramy interesujący nas dysk (strzałkami góra/dół) i zatwierdzamy przycisk [Procced] (strzałki lewo/prawo)
Wybieramy typ tabeli partycji (zazwyczaj będzie to: [Intel ] Intel/PC partition)
Następnie wybieramy opcję [ Advanced ] Filesystem Utils
Strzałkami góra/dół wybieramy partycję do wykonania obrazu, a strzałkami lewo/prawo wybieramy opcję [Undelete]. Pojawi się nam zawartość dysku (pliki i katalogi), dzięki czemu możemy się upewnić, że jest to ta właściwa partycja. Klawiszem c
zatwierdzamy kopiowanie danego pliku katalogu, a następnie strzałkami góra/dół wybieramy miejsce gdzie ma zostać skopiowany plik
.
II. 2. NTFS i FAT oraz EXT2/3/4
sudo photorec
Wybieramy interesujący nas dysk (strzałkami góra/dół) i zatwierdzamy przycisk [Procced] (strzałki lewo/prawo)
Wybieramy typ tabeli partycji (zazwyczaj będzie to: [Intel ] Intel/PC partition)
Następnie wybieramy opcję [ Search ]
Strzałkami góra/dół wybieramy typ partycji
[ ext2/ext3 ] ext2/ext3/ext4 filesystem lub
[ Other ] FAT/NTFS/HFS+/ReiserFS/...
Następnie wybieramay metodę przszukania dysku (wolna przestrzeń)
[ Free ] Scan for file from FAT32 unallocated space only lub (cały dysk)
[ Whole ] Extract files from whole partition.
Pojawi się nam zawartość dysku (pliki i katalogi), dzięki czemu możemy się upewnić, że jest to ta właściwa partycja.
Operację zatwierdzamy klawiszem y.
UWAGA! Dane zostaną zapisane w katalogu domowym użytkownika.
Aby obraz znajdował się w katalogu np. /media/disk1/Odzyskane, musimy wcześniej przejść do tego katalogu.
cd /media/disk1/Odzyskane
TestDisk naprawa tablicy partycji i botloadera
http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step
TestDisk displays the menus (also see TestDisk Menu Items).
menus
* Use the default menu "Analyse" to check your current partition structure and search for lost partitions.
* Confirm at Analyse with Enter to proceed.
Now, your current partition structure is listed. Examine your current partition structure for missing partitions and errors.
Analyse
The first partition is listed twice which points to a corrupted partition or an invalid partition table entry,
Invalid NTFS boot points to a faulty NTFS boot sector, so it's a corrupted filesystem.
Only one logical partition (label Partition 2) is available in the extended partition. One logical partition is missing.
* Confirm at Quick Search to proceed.
Quick Search for partitions
vista check
* Confirm according to your OS and created partitions to proceed.
TestDisk displays the first results in real time.
quick search
(click on thumb to display the image).
During the Quick Search, TestDisk has found two partitions including the missing logical partition labeled Partition 3.
first results
* Highlight this partition and press p to list your files (to go back to the previous display, press q to Quit).
All directories and data are correctly listed.
* Press Enter to proceed.
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 press Enter to proceed.
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.
* Press Enter to proceed.
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 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
* files and directory from FAT12, FAT16 and FAT32 filesystem,
* files from ext2 filesystem,
* files from NTFS partition since version 6.11.
If it doesn't work or for other fil
Użytkownicy przeglądający to forum: Bing [Bot] i 110 gości