Skip to content

Commit becbcc3

Browse files
committed
Use restructuredtext roles: command and file.
1 parent 2298dc3 commit becbcc3

24 files changed

+161
-141
lines changed

after_using_photorec.rst

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
After using PhotoRec
22
====================
3-
Usually PhotoRec and QPhotorec recover a lot of files but without the original filenames, it may be hard to locate the files you are interested in.
3+
Usually PhotoRec and QPhotoRec recover a lot of files but without the original filenames, it may be hard to locate the files you are interested in.
44

55
Sorting the files by extension
66
******************************
@@ -11,7 +11,7 @@ https://github.com/lconte/Copy-PhotoRecFilesbyExtension.ps1
1111

1212
Using a Python script
1313
---------------------
14-
Python comes preinstalled on macOS and most Linux distribution. It can also be installed under Windows.
14+
Python comes preinstalled on macOS and most Linux distributions. It can also be installed under Windows.
1515
The Python program `sort-PhotorecRecoveredFiles <https://github.com/tfrdidi/sort-PhotorecRecoveredFiles>`_
1616

1717
* sorts all files by file extensions into own folders.
@@ -21,27 +21,37 @@ The Python program `sort-PhotorecRecoveredFiles <https://github.com/tfrdidi/sort
2121
Renaming files using exiftool
2222
*****************************
2323
exiftool can use meta-data from several popular file formats to rename files.
24-
All Linux distributions comes with a package for exiftool (perl-Image-ExifTool for RedHat, CentOS and Fedora) but otherwise it is available for Windows, Linux and macOS from http://www.sno.phy.queensu.ca/~phil/exiftool/
24+
All Linux distributions comes with a package for :command:`exiftool` (file:`perl-Image-ExifTool` for Red Hat, CentOS and Fedora) but otherwise it is available for Windows, Linux and macOS from https://www.sno.phy.queensu.ca/~phil/exiftool/
2525

2626

2727
.. code-block:: none
2828
29-
exiftool -r -ext jpg '-FileName<DateTimeOriginal' -d sorted_jpg/%Y%m%d/%Y%m%d_%H%M%S%%-c.%%e jpg/
30-
exiftool -r -ext tif '-FileName<DateTimeOriginal' -d sorted_tif/%Y%m%d/%Y%m%d_%H%M%S%%-c.%%e tif/
3129
exiftool -r -ext avi '-FileName<DateTimeOriginal' -d avi/%Y%m%d_%H%M%S%%-c.%%e avi/
3230
exiftool -r -ext doc '-FileName<CreateDate' -d doc/%Y%m/%%f.%%e doc/
31+
exiftool -r -ext jpg '-FileName<DateTimeOriginal' -d sorted_jpg/%Y%m%d/%Y%m%d_%H%M%S%%-c.%%e jpg/
3332
exiftool -r -ext mov '-FileName<CreateDate' -d mov/%Y%m%d_%H%M%S%%-c.%%e mov/
34-
exiftool -r -ext mp3 '-FileName<mp3/${artist;} - ${Album;} - ${Track;} - ${Title;}%-c.%e' mp3/
35-
exiftool -r -ext mp4 '-FileName<CreateDate' -d mp4/%Y%m%d_%H%M%S%%-c.%%e mp4/
33+
exiftool -r -ext mp3 '-FileName<mp3/${artist;} - ${Album;} - ${Track;} - ${Title;}%-c.%e' mp3/f*.mp3
34+
exiftool -r -ext mp3 '-FileName<mp3/${artist;} - ${Album;} - ${Title;}%-c.%e' -if 'not defined $Track and defined $Title and $Title ne ""' mp3/f*.mp3
35+
exiftool -r -ext mp3 '-FileName<mp3/${artist;} - ${Title;}%-c.%e' -if 'not defined $Track and not defined $Album and defined $Title and $Title ne ""' mp3/f*.mp3
36+
exiftool -r -ext mp3 '-FileName<mp3/${artist;} - ${Album;}%-c.%e' -if 'not defined $Track and (not defined $Title or $Title eq "")' mp3/f*.mp3
37+
exiftool -r -ext ogg '-FileName<ogg/${artist;} - ${Album;} - ${Track;} - ${Title;}%-c.%e' ogg/f*.ogg
38+
exiftool -r -ext ogg '-FileName<ogg/${artist;} - ${Album;} - ${Title;}%-c.%e' -if 'not defined $Track and defined $Title and $Title ne ""' ogg/f*.ogg
39+
exiftool -r -ext ogg '-FileName<ogg/${artist;} - ${Title;}%-c.%e' -if 'not defined $Track and not defined $Album and defined $Title and $Title ne ""' ogg/f*.ogg
40+
exiftool -r -ext ogg '-FileName<ogg/${artist;} - ${Album;}%-c.%e' -if 'not defined $Track and (not defined $Title or $Title eq "")' ogg/f*.ogg
3641
exiftool -r -ext m4p '-FileName<m4p/${Artist;} - ${Album;} - ${Title;}%-c.%e' m4p/
3742
exiftool -r -ext mkv '-FileName<%f_${Title;}%-c.%e' mkv/
43+
exiftool -r -ext mp4 '-FileName<CreateDate' -d mp4/%Y%m%d_%H%M%S%%-c.%%e mp4/
44+
exiftool -r -ext ps '-FileName<%f_${Title;}%-c.%e' ps/
45+
exiftool -r -ext rtf '-FileName<%f_${Title;}%-c.%e' rtf/
46+
exiftool -r -ext tif '-FileName<DateTimeOriginal' -d sorted_tif/%Y%m%d/%Y%m%d_%H%M%S%%-c.%%e tif/
3847
exiftool -r -ext ttf '-FileName<ttf/${FontName;}%-c.%e' ttf/
48+
exiftool -r -ext wma '-FileName<wma/${AlbumArtist;} - ${AlbumTitle;} - ${TrackNumber;}%-c.%e' wma/
3949
4050
exiftool -r -ext jpg '-FileName<IMG_${FileIndex}%-c.%e' recup_dir.*
4151
4252
Removing duplicated files
4353
*************************
44-
Under Linux, fslint can be used to remove duplicated files
54+
Under Linux, :command:`fslint` can be used to remove duplicated files
4555

4656
.. code-block:: none
4757

bootable.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@ How to make the system bootable again
44
Check that
55

66
* all partitions are listed in the partition table
7-
* a partition with your computer os is listed as \*(bootable)
7+
* a partition with your computer OS is listed as \*(bootable)
88
* you can list the files from the bootable partition
99

1010

1111
DOS - Window 95/98
1212
------------------
1313

14-
If your OS doesn't boot, you can reinstall the system files with ``sys c:``.
14+
If your OS doesn't boot, you can reinstall the system files with :command:`sys c:`.
1515

1616
Windows 2000/XP/2003
1717
--------------------
1818

19-
* Run fixmbr from the Recovery Console
19+
* Run :command:`fixmbr` from the Recovery Console
2020

2121
.. code-block:: none
2222
2323
fixmbr \Device\HardDisk0
2424
2525
If you still have the problem,
2626

27-
* Run `fixboot` to repair NTFS boot sector.
28-
* Check ``c:\boot.ini`` content
27+
* Run :command:`fixboot` to repair NTFS boot sector.
28+
* Check :file:`c:\\boot.ini` content
2929

3030
Windows Vista/Windows 7/..., Windows Server 2008/...
3131
----------------------------------------------------
32-
* Run ``bootrec.exe /fixmbr`` from the Recovery Console
33-
* For legacy / PC Intel partition table, check ``c:\boot.ini`` content
34-
* For EFI GPT, check the output of ``bcdedit /v``. To modify the settings, use the ``bcdedit /set`` command.
35-
* Run ``bootrec.exe /fixboot`` to repair NTFS boot sector.
32+
* Run :command:`bootrec.exe /fixmbr` from the Recovery Console
33+
* For legacy / PC Intel partition table, check :file:`c:\\boot.ini` content
34+
* For EFI GPT, check the output of :command:`bcdedit /v`. To modify the settings, use the :command:`bcdedit /set` command.
35+
* Run :command:`bootrec.exe /fixboot` to repair NTFS boot sector.
3636

3737
Linux/FreeBSD
3838
-------------
3939

40-
* Update your /etc/fstab to reflect the new partition order.
40+
* Update your :file:`/etc/fstab` to reflect the new partition order.
4141
* Update your multiboot configuration
4242

43-
* Lilo: /etc/lilo.conf
44-
* Grub: /boot/grub/grub.conf
45-
* Grub2: /etc/grub2-efi.cfg
43+
* Lilo: :file:`/etc/lilo.conf`
44+
* Grub: :file:`/boot/grub/grub.conf`
45+
* Grub2: :file:`/etc/grub2-efi.cfg`
4646

4747
* Reinstall the multiboot in the Master Boot Record.
4848

compilation.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Once you have downloaded the source archive from https://www.cgsecurity.org/wiki
77

88
.. code-block:: none
99
10-
tar xjf testdisk-7.1-WIP.tar.bz2
11-
cd testdisk-7.1-WIP
10+
tar xjf testdisk-7.2-WIP.tar.bz2
11+
cd testdisk-7.2-WIP
1212
./configure && make
1313
1414
@@ -19,7 +19,7 @@ Compilation from git repository
1919
2020
git clone https://git.cgsecurity.org/testdisk.git
2121
22-
If you have already cloned the project, to update your local copy, run ``git pull`` from the testdisk directory.
22+
If you have already cloned the project, to update your local copy, run :command:`git pull` from the :file:`testdisk` directory.
2323

2424
.. code-block:: none
2525

compilation_env.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Compilation environment
22
***********************
3-
testdisk uses several libraries if available:
3+
TestDisk uses several libraries if available:
44

55
* libncurses - Required, TestDisk and PhotoRec use a text user interface, Ncurses library and development files must be available.
66
* Ext2fs library - Optional, used by TestDisk to list files from ext2/ext3/ext4 partition and by PhotoRec to be able to carve the free space from an ext2/ext3 partition instead of the whole partition
@@ -16,7 +16,6 @@ Linux
1616
-----
1717

1818
* Debian/Ubuntu: ``apt-get install build-essential e2fslibs-dev libewf-dev libncurses5-dev libncursesw5-dev ntfs-3g-dev libjpeg-dev uuid-dev zlib1g-dev qtbase5-dev qttools5-dev-tools pkg-config dh-autoreconf git``
19-
* RHEL/CentOS 5: ``yum install buildsys-build e2fsprogs-devel libjpeg-devel ncurses-devel ntfs-3g-devel zlib-devel git``
2019
* RHEL/CentOS 6 or later: ``yum install @buildsys-build desktop-file-utils e2fsprogs-devel libewf-devel libjpeg-devel libuuid-devel ncurses-devel ntfs-3g-devel qt-devel qt5-qtbase-devel zlib-devel git``
2120
* Fedora: ``dnf install @buildsys-build desktop-file-utils e2fsprogs-devel libewf-devel libjpeg-devel libuuid-devel ncurses-devel ntfs-3g-devel qt-devel qt5-qtbase-devel zlib-devel git``
2221

@@ -28,8 +27,8 @@ Windows
2827
-------
2928
cygwin
3029
^^^^^^
31-
Cygwin https://cygwin.com/ is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows, it includes the gcc compiler.
32-
A DLL (cygwin1.dll) provides substantial POSIX API functionality, such functions may be required by some libraries that TestDisk or PhotoRec can use.
30+
Cygwin https://cygwin.com/ is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows, it includes the GCC compiler.
31+
A DLL (:file:`cygwin1.dll`) provides substantial POSIX API functionality, such functions may be required by some libraries that TestDisk or PhotoRec can use.
3332

3433
MinGW-w64
3534
^^^^^^^^^

conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# ones.
3333
extensions = [
3434
# 'sphinx.ext.githubpages',
35-
'rst2pdf.pdfbuilder'
35+
# 'rst2pdf.pdfbuilder'
3636
]
3737

3838
# Add any paths that contain templates here, relative to this directory.

crosscompilation_env.rst

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
Cross Compilation environment
22
*****************************
33
Using Linux, it's possible to generate binaries for Windows.
4-
Two cross-compiler toolchains are available under Fedora and CentOS 7 to create binaries for Windows 32 and 64 bits.
4+
Two cross-compiler toolchains are available under Fedora to create binaries for Windows 32 and 64 bits.
55
All packages needed are available at
66

7-
* Windows cygwin target: https://copr.fedorainfracloud.org/coprs/grenier/cygwin-testdisk/
8-
* Windows mingw target: https://copr.fedorainfracloud.org/coprs/grenier/mingw-testdisk/
7+
* Windows Cygwin target
98

10-
testdisk, photorec and fidentify official binaries are generated using cygwin,
11-
qphotorec using mingw.
9+
* https://copr.fedorainfracloud.org/coprs/grenier/cygwin-testdisk/
10+
* https://copr.fedorainfracloud.org/coprs/yselkowitz/cygwin/
11+
12+
* Windows MinGW target
13+
14+
* https://copr.fedorainfracloud.org/coprs/grenier/mingw-testdisk/
15+
16+
:command:`testdisk`, :command:`photorec` and :command:`fidentify` official binaries are generated using Cygwin,
17+
:command:`qphotorec` using MinGW.

ddrescue.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
DDRescue: data recovery from damaged disk
22
=========================================
33

4-
A bad sector is a sector on a computer's disk drive that is either inaccessible or unwriteable due to permanent damage, such as physical damage to the disk surface.
4+
A bad sector is a sector on a computer's disk drive that is either inaccessible or unwritable due to permanent damage, such as physical damage to the disk surface.
55
Flash memory may also have "bad sectors" (even if technically there is no sector in flash memory) due to permanent damage like failed flash memory transistors.
66

77
Instead of working directly on the damaged disk, it's recommended to create a copy and to work on the clone.
88
Two possibilities: create a disk image (a file) or overwrite a new/empty disk.
99

10-
ddrescue can be found for Linux or macOS. If your computer is using another operating system, no problem, create a Linux LiveUSB! (See :ref:`live-usb`)
10+
ddrescue can be found for Linux or macOS. If your computer is using another operating system, no problem, create a Linux Live USB! (See :ref:`live-usb`)
1111

1212
ddrescue on Linux
1313
*****************
14-
drescue is available on all Linux distribution.
14+
ddrescue is available on all Linux distribution.
1515

1616
* CentOS: ``yum install ddrescue``
1717
* Debian/Ubuntu: ``apt install gddrescue``
1818
* Fedora: ``dnf install ddrescue``
1919

20-
Use ``lsblk`` or ``testdisk -lu`` to identify all the disks.
20+
Use :command:`lsblk` or :command:`testdisk -lu` to identify all the disks.
2121

2222
ddrescue on macOS
2323
*****************
2424
To install ddrescue:
2525

26-
* Press Command+Space and type ``Terminal`` and press enter/return key.
26+
* Press Command+Space and type :command:`Terminal` and press enter/return key.
2727
* Run in Terminal app:
2828

2929
.. code-block:: none
@@ -32,22 +32,22 @@ To install ddrescue:
3232
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3333
brew install ddrescue
3434
35-
Done! You can now use ``ddrescue``.
36-
Use ``diskutil list`` to get information on all available disks and their partitioning.
35+
Done! You can now use :command:`ddrescue`.
36+
Use :command:`diskutil list` to get information on all available disks and their partitioning.
3737

3838
DDRescue: disk to file image
3939
****************************
4040
It's the recommended method for forensic purpose.
4141
You need enough space to store the file: if you want to create a clone of a 1TB disk, you need at least 1TB free on a filesystem.
4242
Avoid FAT filesystem for the destination as they are limited to 4GB file.
4343

44-
In the following example, an image named sdb.dd will be created from the second disk /dev/sdb.
44+
In the following example, an image named :file:`sdb.dd` will be created from the second disk :file:`/dev/sdb`.
4545

4646
.. code-block:: none
4747
4848
ddrescue /dev/sdb sdb.dd sdb.log
4949
50-
The log file ``sdb.log`` can be used to restart the recovery.
50+
The log file :file:`sdb.log` can be used to restart the recovery.
5151
It can take a few hours to several days to clone a disk with a lot of bad sectors.
5252

5353
DDRescue: disk to disk copy
@@ -56,13 +56,13 @@ The destination disk must be at least as big as the original one. Be careful, tw
5656

5757
Ie. WD10EZRZ and WD10EZEX are two models sold by Western Digital as 1TB model, in fact the first one is 1,000,000 MB, the second one 1,000,204 MB.
5858

59-
Before beginning, disconnect all disks, usb device, cd/dvd reader/writer not needed: there is less chance to overwrite the wrong disk.
59+
Before beginning, disconnect all disks, USB device, CD/DVD reader/writer not needed: there is less chance to overwrite the wrong disk.
6060

6161
.. code-block:: none
6262
6363
ddrescue /dev/sdb /dev/sdc sdb.log
6464
65-
The log file ``sdb.log`` can be used to restart the recovery.
65+
The log file :file:`sdb.log` can be used to restart the recovery.
6666

6767

6868
ddrutility: restricting ddrescue to NTFS allocated data block

dfrws2006.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DFRWS 2006 Forensics Challenge
66

77
DFRWS 2006 Forensics Challenge is a data carving challenge. It's possible to use PhotoRec to recover most files:
88

9-
* run `photorec dfrws-2006-challenge.raw`
9+
* run :command:`photorec dfrws-2006-challenge.raw`
1010
* Choose Proceed
1111
* Go In Options menu
1212
* Set "Paranoid : Yes (Brute force enabled)"

dftt_fat16_undelete.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This test image is a 6MB FAT16 file system with six deleted files and two delete
66

77
To undelete all files manually,
88

9-
* run `testdisk 6-fat-undel.dd`
9+
* run :command:`testdisk 6-fat-undel.dd`
1010
* Choose `Proceed`.
1111
* A non partitioned media is detected automatically, press Enter to confirm.
1212
* Choose `Undelete`.
@@ -27,7 +27,7 @@ All files are copied.
2727
* Choose [Quit] until you have exited all menus
2828

2929
The usual filenames for a FAT filesystem are composed of 8 chars for the name and 3 for the extension.
30-
When a file is deleted, the first character of the filename is overwritten. TestDisk represents the lost char by a underscore `_` (e.g. `_RAG1.DAT` instead of `FRAG1.DAT`)
30+
When a file is deleted, the first character of the filename is overwritten. TestDisk represents the lost char by a underscore `_` (e.g. :file:`_RAG1.DAT` instead of :file:`FRAG1.DAT`)
3131
If a long filename (> 8 characters) is present, it will be use instead. A benefit is that the whole filename can be displayed (e.g. `System Volume Information`)
3232

3333
All files are recovered successfully except the 3 fragmented files.

dftt_ntfs_undelete.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Download the small `NTFS filesystem <https://sourceforge.net/projects/dftt/files
44

