Dapatkan semula fail yang terpadam dengan photorec

  1. Pasang pakej testdisk sebagai root
    aptitude install testdisk
  2. Mount partition yang hendak digunakan sebagai penyimpan hasil carian. Katakan /dev/sdb1 dan sistem failnya adalah NTFS
    ntfs-3g /dev/sdb1 /mnt
  3. Buat direktori untuk simpan hasil carian
    mkdir /mnt/photorec

    Sekarang semua hasil carian akan disimpan kedalam folder tersebut

  4. Guna photorec untuk mendapatkan semula fail yang terpadam dan jangan lupa memilih /mnt/photorec sebagai destinasi simpanan hasil carian
    photorec
  5. Setelah selesai, susun hasil carian mengikut ekstensi fail dengan skrip recovery.py dibawah. Salin dan simpan kod didalam folder /mnt/photorec
    
    #!/usr/bin/env python
    import os
    import os.path
    import shutil
    import sys
    
    source = sys.argv[1]
    destination = sys.argv[2]
    
    while not os.path.exists(source):
        source = raw_input('Enter a valid source directory\n')
    while not os.path.exists(destination):
        destination = raw_input('Enter a valid destination directory\n')
    
    for root, dirs, files in os.walk(source, topdown=False):
        for file in files:
            extension = os.path.splitext(file)[1][1:].upper()
    	destinationPath = os.path.join(destination,extension)
    
    	if not os.path.exists(destinationPath):
                os.mkdir(destinationPath)
    	if os.path.exists(os.path.join(destinationPath,file)):
                print 'WARNING: this file was not copied :' + os.path.join(root,file)
    	else:
    	    shutil.copy2(os.path.join(root,file), destinationPath)
    

    Buat satu direktori untuk menyimpan fail-fail yang telah disusun mengikut extension dan susun
    mkdir /mnt/photorec-sorted
    cd /mnt/photorec
    python recovery.py . ../photorec-sorted

  6. Uji fail satu per satu. Bukan semua yang berjaya ditemui adalah dalam keadaan elok.

Rujukan: http://www.cgsecurity.org/wiki/After_Using_PhotoRec

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)