|
Dimensione: 21386
Commento: import
|
Dimensione: 11023
Commento:
|
| Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
| Linea 3: | Linea 3: |
| [[Indice]] | [[Indice(depth=1)]] [[Informazioni(rilasci="10.10 10.04 9.10 8.04"; forum="http://forum.ubuntu-it.org/index.php/topic,430020")]] |
| Linea 7: | Linea 8: |
| I file eliminati o persi accidentalmente possono essere recuperati da unità guaste o formattate e da qualunque altro dispositivo di memorizzazione ottico o di massa con l'uso di programmi disponibili nei [:Repository:repository] di '''Ubuntu'''. Questa guida spiega come recuperare i dati persi. In generale, si ricorda che il modo migliore per evitare la perdita dei propri dati è di effettuare con cadenza regolare delle copie di [:AmministrazioneSistema/Backup:backup]. ||<tablestyle="text-align: justify; width:100%;" style="border:none;" 5%>[[Immagine(Icone/Piccole/warning.png,,center)]] ||<style="padding:0.5em; border:none;">'''E' buona norma evitare di provare a scrivere su dispositivi danneggiati. Questo potrebbe peggiorare i guasti hardware presenti e sovrascrivere ulteriormente i dati presenti compromettendo la possibilità di poterli recuperare in futuro. E' raccomandabile spegnere il computer appena possibile e di farlo ripartire in seguito solo per mezzo di sistemi "live" in modo da potere analizzare i dischi soggetti a problematiche [:Hardware/DispositiviPartizioni/MontarePartizioni:"non montati"]. ''' || modificare poi la nota in alto. troppo vistosa Qualora le applicazioni di seguono esposte non riescano a raggiungere il risultato desiderato, a seconda dell'importanza dei dati presenti, considerare la possibilità di richiedere una consulenza professionale in merito. |
I file eliminati o persi accidentalmente possono essere recuperati con l'uso di programmi specifici, molti dei quali disponibili nei [:Repository:repository] di '''Ubuntu'''. |
| Linea 19: | Linea 12: |
| Se il dispositivo è danneggiato è consigliabile creare un immagine del dispositivo e lavorare su esso per il recupero dei dati (si veda in seguito). Qualora il guasto non sia meccanico, è possibile recuperare i dati direttamente dal dispositivo. | Come premessa, occorre sottolineare che il modo migliore per evitare la perdita dei dati è di effettuare con cadenza regolare delle copie di backup. A questo proposito si rinvia alle [:AmministrazioneSistema/Backup:apposite guide]. |
| Linea 21: | Linea 14: |
| Per recuperare i dati da un dispositivo guasto, sarà necessario disporre di un dispositivo di archiviazione di capienza pari o superiore su cui salvare i dati recuperati. Se si necessita di un'immagine del dispositivo guasto, sarà necessario disporre di ulteriore spazio. Come accennato, è consigliabile eseguire questi strumenti da un altro sistema operativo che risiede su un altro disco (o da sistemi "live). Allo scopo è sufficiente un CD di Ubuntu Desktop. | Se il dispositivo ha subito un guasto meccanico, per non danneggiarlo ulteriormente e al fine di non compromettere la possibilità di recuperare i dati se sovrascritti, si consiglia di operare su un immagine del dispositivo stesso. |
| Linea 23: | Linea 16: |
| Se non dispone di tanta ram o connessione a internet si consigliano sistemi live come [http://ubuntu-rescue-remix.org/ Ubuntu rescue remix] oppure [http://www.sysresccd.org/Main_Page system rescue cd] i quali dispongono dei programmi di seguito menzionati. | [[Anchor(live)]] Qualora si verifichi questa eventualità è raccomandabile spegnere immediatamente il computer e in seguito utilizzarlo solo mediante sistemi ''live'' in modo da potere analizzare questi dispositivi a [:Hardware/DispositiviPartizioni/MontarePartizioni:"partizioni smontate"]. Sarà necessario un altro dispositivo di archiviazione, di capienza pari o superiore a quello di origine. Bisogna considerare la necessità di ulteriore spazio qualora sia richiesto di intervenire mediante la creazione di un'immagine. |
| Linea 25: | Linea 19: |
| == Lost Partition == | Se il guasto non è di natura meccanica è possibile, invece, recuperare i dati direttamente dal dispositivo. |
| Linea 27: | Linea 21: |
| If you made a mistake while partitioning and the partition no longer appears in the partition table, so long as you have not written data in that space, all your data is still there. | Per avviare il sistema in modalità ''live'' è sufficiente [http://www.ubuntu-it.org/index.php?page=Ottenere_Ubuntu disporre] di una copia di '''Ubuntu Desktop Editition''' da potere avviare con il [:Installazione/Grafica:CD-ROM] o da un [:Installazione/DaSupportoUsb:dispositivo USB]. In alternativa, qualora si disponga si poca ram o si è privi di una connessione ad internet, è possibile utilizzare [http://ubuntu-rescue-remix.org/ Ubuntu rescue remix] oppure [http://www.sysresccd.org/Main_Page System Rescue Cd] i quali dispongono molti dei programmi di seguito menzionati. |
| Linea 29: | Linea 23: |
| === GNU Parted === | = Recuperare le partizioni = |
| Linea 31: | Linea 25: |
| Run Parted from the command line to recover your partition. | Fare riferimento alla [:GiuseppeTerrasi/Prove9:seguente pagina]. |
| Linea 33: | Linea 27: |
| When changing the partition table on your hard drive, you must ensure that no partition on the disk is mounted. This includes swap space. The easiest way to accomplish this is to run the live cd. Parted is installed on the base Ubuntu system. Once at the desktop, open a terminal and run_: | = Creare un immagine di un dispositivo = |
| Linea 35: | Linea 29: |
| {{{ sudo swapoff -a }}} |
Fare riferimento alla [:GiuseppeTerrasi/Prove9:seguente pagina]. |
| Linea 39: | Linea 31: |
| Next run parted and tell it to use the device in question. For example, if your /dev/sda drive is the drive from which you want to recover, run: | = Estrarre i dati da un immagine = |
| Linea 41: | Linea 33: |
| {{{ sudo parted /dev/sda }}} |
Fare riferimento alla [:GiuseppeTerrasi/Prove9#estrarre:seguente pagina]. |
| Linea 45: | Linea 35: |
| Then, use the rescue option: | = Estrarre singoli file dalla partizione recuperata = == Foremost == |
| Linea 47: | Linea 38: |
| rescue START END | [http://foremost.sourceforge.net/ Foremost] è un tool da riga di comando in grado di recuperare file da un certo numero di filesystem, inclusi i sistemi Fat, Ext3 e NTFS. |
| Linea 49: | Linea 40: |
| where Start is the area of the disk where you believe the partition began and END is it's end. If parted finds a potential partition, it will ask you if you want to add it to the partition table. | Supponendo che i file persi siano su `/dev/hda`, è necessario creare una cartella scrivibile su un altro disco in cui è possibile inserire i file recuperati (nell'esempio `dev/sdb`). |
| Linea 51: | Linea 42: |
| === Testdisk === Alternatively, the testdisk application may recover your partition. Use [[InstallingSoftware| any method]] to install the '''testdisk''' package. Run testdisk and it will scan your computer for media and offer you a menu-driven way to recover your partition. {{{ sudo testdisk }}} === Gpart === Another program that can scan drives and re-create a partition table based on "guesses" is ''Gpart''. Use [[InstallingSoftware| any method]] to install the package {{{gpart}}}. To scan the first hard disk using default settings type {{{ sudo gpart /dev/sda }}} or {{{ sudo gpart /dev/hda }}} depending on your Ubuntu version. You can restore the "guessed" partition table, '''only after checking it very carefully''' (you're strongly advised to write to another device instead), using {{{ sudo gpart -W /dev/sda /dev/sda }}} == Imaging a damaged device, filesystem or drive == There are two different programs for making an image of a damaged device, in preparation for rescuing files. They are [[https://bugs.launchpad.net/ubuntu/+source/ddrescue/+bug/161126|confusingly given the same name]]: * [[http://www.gnu.org/software/ddrescue/ddrescue.html|GNU ddrescue]] (packaged as [[apt:gddrescue|gddrescue]], though once installed the command is "ddrescue") * This is the one you want. '''This documentation currently only applies to GNU ddrescue.''' * [[http://www.garloff.de/kurt/linux/ddrescue/|dd_rescue]] (packaged as [[apt:ddrescue|ddrescue]]) * This is an older, slower shell script that needs to be run in combination with another script to do the same thing as the GNU version. From /usr/share/doc/gnuddrescue/README ''GNU ddrescue is a data recovery tool. It copies data from one file or block device (hard disc, cdrom, etc) to another, trying hard to rescue data in case of read errors.'' Ddrescue does not truncate the output file if not asked to. So, every time you run it on the same output file, using a logfile, it tries to fill in the gaps. The basic operation of ddrescue is fully automatic. That is, you don't have to wait for an error, stop the program, read the log, run it in reverse mode, etc. If you use the logfile feature of ddrescue, the data is rescued very efficiently (only the needed blocks are read). Also you can interrupt the rescue at any time and resume it later at the same point. Automatic merging of backups: If you have two or more damaged copies of a file, cdrom, etc, and run ddrescue on all of them, one at a time, with the same output file, you will probably obtain a complete and error-free file. This is so because the probability of having damaged areas at the same places on different input files is very low. Using the logfile, only the needed blocks are read from the second and successive copies. '' '''If the filesystem you are imaging is greater than 4 gigs in size, you will not be able to use an MSDOS (VFAT) filesystem (usually found on USB drives) to store the image, since there is a 4G limit to the maximum size of a file on such filesystems.''' Use EXT3 or another filesystem that can handle such file sizes.'' Use [[InstallingSoftware| any method]] to install the following package: {{{ gddrescue }}} Run gnuddrescue like this: {{{ ddrescue [options] infile outfile [logfile] }}} So, if /dev/sda is unreadable, you will need to acquire another disk (or other media) onto which to save the output image. You will need to have more room on the new media than on the failed disk. {{{ sudo ddrescue -r 3 /dev/sda /media/usbdrive/image /media/usbdrive/logfile }}} Run successive passes like this: {{{ sudo ddrescue -r 3 -C /dev/sda /media/usbdrive/image /media/usbdrive/logfile }}} and gnuddrescue will use the log file to only read the gaps with errors. In both cases, the -r option determines the number of times gddrescue will try to read when it encounters an error (-1 = infinity). From [[http://www.forensicswiki.org/wiki/Ddrescue|Forensics Wiki]]: ---- First you copy as much data as possible, without retrying or splitting sectors: {{{ddrescue --no-split /dev/hda1 imagefile logfile }}} Now let it retry previous errors 3 times, using uncached reads: {{{ddrescue --direct --max-retries=3 /dev/hda1 imagefile logfile }}} If that fails you can try again but retrimmed, so it tries to reread full sectors: {{{ddrescue --direct --retrim --max-retries=3 /dev/hda1 imagefile logfile }}} ---- Other examples: These two examples are taken directly from the ddrescue info pages. Example 1: Rescue an ext2 partition in /dev/hda2 to /dev/hdb2 {{{ ddrescue -r3 /dev/hda2 /dev/hdb2 logfile e2fsck -v -f /dev/hdb2 mount -t ext2 -o ro /dev/hdb2 /mnt }}} Example 2: Rescue a CD-ROM in /dev/cdrom {{{ ddrescue -b 2048 /dev/cdrom cdimage logfile }}} write cdimage to a blank CD-ROM == Extract filesystem from recovered image == Now that the drive has been imaged, you can recover the filesystem from the image. If the filesystem is not recoverable, you can try to recover individual files. === Mounting partitions on the image === If you imaged the whole drive, you can mount the individual partitions on the image by using the "offset" option when mounting a loop filesystem. mmls from The Sleuth Kit can show you the partitions found within an image: {{{ $ mmls file -b DOS Partition Table Offset Sector: 0 Units are in 512-byte sectors Slot Start End Length Size Description 00: ----- 0000000000 0000000000 0000000001 0512B Primary Table (#0) 01: ----- 0000000001 0000000031 0000000031 0015K Unallocated 02: 00:01 0000000032 0001646591 0001646560 0803M DOS FAT16 (0x06) 03: 00:00 0001646592 0002013183 0000366592 0179M DOS FAT16 (0x06) }}} This shows several partitions. In this example, we want to mount the DOS partition starting at block 32. To calculate the number of bytes, multiply by 512: {{{ $ bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 32 * 512 16384 quit }}} Mount the partition: {{{ sudo mount -o loop,offset=16384 file mnt }}} (32 multiplied by 512 byte blocks = 16384) For mounting a typical NTFS partition created by Windows use: {{{ sudo mount -t ntfs -o r,force,loop,offset=32256 file mnt }}} (63 multiplied by 512 byte blocks = 32256) == Extract individual files from recovered image == === Foremost === Foremost is a command-line tool which can recover files from a number of filesystems, including fat, ext3 and NTFS. It can be installed and run from the live cd. Boot from the live cd and then enable the universe repository and install foremost: Use [[InstallingSoftware| any method]] to install the following package: {{{ foremost }}} Foremost can recover files from an image of the drive, or from the drive directly. If the drive has suffered hardware problems, use gnuddrescue to image the drive first. Assuming the lost files are on hda, you need to create a writeable directory on another drive where you can put the recovered files (lets say you have a big external usb drive (sdb) {{{ |
* Montare il disco esterno e creare al suo interno una cartella chiamata `foremost` da utilizzare per il recupero: {{{ |
| Linea 240: | Linea 46: |
And then run foremost: {{{ |
* Avviare '''foremost''' digitando in una finestra di terminale il seguente comando: {{{ |
| Linea 245: | Linea 49: |
To run formost on an image, just substitute the filename for the device {{{ |
* Per avviare '''foremost''' su un file immagine semplicemente sostituire il percorso {{{ |
| Linea 251: | Linea 52: |
The recovered files will then be owned by root. Change their ownership so that you can use them: {{{ |
* I file recuperati saranno di proprietà dell'utente root. Per cambiare i permessi digitare in una finestra di terminale i seguenti comandi: {{{ |
| Linea 255: | Linea 54: |
| }}} Use the -w switch to obtain only an audit of recoverable files: {{{ |
}}} dove `youruser:youruser` rappresentano rispettivamente l'utente e il gruppo di appartenenza. * Usare l'opzione `-w` solo per si desidera ottenere un analisi dei file recuperabili: {{{ |
| Linea 262: | Linea 58: |
To recover only specific file types, use the -t switch: {{{ |
* Per recuperare uno specifico tipo di file usare l'opzione `-t`: {{{ |
| Linea 269: | Linea 62: |
| Available types: | Per una panoramica dei file supportati da '''Foremost''' fare riferimento alla pagina man. |
| Linea 271: | Linea 64: |
| || '''Filetype''' || '''Comment''' || || jpg || Support for the JFIF and Exif formats including implementations used in modern digital cameras. || || gif |||| || png |||| || bmp || Support for windows bmp format. || || avi |||| || exe || Support for Windows PE binaries, will extract DLL and EXE files along with their compile times. || || mpg || Support for most MPEG files (must begin with 0x000001BA) || || wav |||| || riff || This will extract AVI and RIFF since they use the same file format (RIFF). note faster than running each separately. || || wmv || Note may also extract -wma files as they have similar format. || || mov |||| || pdf |||| || ole || This will grab any file using the OLE file structure. This includes PowerPoint, Word, Excel, Access, and StarWriter || || doc || Note it is more efficient to run OLE as you get more bang for your buck. If you wish to ignore all other ole files then use this. || || zip || Note is will extract .jar files as well because they use a similar format. Open Office docs are just zip’d XML files so they are extracted as well. These include SXW, SXC, SXI, and SX? for undetermined OpenOffice files. || || rar |||| || htm |||| || cpp || C source code detection, note this is primitive and may generate documents other than C code. || || all || Run all pre-defined extraction methods. [Default if no -t is specified] || |
== Scalpel == |
| Linea 292: | Linea 66: |
| '''Scalpel''' recupera i file utilizzando come database le definizioni contenute [http://it.wikipedia.org/wiki/Formato_di_file negli header e nei footer] presenti all'interno di un file immagine o di un file `.raw`. È simile a '''Foremost''' e potrebbe avere dei miglioramenti. | |
| Linea 293: | Linea 68: |
| === Scalpel === | Per impostazione predefinita, tutti i tipi di file presenti in `/etc/scalpel/scalpel.conf` sono commentati. Per specificare quali tipi di file si vogliono ricercare è necessario modificare il file decommentando le righe necessarie. Si allega un file [http://wiki.ubuntu-it.org/GiuseppeTerrasi/Prove8?action=AttachFile&do=get&target=scalpel.conf `scalpel.conf` di esempio] al fine di mostrare l'elenco dei file che è in grado di recuperare. |
| Linea 295: | Linea 70: |
| Scalpel is a fast file carver that reads a database of header and footer definitions and extracts matching files from a set of image files or raw device files. It is similar to foremost and may have some improvements. | Digitare in una finestra di terminale il seguente comando {{{ sudo scalpel file -o nome_cartella }}} dove file è il file immagine (o dispositivo) e nome_cartella è la cartella di destinazione. |
| Linea 297: | Linea 74: |
| By default, all file types in the database (/etc/scalpel/scalpel.conf) are commented out. To specify which filetypes you want to carve, you need to edit the file and uncomment each line. | == Magic Rescue == |
| Linea 299: | Linea 76: |
| sudo scalpel FILE -o Directory | [http://www.itu.dk/people/jobr/magicrescue/ Magic Rescue] è un programma che utilizza i cosiddetti [http://it.wikipedia.org/wiki/Formato_di_file magic number] per identificare la presenza e il tipo di file, e che può essere esteso a molti tipi di file attraverso l'uso di "recipes". |
| Linea 301: | Linea 78: |
| Where FILE is the image file (or device) and Directory is the output directory. === Magic Rescue === Another program that scans for files using "magic bytes" to identify their presence and type, and which can be extended for many file types using "recipes", can be obtained by installing, using [[InstallingSoftware| any method]], the package {{{magicrescue}}}. |
[:AmministrazioneSistema/InstallareProgrammi:Installare] il pacchetto [apt://magicrescue magicrescue]. |
| Linea 309: | Linea 82: |
| If you want to recover (for example) ''gzip'' files and ''PNG'' images from a partition named /dev/sda1, you can run {{{ |
Per recuperare dei file con estensione `gzip` e `.png` da una partizione chiamata `/dev/sda1`, digitare in una finestra di terminale il seguente comando: {{{ |
| Linea 312: | Linea 84: |
| sudo magicrescue -r gzip -r png -d ~/output /dev/hdb1 }}} |
sudo magicrescue -r gzip -r png -d ~/output /dev/sda1 }}} Questo scriverà i dati recuperati all'interno della cartella `output` dentro la cartella '''Home'''. |
| Linea 315: | Linea 87: |
| This will write all recovered files in a directory {{{output}}} inside your home directory. | == Photorec == |
| Linea 317: | Linea 89: |
| === Photorec === | '''!PhotoRec''' è un programma di recupero dati creato inizialmente solo per recuperare immagini perse dalla memoria della fotocamera digitale o da dischi fissi. In seguito il supporto è stato esteso anche per file non audio o video. Consente la ricerca di 80 diversi tipi di file. '''!PhotoRec''' fa parte del pacchetto [apt://testdisk testdisk]. |
| Linea 319: | Linea 91: |
| Photorec is file data recovery software designed to recover lost pictures from digital camera memory or even Hard Disks. It has been extended to search also for non audio/video headers. It searches for 80 different types of files. Photorec is part of the Testdisk package. Use [[InstallingSoftware| any method]] to install the following package: {{{ testdisk }}} To run Photorec on an image file, do: {{{ |
Per avviare Photorec per analizzare un file immagine digitare il seguente comando in una finestra di terminale: {{{ |
| Linea 331: | Linea 95: |
| To recover files directly from a device, run photorec without any arguments and you will be given a menu of available devices. {{{ |
Per recuperare i file direttamente dal dispositivo oggetto di recupero, avviare il programma senza argomenti e selezionare i dispositivi disponibili dal menù: {{{ |
| Linea 337: | Linea 99: |
| See [[http://www.psychocats.net/ubuntucat/recovering-windows-files-with-a-ubuntu-cd-iii-deleted-files/|this link]] for a detailed description of how to use Photorec. | == recoverjpeg == |
| Linea 339: | Linea 101: |
| === recoverjpeg === | '''recoverjpeg''' è un programma specifico per l'identificazione e il recupero delle immagini in formato `.jpeg`. |
| Linea 341: | Linea 103: |
| This program is dedicated to identifying and recovering JPEG pictures. You can install the package {{{recoverjpeg}}} using [[InstallingSoftware| any method]], and then run (assuming {{{/dev/sda1}}} is the partition you want to recover from) {{{ |
[:AmministrazioneSistema/InstallareProgrammi:Installare] il pacchetto [apt://recoverjpeg recoverjpeg] e avviarlo digitando in una finestra di terminale il seguente comando: {{{ |
| Linea 344: | Linea 105: |
| }}} | }}} sostituendo `/dev/hda1` con il dispositivo sul quale si desidera indagare. |
| Linea 346: | Linea 107: |
| Recovered files will be saved in your home directory, with names following the pattern {{{image*.jpg}}}. | I file recuperati verranno salvati nella propria cartella '''Home''', ogni immagine sarà salvata nel formato `image*.jpg`. |
| Linea 350: | Linea 111: |
| [[DataRecovery/NtfsUndelete | NtfsUndelete]] can recover deleted files from an NTFS file-system. The Windows and LiveCd versions have a very nice intuitive gui but the linux one is probably stronger and does not have a front-end gui at the moment. | Si veda il [https://help.ubuntu.com/community/DataRecovery/NtfsUndelete seguente documento] per questo strumento capace di recuperare file da un filesystem NTFS. |
| Linea 352: | Linea 113: |
| Briefly, it has 3 modes 1. "Scan", searches for deleted files and find info about them 1. "Undelete", see note below ... 1. "Copy", err i am not sure what this does as i am not a wizard |
== Sleuth Kit e Autopsy == |
| Linea 357: | Linea 115: |
| The best simple guide i have found so far 24-11-2010) is * http://www.sucka.net/2010/04/recover-deleted-files-with-ntfsundelete-from-a-ubuntu-livecd/ Obviously with a name like that i was careful about where i opened the page but it was fine. |
'''Autopsy Forensic Browser''' è un'interfaccia grafica per la suite '''The Sleuth Kit'''. Sono in grado di analizzare i dischi di Windows e UNIX e file system come NTFS, FAT, UFS1/2, Ext2/3. |
| Linea 361: | Linea 117: |
| When undeleting chose which files to undelete and where to undelete them too. By default this appears to be the desktop of the OS you are booted into, whether that is a LiveCd or on a different partition or drive. For a LiveCd or LiveUsb you will need to move them onto Usb-stick or safe partition before rebooting as the desktop gets forgotten on LiveCds unless you are using a "Persistent image". To search {{{ ntfsundelete /dev/sda2 }}} To undelete, although this might be a little wrong, the"-" at the end worries me. {{{ ntfsundelete /dev/sda2 -u -i 3689 -o work.doc -d ~ }}} For better information on using ntfsundelete please see the separate page [[DataRecovery/NtfsUndelete | NtfsUndelete]], particularly the External Links there. == Sleuth Kit and Autopsy == (Obtained the following from http://www.sleuthkit.org/autopsy/desc.php) The Autopsy Forensic Browser is a graphical interface to the command line digital investigation analysis tools in The Sleuth Kit. Together, they can analyze Windows and UNIX disks and file systems (NTFS, FAT, UFS1/2, Ext2/3). The Sleuth Kit and Autopsy are both Open Source and run on UNIX platforms. As Autopsy is HTML-based, you can connect to the Autopsy server from any platform using an HTML browser. Autopsy provides a "File Manager"-like interface and shows details about deleted data and file system structures. |
Sono entrambi Open Source e disponibili su piattaforme UNIX. '''Autopsy''' essendo HTML-based è possibile connettersi ad esso da qualsiasi piattaforma attraverso l'uso di un browser. '''Autopsy''' mostrerà i dettagli circa i dati cancellati e la struttura del filesystem. |
| Linea 386: | Linea 121: |
| Autopsy can be run from the "live" CD, but you must specify an address to which you can connect remotely. You must also specify an external disk on which it can save the extracted information. | '''Autopsy''' può essere avviato da un live CD. Bisognerà indicare un disco sul quale salvare le informazioni estratte e un indirizzo IP verso il quale connettersi. |
| Linea 388: | Linea 123: |
| For example, assuming you have an external disk mounted to {{{/media/disk}}} with an autopsy folder on it and your IP address is {{{192.168.0.1}}}, you can run: {{{ |
Per esempio, assumendo che si disponga di un dispositivo montato in `/media/disk` con una cartella chiamata `autopsy` e che l'indirizzo IP sia `192.168.0.1`: {{{ |
| Linea 395: | Linea 129: |
| Extract unallocated (deleted) blocks from a disk or disk image. | * Estrarre i blocchi non allocati (cancellati) da un dispositivo o da un file immagine: {{{ dls inputimage > outputimage }}} Utilizzare un programma di recupero dati (fare anchor) per cercare i file dall'immagine di output. |
| Linea 397: | Linea 133: |
| Example: {{{ dls inputimage > outputimage }}} Use any data carving tool to search the output image for files. List file and directory names in a forensic image. fls lists the files and directory names in the image and can display file names of recently deleted files for the directory using the given inode. This includes deleted files. If you have imaged your filesystem to a file named "loopfile", you can list the contents by running: {{{ |
* ''fls'' elenca i nomi dei file e delle cartelle di un immagine ed è in grado di visualizzare i nomi dei file eliminati di recente dalle cartelle con l'`inode` specificato. Se il filesystem è stato recuperato in un file chiamato "loopfile", è possibile elencarne il contenuto digitando in una finestra di terminale il seguente comando: {{{ |
| Linea 415: | Linea 141: |
| Copy file by inode. icat opens the named image(s) and copies the file with the specified inode number to standard output. Example: fls has shown you the inode number of some files on an image. To recover a file by using th einode number run: {{{ |
* `icat` apre l'immagine e copia i file con il numero di `inode` specificato sullo standard output. Se ''fls'' ha mostrato l'`inode` dei file presenti sull'immagine, per recuperare i file digitare in una finestra di terminale il seguente comando: {{{ |
| Linea 424: | Linea 144: |
sorter - Sort files in an image into categories based on file type. Sorter is a Perl script that analyzes a file system to organize the allocated and unallocated files by file type. Example: This will sort all the files found in /dev/sdc1 and put image files in a directory named "out": {{{ |
* `sorter` ordina i file presenti in un immagine per tipo di file. Per ordinare tutti i file presenti sul dispositivo `/dev/sdc1` e mettere il file immagine in una cartella denominata `out` digitare in una finestra di terminale il seguente comando: {{{ |
| Linea 434: | Linea 149: |
Here is a description of a script that will pull all files from an image using fls and icat: http://forums.gentoo.org/viewtopic-t-365703.html Another, similar script which attempts to "rebuild" the filesystem directory structure plus file content: http://matt.matzi.org.uk/2008/07/03/reconstructing-heavily-damaged-hard-drives/ == Cleaning up == from:[[http://www.linux.com/articles/56588|How to recover lost files after you accidentally wipe your hard drive]] Sort certain types of files: {{{ sudo mkdir recovery/VID recovery/JPG find recovery/ -name "*.avi" | xargs -i mv {} recovery/VID/ find recovery/ -name "*.mpg" | xargs -i mv {} recovery/VID/ find recovery/ -name "*.jpg" | xargs -i mv {} recovery/JPG/ }}} Eliminate small photos: {{{ sudo mkdir recovery/SMALL find recovery/JPG/ -name "*.jpg" -size -1024k | xargs -i mv {} recovery/SMALL/ }}} Rename jpegs according to exif data: {{{ find JPG/ -name "*.jpg" | xargs -i jhead -nf%Y%m%d-%H%M%S {} }}} Then, remove duplicates. {{{ find /var/recovery/JPG/ -name "*a.jpg" | xargs -i mv {} /var/recovery/JPG/DUPS/ }}} Copy files with matching strings: {{{ cd recovery mkdir ../copy/ grep -l "enter the string of text here" *.doc | xargs -i cp {} ../copy/ }}} == Prevention == The best way to avoid data loss is by performing regular backups. See: BackupYourSystem == Other links == * http://www.sleuthkit.org/informer/sleuthkit-informer-14.html#recover * http://goinggnu.wordpress.com/2008/02/14/recover-deleted-files-from-memory-card * http://www.linuxquestions.org/questions/linux-hardware-18/can-i-use-linux-to-recover-files-from-corrupted-hard-drive-784550/ |
In [http://forums.gentoo.org/viewtopic-t-365703.html questa pagina] viene mostrato uno script che estrae i file da un immagine usando `fls` e `icat`. [http://matt.matzi.org.uk/2008/07/03/reconstructing-heavily-damaged-hard-drives/ Questo script] invece il cercherà di ricostruire le cartelle del filesystem e la struttura dei file. |
| Linea 505: | Linea 154: |
| * [http://ubuntu-rescue-remix.org/ Ubuntu Rescue Remix] * [http://linux.die.net/man/1/foremost Pagina man foremost] * [http://www.linuxcertif.com/man/1/scalpel/ Pagina man Scalpel] * [http://www.itu.dk/people/jobr/magicrescue/manpage.html Pagina man Macig Rescue] * [http://linux.die.net/man/1/photorec Pagina man photorec] * [http://tfm.cz/man/1/recoverjpeg Pagina man recoverjpeg] * [https://help.ubuntu.com/community/DataRecovery/NtfsUndelete Guida a NTFSprogs su Ubuntu.com] * [http://www.sleuthkit.org/ Sito ufficiale di Sleuthkit e Autopsy] * [http://www.caine-live.net/ CAINE: distribuzione specifica per l'analisi forense] * [http://goinggnu.wordpress.com/2008/02/14/recover-deleted-files-from-memory-card Recuperare file cancellati da una memory card] * [http://www.linux.com/articles/56588 Come recuperare i file persi dopo aver cancellato accidentalmente i dati dall'hard disk] |
Indice(depth=1) Informazioni(rilasci="10.10 10.04 9.10 8.04"; forum="http://forum.ubuntu-it.org/index.php/topic,430020")
Introduzione
I file eliminati o persi accidentalmente possono essere recuperati con l'uso di programmi specifici, molti dei quali disponibili nei [:Repository:repository] di Ubuntu.
Premessa
Come premessa, occorre sottolineare che il modo migliore per evitare la perdita dei dati è di effettuare con cadenza regolare delle copie di backup. A questo proposito si rinvia alle [:AmministrazioneSistema/Backup:apposite guide].
Se il dispositivo ha subito un guasto meccanico, per non danneggiarlo ulteriormente e al fine di non compromettere la possibilità di recuperare i dati se sovrascritti, si consiglia di operare su un immagine del dispositivo stesso.
Anchor(live) Qualora si verifichi questa eventualità è raccomandabile spegnere immediatamente il computer e in seguito utilizzarlo solo mediante sistemi live in modo da potere analizzare questi dispositivi a [:Hardware/DispositiviPartizioni/MontarePartizioni:"partizioni smontate"]. Sarà necessario un altro dispositivo di archiviazione, di capienza pari o superiore a quello di origine. Bisogna considerare la necessità di ulteriore spazio qualora sia richiesto di intervenire mediante la creazione di un'immagine.
Se il guasto non è di natura meccanica è possibile, invece, recuperare i dati direttamente dal dispositivo.
Per avviare il sistema in modalità live è sufficiente [http://www.ubuntu-it.org/index.php?page=Ottenere_Ubuntu disporre] di una copia di Ubuntu Desktop Editition da potere avviare con il [:Installazione/Grafica:CD-ROM] o da un [:Installazione/DaSupportoUsb:dispositivo USB]. In alternativa, qualora si disponga si poca ram o si è privi di una connessione ad internet, è possibile utilizzare [http://ubuntu-rescue-remix.org/ Ubuntu rescue remix] oppure [http://www.sysresccd.org/Main_Page System Rescue Cd] i quali dispongono molti dei programmi di seguito menzionati.
Recuperare le partizioni
Fare riferimento alla [:GiuseppeTerrasi/Prove9:seguente pagina].
Creare un immagine di un dispositivo
Fare riferimento alla [:GiuseppeTerrasi/Prove9:seguente pagina].
Estrarre i dati da un immagine
Fare riferimento alla [:GiuseppeTerrasi/Prove9#estrarre:seguente pagina].
Estrarre singoli file dalla partizione recuperata
Foremost
[http://foremost.sourceforge.net/ Foremost] è un tool da riga di comando in grado di recuperare file da un certo numero di filesystem, inclusi i sistemi Fat, Ext3 e NTFS.
Supponendo che i file persi siano su /dev/hda, è necessario creare una cartella scrivibile su un altro disco in cui è possibile inserire i file recuperati (nell'esempio dev/sdb).
Montare il disco esterno e creare al suo interno una cartella chiamata foremost da utilizzare per il recupero:
sudo mount /dev/sdb1 /recovery sudo mkdir /recovery/foremost
Avviare foremost digitando in una finestra di terminale il seguente comando:
sudo foremost -i /dev/hda -o /recovery/foremost
Per avviare foremost su un file immagine semplicemente sostituire il percorso
sudo foremost -i image -o /recovery/foremost
I file recuperati saranno di proprietà dell'utente root. Per cambiare i permessi digitare in una finestra di terminale i seguenti comandi:
sudo chown -R youruser:youruser /recovery/foremost
dove youruser:youruser rappresentano rispettivamente l'utente e il gruppo di appartenenza.
Usare l'opzione -w solo per si desidera ottenere un analisi dei file recuperabili:
sudo foremost -w -i /dev/hda -o /recovery/foremost
Per recuperare uno specifico tipo di file usare l'opzione -t:
sudo foremost -t jpg -i /dev/hda -o /recovery/foremost
Per una panoramica dei file supportati da Foremost fare riferimento alla pagina man.
Scalpel
Scalpel recupera i file utilizzando come database le definizioni contenute [http://it.wikipedia.org/wiki/Formato_di_file negli header e nei footer] presenti all'interno di un file immagine o di un file .raw. È simile a Foremost e potrebbe avere dei miglioramenti.
Per impostazione predefinita, tutti i tipi di file presenti in /etc/scalpel/scalpel.conf sono commentati. Per specificare quali tipi di file si vogliono ricercare è necessario modificare il file decommentando le righe necessarie. Si allega un file [http://wiki.ubuntu-it.org/GiuseppeTerrasi/Prove8?action=AttachFile&do=get&target=scalpel.conf scalpel.conf di esempio] al fine di mostrare l'elenco dei file che è in grado di recuperare.
Digitare in una finestra di terminale il seguente comando
sudo scalpel file -o nome_cartella
dove file è il file immagine (o dispositivo) e nome_cartella è la cartella di destinazione.
Magic Rescue
[http://www.itu.dk/people/jobr/magicrescue/ Magic Rescue] è un programma che utilizza i cosiddetti [http://it.wikipedia.org/wiki/Formato_di_file magic number] per identificare la presenza e il tipo di file, e che può essere esteso a molti tipi di file attraverso l'uso di "recipes".
[:AmministrazioneSistema/InstallareProgrammi:Installare] il pacchetto [apt://magicrescue magicrescue].
Note that most of the provided recipes need other software installed to work, so open the desired recipes in /usr/share/magicrescue/recipes/ using a text editor and read the comments contained.
Per recuperare dei file con estensione gzip e .png da una partizione chiamata /dev/sda1, digitare in una finestra di terminale il seguente comando:
mkdir ~/output sudo magicrescue -r gzip -r png -d ~/output /dev/sda1
Questo scriverà i dati recuperati all'interno della cartella output dentro la cartella Home.
Photorec
PhotoRec è un programma di recupero dati creato inizialmente solo per recuperare immagini perse dalla memoria della fotocamera digitale o da dischi fissi. In seguito il supporto è stato esteso anche per file non audio o video. Consente la ricerca di 80 diversi tipi di file. PhotoRec fa parte del pacchetto [apt://testdisk testdisk].
Per avviare Photorec per analizzare un file immagine digitare il seguente comando in una finestra di terminale:
sudo photorec imagefilename
Per recuperare i file direttamente dal dispositivo oggetto di recupero, avviare il programma senza argomenti e selezionare i dispositivi disponibili dal menù:
sudo photorec
recoverjpeg
recoverjpeg è un programma specifico per l'identificazione e il recupero delle immagini in formato .jpeg.
[:AmministrazioneSistema/InstallareProgrammi:Installare] il pacchetto [apt://recoverjpeg recoverjpeg] e avviarlo digitando in una finestra di terminale il seguente comando:
sudo recoverjpeg /dev/hda1
sostituendo /dev/hda1 con il dispositivo sul quale si desidera indagare.
I file recuperati verranno salvati nella propria cartella Home, ogni immagine sarà salvata nel formato image*.jpg.
Ntfsprogs
Si veda il [https://help.ubuntu.com/community/DataRecovery/NtfsUndelete seguente documento] per questo strumento capace di recuperare file da un filesystem NTFS.
Sleuth Kit e Autopsy
Autopsy Forensic Browser è un'interfaccia grafica per la suite The Sleuth Kit. Sono in grado di analizzare i dischi di Windows e UNIX e file system come NTFS, FAT, UFS1/2, Ext2/3.
Sono entrambi Open Source e disponibili su piattaforme UNIX. Autopsy essendo HTML-based è possibile connettersi ad esso da qualsiasi piattaforma attraverso l'uso di un browser. Autopsy mostrerà i dettagli circa i dati cancellati e la struttura del filesystem.
Autopsy
Autopsy può essere avviato da un live CD. Bisognerà indicare un disco sul quale salvare le informazioni estratte e un indirizzo IP verso il quale connettersi.
Per esempio, assumendo che si disponga di un dispositivo montato in /media/disk con una cartella chiamata autopsy e che l'indirizzo IP sia 192.168.0.1:
sudo autopsy -d /media/disk/autopsy 192.168.0.1
Sleuthkit
Estrarre i blocchi non allocati (cancellati) da un dispositivo o da un file immagine:
dls inputimage > outputimage
Utilizzare un programma di recupero dati (fare anchor) per cercare i file dall'immagine di output.fls elenca i nomi dei file e delle cartelle di un immagine ed è in grado di visualizzare i nomi dei file eliminati di recente dalle cartelle con l'inode specificato. Se il filesystem è stato recuperato in un file chiamato "loopfile", è possibile elencarne il contenuto digitando in una finestra di terminale il seguente comando:
fls loopfile -r -f fat -i raw r/r 3: test (Volume Label Entry) r/r * 5: sample.docx r/r * 7: sample.pptx r/r * 9: sample.xlsx
icat apre l'immagine e copia i file con il numero di inode specificato sullo standard output. Se fls ha mostrato l'inode dei file presenti sull'immagine, per recuperare i file digitare in una finestra di terminale il seguente comando:
icat -r -f fat -i raw loopfile 5 > sample.docx
sorter ordina i file presenti in un immagine per tipo di file. Per ordinare tutti i file presenti sul dispositivo /dev/sdc1 e mettere il file immagine in una cartella denominata out digitare in una finestra di terminale il seguente comando:
sudo sorter -h -s -i raw -f fat -d out -C /usr/share/sleuthkit/windows.sort /dev/sdc1
In [http://forums.gentoo.org/viewtopic-t-365703.html questa pagina] viene mostrato uno script che estrae i file da un immagine usando fls e icat. [http://matt.matzi.org.uk/2008/07/03/reconstructing-heavily-damaged-hard-drives/ Questo script] invece il cercherà di ricostruire le cartelle del filesystem e la struttura dei file.
Ulteriori risorse
[https://help.ubuntu.com/community/DataRecovery Documento originale]
[http://ubuntu-rescue-remix.org/ Ubuntu Rescue Remix]
[http://linux.die.net/man/1/foremost Pagina man foremost]
[http://www.linuxcertif.com/man/1/scalpel/ Pagina man Scalpel]
[http://www.itu.dk/people/jobr/magicrescue/manpage.html Pagina man Macig Rescue]
[http://linux.die.net/man/1/photorec Pagina man photorec]
[http://tfm.cz/man/1/recoverjpeg Pagina man recoverjpeg]
[https://help.ubuntu.com/community/DataRecovery/NtfsUndelete Guida a NTFSprogs su Ubuntu.com]
[http://www.sleuthkit.org/ Sito ufficiale di Sleuthkit e Autopsy]
[http://www.caine-live.net/ CAINE: distribuzione specifica per l'analisi forense]
[http://goinggnu.wordpress.com/2008/02/14/recover-deleted-files-from-memory-card Recuperare file cancellati da una memory card]
[http://www.linux.com/articles/56588 Come recuperare i file persi dopo aver cancellato accidentalmente i dati dall'hard disk]