55
To undelete all files manually,
66

7-
* run `testdisk 7-ntfs-undel.dd`
7+
* run :command:`testdisk 7-ntfs-undel.dd`
88
* Choose `Proceed`.
99
* A non partitioned media is detected automatically, press Enter to confirm.
1010
* Choose `Undelete`.
1111

12-
TestDisk lists all lost files successfully. The alternate data stream is listed as `./mult1.dat:ADS`, alternate streams are not listed in Windows Explorer, and their size is not included in the file's size. Malware has used alternate data streams to hide code. As a result, malware scanners and other special tools now check for alternate data streams. Forensics analyst should also search for them as they may be used to hide documents.
12+
TestDisk lists all lost files successfully. The alternate data stream is listed as :file:`./mult1.dat:ADS`, alternate streams are not listed in Windows Explorer, and their size is not included in the file's size. Malware has used alternate data streams to hide code. As a result, malware scanners and other special tools now check for alternate data streams. Forensics analyst should also search for them as they may be used to hide documents.
1313

1414
* Press 'C' (uppercase) to copy all selected files and directories.
1515
* Choose a destination to copy all the files: use the arrow keys (up, down, left, right) to navigate, you can also use the enter key to enter into a directory.

forensics.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The content of a disk may be modified by simply connecting it to a computer:
55

66
* LVM driver will sync two RAID1-like volumes if they are out of sync
77
* Linux Raid and fake Raid will also resync the disks if they are out of sync
8-
* Auto-mouting of the filesystem will modify the last-mount date and the mount count
8+
* Auto-mounting of the filesystem will modify the last-mount date and the mount count
99
* ext3 and ext4 will replay the journal if the filesystem is dirty.
1010
* The NTFS file system may attempt to commit or rollback unfinished transactions, and/or change flags on the volume to mark it as "in use".
1111
* The operating system will update the access time for any file accessed
@@ -21,7 +21,7 @@ updates in service area each time the device is powered-on.). It remains the bes
2121
Without a hardware write blocker, it's still possible to reduce the risks of accidental modifications.
2222
Using a Linux computer without graphical interface and without auto-mounting *may* be considered a good enough solution.
2323

24-
Under Linux, `blockdev` or `hdparm` can be used to switch a disk to read-only:
24+
Under Linux, :command:`blockdev` or :command:`hdparm` can be used to switch a disk to read-only:
2525

2626
.. code-block:: none
2727
@@ -38,7 +38,7 @@ Loopback device is a safer alternative:
3838
losetup -r /dev/loop0 /dev/sdb
3939
testdisk /dev/loop0
4040
41-
This way testdisk is forced to open the device in read-only.
41+
This way TestDisk is forced to open the device in read-only.
4242

4343

4444
Loopback can also be used to mount a filesystem in read-only:

0 commit comments

Comments
 (0)